From andrew at codeconstruct.com.au Tue Jul 1 10:16:50 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Tue, 01 Jul 2025 09:46:50 +0930 Subject: [PATCH v5] ARM: dts: aspeed: yosemite4: add gpio name for uart mux sel In-Reply-To: <20250630073138.3315947-1-marshall_zhan@wiwynn.com> References: <20250630073138.3315947-1-marshall_zhan@wiwynn.com> Message-ID: <175132901095.54792.12200042730026640443.b4-ty@codeconstruct.com.au> On Mon, 30 Jun 2025 15:31:37 +0800, Marshall Zhan wrote: > Add gpio line name to support multiplexed console > > Thanks, I've applied this to be picked up through the BMC tree. -- Andrew Jeffery From jammy_huang at aspeedtech.com Wed Jul 2 11:19:54 2025 From: jammy_huang at aspeedtech.com (Jammy Huang) Date: Wed, 2 Jul 2025 09:19:54 +0800 Subject: [PATCH v6 0/2] ASPEED: Add mailbox driver for AST2700 series Message-ID: <20250702011956.47479-1-jammy_huang@aspeedtech.com> Add mailbox controller driver for AST27XX SoCs, which provides independent tx/rx mailbox between different processors. There are 4 channels for each tx/rx mailbox and each channel has an 32-byte FIFO. v6 changes: - Update document 1. Update description to preserve paragraphs. 2. Update for property, reg. 3. Add reg-names. 4. Add 'Reviewed-by' from Krok. - Update driver 1. Use devm_platform_ioremap_resource_byname since we add reg-names now. 2. Update error code for ch not enabled. v5 changes: - Update document 1. Separate reg from 1 to 2. 1st is tx controller; 2nd is rx. 2. Remove 'Reviewed-by' since the patch has changed. - Update driver, no functional changes. 1. Update since there is 2 reg base now. 2. Refine reg definitions 3. Add spinlock to protect registers 4. Use bool as return value for ast2700_mbox_tx_done 5. Rename variable from drv_data to dev_data. v4 changes: - Update driver, no functional changes. 1. Remove unused variable, rx_buff, in struct ast2700_mbox. 2. Remove unneeded cast on device_get_match_data. 3. Remove the usage of writel/readl_relaxed. 4. Improve readability. v3 changes: - Correct document 1. Use 32-bit addressing in dts example property, reg. v2 changes: - Update document 1. Correct error in dts example. 2. Drop description for mbox-cell per suggestion previously. Jammy Huang (2): dt-bindings: mailbox: Add ASPEED AST2700 series SoC mailbox: aspeed: add mailbox driver for AST27XX series SoC .../mailbox/aspeed,ast2700-mailbox.yaml | 68 +++++ drivers/mailbox/Kconfig | 8 + drivers/mailbox/Makefile | 2 + drivers/mailbox/ast2700-mailbox.c | 240 ++++++++++++++++++ 4 files changed, 318 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/aspeed,ast2700-mailbox.yaml create mode 100644 drivers/mailbox/ast2700-mailbox.c base-commit: ec7714e4947909190ffb3041a03311a975350fe0 -- 2.25.1 From jammy_huang at aspeedtech.com Wed Jul 2 11:19:55 2025 From: jammy_huang at aspeedtech.com (Jammy Huang) Date: Wed, 2 Jul 2025 09:19:55 +0800 Subject: [PATCH v6 1/2] dt-bindings: mailbox: Add ASPEED AST2700 series SoC In-Reply-To: <20250702011956.47479-1-jammy_huang@aspeedtech.com> References: <20250702011956.47479-1-jammy_huang@aspeedtech.com> Message-ID: <20250702011956.47479-2-jammy_huang@aspeedtech.com> Introduce the mailbox module for AST27XX series SoC, which is responsible for interchanging messages between asymmetric processors. Signed-off-by: Jammy Huang Reviewed-by: Krzysztof Kozlowski --- .../mailbox/aspeed,ast2700-mailbox.yaml | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/aspeed,ast2700-mailbox.yaml diff --git a/Documentation/devicetree/bindings/mailbox/aspeed,ast2700-mailbox.yaml b/Documentation/devicetree/bindings/mailbox/aspeed,ast2700-mailbox.yaml new file mode 100644 index 000000000000..600e2d63fccd --- /dev/null +++ b/Documentation/devicetree/bindings/mailbox/aspeed,ast2700-mailbox.yaml @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mailbox/aspeed,ast2700-mailbox.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ASPEED AST2700 mailbox controller + +maintainers: + - Jammy Huang + +description: > + ASPEED AST2700 has multiple processors that need to communicate with each + other. The mailbox controller provides a way for these processors to send + messages to each other. It is a hardware-based inter-processor communication + mechanism that allows processors to send and receive messages through + dedicated channels. + + The mailbox's tx/rx are independent, meaning that one processor can send a + message while another processor is receiving a message simultaneously. + There are 4 channels available for both tx and rx operations. Each channel + has a FIFO buffer that can hold messages of a fixed size (32 bytes in this + case). + + The mailbox controller also supports interrupt generation, allowing + processors to notify each other when a message is available or when an event + occurs. + +properties: + compatible: + const: aspeed,ast2700-mailbox + + reg: + items: + - description: TX control register + - description: RX control register + + reg-names: + items: + - const: tx + - const: rx + + interrupts: + maxItems: 1 + + "#mbox-cells": + const: 1 + +required: + - compatible + - reg + - reg-names + - interrupts + - "#mbox-cells" + +additionalProperties: false + +examples: + - | + #include + + mailbox at 12c1c200 { + compatible = "aspeed,ast2700-mailbox"; + reg = <0x12c1c200 0x100>, <0x12c1c300 0x100>; + reg-names = "tx", "rx"; + interrupts = ; + #mbox-cells = <1>; + }; -- 2.25.1 From jammy_huang at aspeedtech.com Wed Jul 2 11:19:56 2025 From: jammy_huang at aspeedtech.com (Jammy Huang) Date: Wed, 2 Jul 2025 09:19:56 +0800 Subject: [PATCH v6 2/2] mailbox: aspeed: add mailbox driver for AST27XX series SoC In-Reply-To: <20250702011956.47479-1-jammy_huang@aspeedtech.com> References: <20250702011956.47479-1-jammy_huang@aspeedtech.com> Message-ID: <20250702011956.47479-3-jammy_huang@aspeedtech.com> Add mailbox controller driver for AST27XX SoCs, which provides independent tx/rx mailbox between different processors. There are 4 channels for each tx/rx mailbox and each channel has an 32-byte FIFO. Signed-off-by: Jammy Huang --- drivers/mailbox/Kconfig | 8 + drivers/mailbox/Makefile | 2 + drivers/mailbox/ast2700-mailbox.c | 240 ++++++++++++++++++++++++++++++ 3 files changed, 250 insertions(+) create mode 100644 drivers/mailbox/ast2700-mailbox.c diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig index 68eeed660a4a..1c38cd570091 100644 --- a/drivers/mailbox/Kconfig +++ b/drivers/mailbox/Kconfig @@ -340,4 +340,12 @@ config THEAD_TH1520_MBOX kernel is running, and E902 core used for power management among other things. +config AST2700_MBOX + tristate "ASPEED AST2700 IPC driver" + depends on ARCH_ASPEED || COMPILE_TEST + help + Mailbox driver implementation for ASPEED AST27XX SoCs. This driver + can be used to send message between different processors in SoC. + The driver provides mailbox support for sending interrupts to the + clients. Say Y here if you want to build this driver. endif diff --git a/drivers/mailbox/Makefile b/drivers/mailbox/Makefile index 13a3448b3271..9a9add9a7548 100644 --- a/drivers/mailbox/Makefile +++ b/drivers/mailbox/Makefile @@ -72,3 +72,5 @@ obj-$(CONFIG_QCOM_CPUCP_MBOX) += qcom-cpucp-mbox.o obj-$(CONFIG_QCOM_IPCC) += qcom-ipcc.o obj-$(CONFIG_THEAD_TH1520_MBOX) += mailbox-th1520.o + +obj-$(CONFIG_AST2700_MBOX) += ast2700-mailbox.o diff --git a/drivers/mailbox/ast2700-mailbox.c b/drivers/mailbox/ast2700-mailbox.c new file mode 100644 index 000000000000..6d9269e89979 --- /dev/null +++ b/drivers/mailbox/ast2700-mailbox.c @@ -0,0 +1,240 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright Aspeed Technology Inc. (C) 2025. All rights reserved + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Each bit in the register represents an IPC ID */ +#define IPCR_TX_TRIG 0x00 +#define IPCR_ENABLE 0x04 +#define IPCR_STATUS 0x08 +#define RX_IRQ(n) BIT(n) +#define RX_IRQ_MASK 0xf +#define IPCR_DATA 0x10 + +struct ast2700_mbox_data { + u8 num_chans; + u8 msg_size; +}; + +struct ast2700_mbox { + struct mbox_controller mbox; + u8 msg_size; + void __iomem *tx_regs; + void __iomem *rx_regs; + spinlock_t lock; +}; + +static inline int ch_num(struct mbox_chan *chan) +{ + return chan - chan->mbox->chans; +} + +static inline bool ast2700_mbox_tx_done(struct ast2700_mbox *mb, int idx) +{ + return !(readl(mb->tx_regs + IPCR_STATUS) & BIT(idx)); +} + +static irqreturn_t ast2700_mbox_irq(int irq, void *p) +{ + struct ast2700_mbox *mb = p; + void __iomem *data_reg; + int num_words; + u32 *word_data; + u32 status; + int n; + + /* Only examine channels that are currently enabled. */ + status = readl(mb->rx_regs + IPCR_ENABLE) & + readl(mb->rx_regs + IPCR_STATUS); + + if (!(status & RX_IRQ_MASK)) + return IRQ_NONE; + + for (n = 0; n < mb->mbox.num_chans; ++n) { + struct mbox_chan *chan = &mb->mbox.chans[n]; + + if (!(status & RX_IRQ(n))) + continue; + + /* Read the message data */ + for (data_reg = mb->rx_regs + IPCR_DATA + mb->msg_size * n, + word_data = chan->con_priv, + num_words = (mb->msg_size / sizeof(u32)); + num_words; + num_words--, data_reg += sizeof(u32), word_data++) + *word_data = readl(data_reg); + + mbox_chan_received_data(chan, chan->con_priv); + + /* The IRQ can be cleared only once the FIFO is empty. */ + writel(RX_IRQ(n), mb->rx_regs + IPCR_STATUS); + } + + return IRQ_HANDLED; +} + +static int ast2700_mbox_send_data(struct mbox_chan *chan, void *data) +{ + struct ast2700_mbox *mb = dev_get_drvdata(chan->mbox->dev); + void __iomem *data_reg; + u32 *word_data; + int num_words; + int idx = ch_num(chan); + + if (!(readl(mb->tx_regs + IPCR_ENABLE) & BIT(idx))) { + dev_warn(mb->mbox.dev, "%s: Ch-%d not enabled yet\n", __func__, idx); + return -ENODEV; + } + + if (!(ast2700_mbox_tx_done(mb, idx))) { + dev_warn(mb->mbox.dev, "%s: Ch-%d last data has not finished\n", __func__, idx); + return -EBUSY; + } + + /* Write the message data */ + for (data_reg = mb->tx_regs + IPCR_DATA + mb->msg_size * idx, + word_data = (u32 *)data, + num_words = (mb->msg_size / sizeof(u32)); + num_words; + num_words--, data_reg += sizeof(u32), word_data++) + writel(*word_data, data_reg); + + writel(BIT(idx), mb->tx_regs + IPCR_TX_TRIG); + dev_dbg(mb->mbox.dev, "%s: Ch-%d sent\n", __func__, idx); + + return 0; +} + +static int ast2700_mbox_startup(struct mbox_chan *chan) +{ + struct ast2700_mbox *mb = dev_get_drvdata(chan->mbox->dev); + int idx = ch_num(chan); + void __iomem *reg = mb->rx_regs + IPCR_ENABLE; + unsigned long flags; + + spin_lock_irqsave(&mb->lock, flags); + writel(readl(reg) | BIT(idx), reg); + spin_unlock_irqrestore(&mb->lock, flags); + + return 0; +} + +static void ast2700_mbox_shutdown(struct mbox_chan *chan) +{ + struct ast2700_mbox *mb = dev_get_drvdata(chan->mbox->dev); + int idx = ch_num(chan); + void __iomem *reg = mb->rx_regs + IPCR_ENABLE; + unsigned long flags; + + spin_lock_irqsave(&mb->lock, flags); + writel(readl(reg) & ~BIT(idx), reg); + spin_unlock_irqrestore(&mb->lock, flags); +} + +static bool ast2700_mbox_last_tx_done(struct mbox_chan *chan) +{ + struct ast2700_mbox *mb = dev_get_drvdata(chan->mbox->dev); + int idx = ch_num(chan); + + return ast2700_mbox_tx_done(mb, idx); +} + +static const struct mbox_chan_ops ast2700_mbox_chan_ops = { + .send_data = ast2700_mbox_send_data, + .startup = ast2700_mbox_startup, + .shutdown = ast2700_mbox_shutdown, + .last_tx_done = ast2700_mbox_last_tx_done, +}; + +static int ast2700_mbox_probe(struct platform_device *pdev) +{ + struct ast2700_mbox *mb; + const struct ast2700_mbox_data *dev_data; + struct device *dev = &pdev->dev; + int irq, ret; + + if (!pdev->dev.of_node) + return -ENODEV; + + dev_data = device_get_match_data(&pdev->dev); + + mb = devm_kzalloc(dev, sizeof(*mb), GFP_KERNEL); + if (!mb) + return -ENOMEM; + + mb->mbox.chans = devm_kcalloc(&pdev->dev, dev_data->num_chans, + sizeof(*mb->mbox.chans), GFP_KERNEL); + if (!mb->mbox.chans) + return -ENOMEM; + + /* con_priv of each channel is used to store the message received */ + for (int i = 0; i < dev_data->num_chans; i++) { + mb->mbox.chans[i].con_priv = devm_kcalloc(dev, dev_data->msg_size, + sizeof(u8), GFP_KERNEL); + if (!mb->mbox.chans[i].con_priv) + return -ENOMEM; + } + + platform_set_drvdata(pdev, mb); + + mb->tx_regs = devm_platform_ioremap_resource_byname(pdev, "tx"); + if (IS_ERR(mb->tx_regs)) + return PTR_ERR(mb->tx_regs); + + mb->rx_regs = devm_platform_ioremap_resource_byname(pdev, "rx"); + if (IS_ERR(mb->rx_regs)) + return PTR_ERR(mb->rx_regs); + + mb->msg_size = dev_data->msg_size; + mb->mbox.dev = dev; + mb->mbox.num_chans = dev_data->num_chans; + mb->mbox.ops = &ast2700_mbox_chan_ops; + mb->mbox.txdone_irq = false; + mb->mbox.txdone_poll = true; + mb->mbox.txpoll_period = 5; + spin_lock_init(&mb->lock); + + irq = platform_get_irq(pdev, 0); + if (irq < 0) + return irq; + + ret = devm_request_irq(dev, irq, ast2700_mbox_irq, 0, dev_name(dev), mb); + if (ret) + return ret; + + return devm_mbox_controller_register(dev, &mb->mbox); +} + +static const struct ast2700_mbox_data ast2700_dev_data = { + .num_chans = 4, + .msg_size = 0x20, +}; + +static const struct of_device_id ast2700_mbox_of_match[] = { + { .compatible = "aspeed,ast2700-mailbox", .data = &ast2700_dev_data }, + {} +}; +MODULE_DEVICE_TABLE(of, ast2700_mbox_of_match); + +static struct platform_driver ast2700_mbox_driver = { + .driver = { + .name = "ast2700-mailbox", + .of_match_table = ast2700_mbox_of_match, + }, + .probe = ast2700_mbox_probe, +}; +module_platform_driver(ast2700_mbox_driver); + +MODULE_AUTHOR("Jammy Huang "); +MODULE_DESCRIPTION("ASPEED AST2700 IPC driver"); +MODULE_LICENSE("GPL"); -- 2.25.1 From andrew at codeconstruct.com.au Wed Jul 2 11:23:54 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Wed, 02 Jul 2025 10:53:54 +0930 Subject: [PATCH] MAINTAINERS: Switch ASPEED tree to shared BMC repository Message-ID: <20250702-bmc-tree-update-v1-1-c270cd8af0ab@codeconstruct.com.au> We now have a shared repo with write access provided to M:s for the ASPEED SoCs. Cc: Joel Stanley Signed-off-by: Andrew Jeffery --- Hello SoC maintainers, Joel and I are chipping away at the workflow for shared maintenance of ASPEED and Nuvoton BMC SoCs. The latest is this shared tree from which we'll do future pull-requests. Andrew --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index a92290fffa163f9fe8fe3f04bf66426f9a894409..a4b8e52ace9fff3c7f43b67b288c5a2c8ec3efa4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2408,7 +2408,7 @@ L: linux-arm-kernel at lists.infradead.org (moderated for non-subscribers) L: linux-aspeed at lists.ozlabs.org (moderated for non-subscribers) S: Supported Q: https://patchwork.ozlabs.org/project/linux-aspeed/list/ -T: git git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc.git +T: git git://git.kernel.org/pub/scm/linux/kernel/git/bmc/linux.git F: Documentation/devicetree/bindings/arm/aspeed/ F: arch/arm/boot/dts/aspeed/ F: arch/arm/mach-aspeed/ --- base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494 change-id: 20250702-bmc-tree-update-72b2cde4806f Best regards, -- Andrew Jeffery From andrew at codeconstruct.com.au Wed Jul 2 11:31:54 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Wed, 02 Jul 2025 11:01:54 +0930 Subject: Add bmc/linux for-next to linux-next Message-ID: <2ae27beb3fa9266e8f73cfa10d8299465d872183.camel@codeconstruct.com.au> Hi Stephen, Could you add the following to linux-next? Repo: https://git.kernel.org/pub/scm/linux/kernel/git/bmc/linux.git Branch: for-next This aligns with the recent patch to MAINTAINERS for the ASPEED tree: https://lore.kernel.org/all/20250702-bmc-tree-update-v1-1-c270cd8af0ab at codeconstruct.com.au/ Cheers, Andrew From sfr at canb.auug.org.au Wed Jul 2 11:49:41 2025 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Wed, 2 Jul 2025 11:49:41 +1000 Subject: Add bmc/linux for-next to linux-next In-Reply-To: <2ae27beb3fa9266e8f73cfa10d8299465d872183.camel@codeconstruct.com.au> References: <2ae27beb3fa9266e8f73cfa10d8299465d872183.camel@codeconstruct.com.au> Message-ID: <20250702114941.5bfe1e5a@canb.auug.org.au> Hi Andrew, On Wed, 02 Jul 2025 11:01:54 +0930 Andrew Jeffery wrote: > > Could you add the following to linux-next? > > Repo: https://git.kernel.org/pub/scm/linux/kernel/git/bmc/linux.git > Branch: for-next > > This aligns with the recent patch to MAINTAINERS for the ASPEED tree: > > https://lore.kernel.org/all/20250702-bmc-tree-update-v1-1-c270cd8af0ab at codeconstruct.com.au/ So, does this replace the aspeed tree (git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc.git branch for-next)? Or sit along side it? Either way, who should be the contact(s) for this tree? -- Cheers, Stephen Rothwell -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From andrew at codeconstruct.com.au Wed Jul 2 11:58:06 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Wed, 02 Jul 2025 11:28:06 +0930 Subject: Add bmc/linux for-next to linux-next In-Reply-To: <20250702114941.5bfe1e5a@canb.auug.org.au> References: <2ae27beb3fa9266e8f73cfa10d8299465d872183.camel@codeconstruct.com.au> <20250702114941.5bfe1e5a@canb.auug.org.au> Message-ID: <8b035557ad025d31ab347349ebf9b91ff668498a.camel@codeconstruct.com.au> Hi Stephen, On Wed, 2025-07-02 at 11:49 +1000, Stephen Rothwell wrote: > Hi Andrew, > > On Wed, 02 Jul 2025 11:01:54 +0930 Andrew Jeffery wrote: > > > > Could you add the following to linux-next? > > > > ?? Repo: https://git.kernel.org/pub/scm/linux/kernel/git/bmc/linux.git > > ?? Branch: for-next > > > > This aligns with the recent patch to MAINTAINERS for the ASPEED tree: > > > > https://lore.kernel.org/all/20250702-bmc-tree-update-v1-1-c270cd8af0ab at codeconstruct.com.au/ > > So, does this replace the aspeed tree > (git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc.git branch > for-next)?? Or sit along side it? It can replace joel/bmc.git, however, it should be fine to sit along- side until Joel confirms removal of his tree with you. I've been doing the BMC SoC patch wrangling recently, and he hasn't been updating his tree with the branches I put together until I poke him about it. In this case I'll just hassling him to update his tree, which should remove any opportunity for conflicts or the like. > > Either way, who should be the contact(s) for this tree? > Both myself and Joel. Cheers, Andrew From sfr at canb.auug.org.au Wed Jul 2 12:06:00 2025 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Wed, 2 Jul 2025 12:06:00 +1000 Subject: Add bmc/linux for-next to linux-next In-Reply-To: <8b035557ad025d31ab347349ebf9b91ff668498a.camel@codeconstruct.com.au> References: <2ae27beb3fa9266e8f73cfa10d8299465d872183.camel@codeconstruct.com.au> <20250702114941.5bfe1e5a@canb.auug.org.au> <8b035557ad025d31ab347349ebf9b91ff668498a.camel@codeconstruct.com.au> Message-ID: <20250702120600.33f3d49d@canb.auug.org.au> Hi Andrew, On Wed, 02 Jul 2025 11:28:06 +0930 Andrew Jeffery wrote: > > On Wed, 2025-07-02 at 11:49 +1000, Stephen Rothwell wrote: > > > > On Wed, 02 Jul 2025 11:01:54 +0930 Andrew Jeffery wrote: > > > > > > Could you add the following to linux-next? > > > > > > ?? Repo: https://git.kernel.org/pub/scm/linux/kernel/git/bmc/linux.git > > > ?? Branch: for-next > > > > > > This aligns with the recent patch to MAINTAINERS for the ASPEED tree: > > > > > > https://lore.kernel.org/all/20250702-bmc-tree-update-v1-1-c270cd8af0ab at codeconstruct.com.au/ > > > > So, does this replace the aspeed tree > > (git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc.git branch > > for-next)?? Or sit along side it? > > It can replace joel/bmc.git, however, it should be fine to sit along- > side until Joel confirms removal of his tree with you. I've been doing > the BMC SoC patch wrangling recently, and he hasn't been updating his > tree with the branches I put together until I poke him about it. In > this case I'll just hassling him to update his tree, which should > remove any opportunity for conflicts or the like. > > > Either way, who should be the contact(s) for this tree? > > Both myself and Joel. Added from today. Thanks for adding your subsystem tree as a participant of linux-next. As you may know, this is not a judgement of your code. The purpose of linux-next is for integration testing and to lower the impact of conflicts between subsystems in the next merge window. You will need to ensure that the patches/commits in your tree/series have been: * submitted under GPL v2 (or later) and include the Contributor's Signed-off-by, * posted to the relevant mailing list, * reviewed by you (or another maintainer of your subsystem tree), * successfully unit tested, and * destined for the current or next Linux merge window. Basically, this should be just what you would send to Linus (or ask him to fetch). It is allowed to be rebased if you deem it necessary. -- Cheers, Stephen Rothwell sfr at canb.auug.org.au -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From rentao.bupt at gmail.com Wed Jul 2 15:04:11 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Tue, 1 Jul 2025 22:04:11 -0700 Subject: [PATCH 0/5] ARM: dts: aspeed: Add Meta Darwin dts Message-ID: <20250702050421.13729-1-rentao.bupt@gmail.com> From: Tao Ren The patch series introduces the initial device tree for Meta/Facebook Darwin AST2600 BMC. Patch #1 extends data0 partition in facebook-bmc-flash-layout-128.dtsi. Patch #2, #3 and #4 move eMMC out of ast2600-facebook-netbmc-common.dtsi because eMMC is removed from future Meta Network BMC platforms. Patch #5 adds the initial dts for Meta Darwin BMC. Tao Ren (5): ARM: dts: aspeed: Expand data0 partition in facebook-bmc-flash-layout-128.dtsi ARM: dts: aspeed: Remove eMMC from ast2600-facebook-netbmc-common.dtsi ARM: dts: aspeed: elbert: Enable eMMC device ARM: dts: aspeed: fuji: Enable eMMC device ARM: dts: aspeed: Add Facebook Darwin (AST2600) BMC arch/arm/boot/dts/aspeed/Makefile | 1 + .../dts/aspeed/aspeed-bmc-facebook-darwin.dts | 92 +++++++++++++++++++ .../dts/aspeed/aspeed-bmc-facebook-elbert.dts | 12 +++ .../dts/aspeed/aspeed-bmc-facebook-fuji.dts | 12 +++ .../ast2600-facebook-netbmc-common.dtsi | 12 --- .../aspeed/facebook-bmc-flash-layout-128.dtsi | 10 +- 6 files changed, 122 insertions(+), 17 deletions(-) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts -- 2.47.1 From rentao.bupt at gmail.com Wed Jul 2 15:04:12 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Tue, 1 Jul 2025 22:04:12 -0700 Subject: [PATCH 1/5] ARM: dts: aspeed: Expand data0 partition in facebook-bmc-flash-layout-128.dtsi In-Reply-To: <20250702050421.13729-1-rentao.bupt@gmail.com> References: <20250702050421.13729-1-rentao.bupt@gmail.com> Message-ID: <20250702050421.13729-2-rentao.bupt@gmail.com> From: Tao Ren Expand data0 partition to 64MB in facebook-bmc-flash-layout-128.dtsi for larger persistent storage. Signed-off-by: Tao Ren --- .../boot/dts/aspeed/facebook-bmc-flash-layout-128.dtsi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128.dtsi b/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128.dtsi index 7f3652dea550..efd92232cda2 100644 --- a/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128.dtsi +++ b/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128.dtsi @@ -32,19 +32,19 @@ image-meta at f0000 { }; /* - * FIT image: 119 MB. + * FIT image: 63 MB. */ fit at 100000 { - reg = <0x100000 0x7700000>; + reg = <0x100000 0x3f00000>; label = "fit"; }; /* - * "data0" partition (8MB) is used by Facebook BMC platforms as + * "data0" partition (64MB) is used by Facebook BMC platforms as * persistent data store. */ - data0 at 7800000 { - reg = <0x7800000 0x800000>; + data0 at 4000000 { + reg = <0x4000000 0x4000000>; label = "data0"; }; -- 2.47.1 From rentao.bupt at gmail.com Wed Jul 2 15:04:13 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Tue, 1 Jul 2025 22:04:13 -0700 Subject: [PATCH 2/5] ARM: dts: aspeed: Remove eMMC from ast2600-facebook-netbmc-common.dtsi In-Reply-To: <20250702050421.13729-1-rentao.bupt@gmail.com> References: <20250702050421.13729-1-rentao.bupt@gmail.com> Message-ID: <20250702050421.13729-3-rentao.bupt@gmail.com> From: Tao Ren Remove eMMC device entries from ast2600-facebook-netbmc-common.dtsi because eMMC will be removed from future Meta/Facebook AST2600 network OpenBMC platforms. Signed-off-by: Tao Ren --- .../dts/aspeed/ast2600-facebook-netbmc-common.dtsi | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi b/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi index 00e5887c926f..83c9789d45b1 100644 --- a/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi +++ b/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi @@ -152,18 +152,6 @@ &vhub { status = "okay"; }; -&emmc_controller { - status = "okay"; -}; - -&emmc { - status = "okay"; - - non-removable; - max-frequency = <25000000>; - bus-width = <4>; -}; - &rtc { status = "okay"; }; -- 2.47.1 From rentao.bupt at gmail.com Wed Jul 2 15:04:14 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Tue, 1 Jul 2025 22:04:14 -0700 Subject: [PATCH 3/5] ARM: dts: aspeed: elbert: Enable eMMC device In-Reply-To: <20250702050421.13729-1-rentao.bupt@gmail.com> References: <20250702050421.13729-1-rentao.bupt@gmail.com> Message-ID: <20250702050421.13729-4-rentao.bupt@gmail.com> From: Tao Ren Enable eMMC device in Elbert dts because the eMMC entries were removed from ast2600-facebook-netbmc-common.dtsi. Signed-off-by: Tao Ren --- .../boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts index 74f3c67e0eff..ff1009ea1c49 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts @@ -201,3 +201,15 @@ fixed-link { full-duplex; }; }; + +&emmc_controller { + status = "okay"; +}; + +&emmc { + status = "okay"; + + non-removable; + max-frequency = <25000000>; + bus-width = <4>; +}; -- 2.47.1 From rentao.bupt at gmail.com Wed Jul 2 15:04:15 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Tue, 1 Jul 2025 22:04:15 -0700 Subject: [PATCH 4/5] ARM: dts: aspeed: fuji: Enable eMMC device In-Reply-To: <20250702050421.13729-1-rentao.bupt@gmail.com> References: <20250702050421.13729-1-rentao.bupt@gmail.com> Message-ID: <20250702050421.13729-5-rentao.bupt@gmail.com> From: Tao Ren Enable eMMC device in Fuji dts because the eMMC entries were removed from ast2600-facebook-netbmc-common.dtsi. Signed-off-by: Tao Ren --- .../arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts index f23c26a3441d..8602ede3ec7e 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts @@ -1249,3 +1249,15 @@ &mac3 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_rgmii4_default>; }; + +&emmc_controller { + status = "okay"; +}; + +&emmc { + status = "okay"; + + non-removable; + max-frequency = <25000000>; + bus-width = <4>; +}; -- 2.47.1 From rentao.bupt at gmail.com Wed Jul 2 15:04:16 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Tue, 1 Jul 2025 22:04:16 -0700 Subject: [PATCH 5/5] ARM: dts: aspeed: Add Facebook Darwin (AST2600) BMC In-Reply-To: <20250702050421.13729-1-rentao.bupt@gmail.com> References: <20250702050421.13729-1-rentao.bupt@gmail.com> Message-ID: <20250702050421.13729-6-rentao.bupt@gmail.com> From: Tao Ren Add initial device tree for the Meta (Facebook) Darwin AST2600 BMC. Darwin is Meta's rack switch platform with an AST2600 BMC integrated for health monitoring purpose. Signed-off-by: Tao Ren --- arch/arm/boot/dts/aspeed/Makefile | 1 + .../dts/aspeed/aspeed-bmc-facebook-darwin.dts | 92 +++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile index 2e5f4833a073..debbfc0151f8 100644 --- a/arch/arm/boot/dts/aspeed/Makefile +++ b/arch/arm/boot/dts/aspeed/Makefile @@ -20,6 +20,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ aspeed-bmc-facebook-bletchley.dtb \ aspeed-bmc-facebook-catalina.dtb \ aspeed-bmc-facebook-cmm.dtb \ + aspeed-bmc-facebook-darwin.dtb \ aspeed-bmc-facebook-elbert.dtb \ aspeed-bmc-facebook-fuji.dtb \ aspeed-bmc-facebook-galaxy100.dtb \ diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts new file mode 100644 index 000000000000..f902230dada3 --- /dev/null +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts @@ -0,0 +1,92 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Copyright (c) 2021 Facebook Inc. + +/dts-v1/; + +#include "ast2600-facebook-netbmc-common.dtsi" + +/ { + model = "Facebook Darwin BMC"; + compatible = "facebook,darwin-bmc", "aspeed,ast2600"; + + aliases { + serial0 = &uart5; + serial1 = &uart1; + serial2 = &uart2; + serial3 = &uart3; + }; + + chosen { + stdout-path = &uart5; + }; + + iio-hwmon { + compatible = "iio-hwmon"; + io-channels = <&adc0 0>, <&adc0 1>, <&adc0 2>, <&adc0 3>, + <&adc0 4>, <&adc0 5>, <&adc0 6>, <&adc0 7>, + <&adc1 0>, <&adc1 1>, <&adc1 2>, <&adc1 3>, + <&adc1 4>, <&adc1 5>, <&adc1 6>, <&adc1 7>; + }; + + spi_gpio: spi { + num-chipselects = <1>; + cs-gpios = <&gpio0 ASPEED_GPIO(X, 0) GPIO_ACTIVE_LOW>; + }; +}; + +/* + * BMC's "mac3" controller is connected to BCM53134P's IMP_RGMII port + * directly (fixed link, no PHY in between). + * Note: BMC's "mdio0" controller is connected to BCM53134P's MDIO + * interface, and the MDIO channel will be enabled in dts later (when + * "bcm53xx" driver's probe failure is solved on the platform). + */ +&mac3 { + status = "okay"; + phy-mode = "rgmii"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_rgmii4_default>; + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&i2c0 { + eeprom at 50 { + compatible = "atmel,24c512"; + reg = <0x50>; + }; +}; + +&adc0 { + ref_voltage = <2500>; + status = "okay"; + + pinctrl-0 = <&pinctrl_adc0_default &pinctrl_adc1_default + &pinctrl_adc2_default &pinctrl_adc3_default + &pinctrl_adc4_default &pinctrl_adc5_default + &pinctrl_adc6_default &pinctrl_adc7_default>; +}; + +&adc1 { + ref_voltage = <2500>; + status = "okay"; + + pinctrl-0 = <&pinctrl_adc8_default &pinctrl_adc9_default + &pinctrl_adc10_default &pinctrl_adc11_default + &pinctrl_adc12_default &pinctrl_adc13_default + &pinctrl_adc14_default &pinctrl_adc15_default>; +}; + +&emmc_controller { + status = "okay"; +}; + +&emmc { + status = "okay"; + + non-removable; + max-frequency = <25000000>; + bus-width = <4>; +}; -- 2.47.1 From andrew at lunn.ch Wed Jul 2 17:40:40 2025 From: andrew at lunn.ch (Andrew Lunn) Date: Wed, 2 Jul 2025 09:40:40 +0200 Subject: [PATCH 5/5] ARM: dts: aspeed: Add Facebook Darwin (AST2600) BMC In-Reply-To: <20250702050421.13729-6-rentao.bupt@gmail.com> References: <20250702050421.13729-1-rentao.bupt@gmail.com> <20250702050421.13729-6-rentao.bupt@gmail.com> Message-ID: On Tue, Jul 01, 2025 at 10:04:16PM -0700, rentao.bupt at gmail.com wrote: > From: Tao Ren > > Add initial device tree for the Meta (Facebook) Darwin AST2600 BMC. > > Darwin is Meta's rack switch platform with an AST2600 BMC integrated for > health monitoring purpose. > > Signed-off-by: Tao Ren > --- > arch/arm/boot/dts/aspeed/Makefile | 1 + > .../dts/aspeed/aspeed-bmc-facebook-darwin.dts | 92 +++++++++++++++++++ > 2 files changed, 93 insertions(+) > create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts > > diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile > index 2e5f4833a073..debbfc0151f8 100644 > --- a/arch/arm/boot/dts/aspeed/Makefile > +++ b/arch/arm/boot/dts/aspeed/Makefile > @@ -20,6 +20,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ > aspeed-bmc-facebook-bletchley.dtb \ > aspeed-bmc-facebook-catalina.dtb \ > aspeed-bmc-facebook-cmm.dtb \ > + aspeed-bmc-facebook-darwin.dtb \ > aspeed-bmc-facebook-elbert.dtb \ > aspeed-bmc-facebook-fuji.dtb \ > aspeed-bmc-facebook-galaxy100.dtb \ > diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts > new file mode 100644 > index 000000000000..f902230dada3 > --- /dev/null > +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts > @@ -0,0 +1,92 @@ > +// SPDX-License-Identifier: GPL-2.0+ > +// Copyright (c) 2021 Facebook Inc. > + > +/dts-v1/; > + > +#include "ast2600-facebook-netbmc-common.dtsi" > + > +/ { > + model = "Facebook Darwin BMC"; > + compatible = "facebook,darwin-bmc", "aspeed,ast2600"; > + > + aliases { > + serial0 = &uart5; > + serial1 = &uart1; > + serial2 = &uart2; > + serial3 = &uart3; > + }; > + > + chosen { > + stdout-path = &uart5; > + }; > + > + iio-hwmon { > + compatible = "iio-hwmon"; > + io-channels = <&adc0 0>, <&adc0 1>, <&adc0 2>, <&adc0 3>, > + <&adc0 4>, <&adc0 5>, <&adc0 6>, <&adc0 7>, > + <&adc1 0>, <&adc1 1>, <&adc1 2>, <&adc1 3>, > + <&adc1 4>, <&adc1 5>, <&adc1 6>, <&adc1 7>; > + }; > + > + spi_gpio: spi { > + num-chipselects = <1>; > + cs-gpios = <&gpio0 ASPEED_GPIO(X, 0) GPIO_ACTIVE_LOW>; > + }; > +}; > + > +/* > + * BMC's "mac3" controller is connected to BCM53134P's IMP_RGMII port > + * directly (fixed link, no PHY in between). > + * Note: BMC's "mdio0" controller is connected to BCM53134P's MDIO > + * interface, and the MDIO channel will be enabled in dts later (when > + * "bcm53xx" driver's probe failure is solved on the platform). > + */ > +&mac3 { > + status = "okay"; > + phy-mode = "rgmii"; How do RGMII delays work? Connections to switches have to be handled different to PHYs, to avoid double delays. But is there extra long clock lines? Or are you expecting the switch to add the delays? Andrew From krzk at kernel.org Wed Jul 2 17:50:56 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Wed, 2 Jul 2025 09:50:56 +0200 Subject: [PATCH 5/5] ARM: dts: aspeed: Add Facebook Darwin (AST2600) BMC In-Reply-To: <20250702050421.13729-6-rentao.bupt@gmail.com> References: <20250702050421.13729-1-rentao.bupt@gmail.com> <20250702050421.13729-6-rentao.bupt@gmail.com> Message-ID: <34b0f5e2-0341-41cb-8915-8f1606e14827@kernel.org> On 02/07/2025 07:04, rentao.bupt at gmail.com wrote: > diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts > new file mode 100644 > index 000000000000..f902230dada3 > --- /dev/null > +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts > @@ -0,0 +1,92 @@ > +// SPDX-License-Identifier: GPL-2.0+ > +// Copyright (c) 2021 Facebook Inc. > + > +/dts-v1/; > + > +#include "ast2600-facebook-netbmc-common.dtsi" > + > +/ { > + model = "Facebook Darwin BMC"; > + compatible = "facebook,darwin-bmc", "aspeed,ast2600"; Please run scripts/checkpatch.pl on the patches and fix reported warnings. After that, run also 'scripts/checkpatch.pl --strict' on the patches and (probably) fix more warnings. Some warnings can be ignored, especially from --strict run, but the code here looks like it needs a fix. Feel free to get in touch if the warning is not clear. It does not look like you tested the DTS against bindings. Please run `make dtbs_check W=1` (see Documentation/devicetree/bindings/writing-schema.rst or https://www.linaro.org/blog/tips-and-tricks-for-validating-devicetree-sources-with-the-devicetree-schema/ for instructions). Maybe you need to update your dtschema and yamllint. Don't rely on distro packages for dtschema and be sure you are using the latest released dtschema. Best regards, Krzysztof From robh at kernel.org Thu Jul 3 01:04:06 2025 From: robh at kernel.org (Rob Herring (Arm)) Date: Wed, 02 Jul 2025 10:04:06 -0500 Subject: [PATCH 0/5] ARM: dts: aspeed: Add Meta Darwin dts In-Reply-To: <20250702050421.13729-1-rentao.bupt@gmail.com> References: <20250702050421.13729-1-rentao.bupt@gmail.com> Message-ID: <175146850009.1675461.3391275598675831917.robh@kernel.org> On Tue, 01 Jul 2025 22:04:11 -0700, rentao.bupt at gmail.com wrote: > From: Tao Ren > > The patch series introduces the initial device tree for Meta/Facebook > Darwin AST2600 BMC. > > Patch #1 extends data0 partition in facebook-bmc-flash-layout-128.dtsi. > > Patch #2, #3 and #4 move eMMC out of ast2600-facebook-netbmc-common.dtsi > because eMMC is removed from future Meta Network BMC platforms. > > Patch #5 adds the initial dts for Meta Darwin BMC. > > Tao Ren (5): > ARM: dts: aspeed: Expand data0 partition in > facebook-bmc-flash-layout-128.dtsi > ARM: dts: aspeed: Remove eMMC from ast2600-facebook-netbmc-common.dtsi > ARM: dts: aspeed: elbert: Enable eMMC device > ARM: dts: aspeed: fuji: Enable eMMC device > ARM: dts: aspeed: Add Facebook Darwin (AST2600) BMC > > arch/arm/boot/dts/aspeed/Makefile | 1 + > .../dts/aspeed/aspeed-bmc-facebook-darwin.dts | 92 +++++++++++++++++++ > .../dts/aspeed/aspeed-bmc-facebook-elbert.dts | 12 +++ > .../dts/aspeed/aspeed-bmc-facebook-fuji.dts | 12 +++ > .../ast2600-facebook-netbmc-common.dtsi | 12 --- > .../aspeed/facebook-bmc-flash-layout-128.dtsi | 10 +- > 6 files changed, 122 insertions(+), 17 deletions(-) > create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts > > -- > 2.47.1 > > > My bot found new DTB warnings on the .dts files added or changed in this series. Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments. If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date: pip3 install dtschema --upgrade This patch series was applied (using b4) to base: Base: attempting to guess base-commit... Base: remotes/gl-ci/linus-45-gdf3f9755452c (exact match) If this is not the correct base, please add 'base-commit' tag (or use b4 which does this automatically) New warnings running 'make CHECK_DTBS=y for arch/arm/boot/dts/aspeed/' for 20250702050421.13729-1-rentao.bupt at gmail.com: arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: / (facebook,darwin-bmc): compatible: 'oneOf' conditional failed, one must be fixed: 'facebook,darwin-bmc' is not one of ['delta,ahe50dc-bmc', 'facebook,galaxy100-bmc', 'facebook,wedge100-bmc', 'facebook,wedge40-bmc', 'microsoft,olympus-bmc', 'quanta,q71l-bmc', 'tyan,palmetto-bmc', 'yadro,vesnin-bmc'] 'facebook,darwin-bmc' is not one of ['amd,daytonax-bmc', 'amd,ethanolx-bmc', 'ampere,mtjade-bmc', 'aspeed,ast2500-evb', 'asrock,e3c246d4i-bmc', 'asrock,e3c256d4i-bmc', 'asrock,romed8hm3-bmc', 'asrock,spc621d8hm3-bmc', 'asrock,x570d4u-bmc', 'bytedance,g220a-bmc', 'facebook,cmm-bmc', 'facebook,minipack-bmc', 'facebook,tiogapass-bmc', 'facebook,yamp-bmc', 'facebook,yosemitev2-bmc', 'facebook,wedge400-bmc', 'hxt,stardragon4800-rep2-bmc', 'ibm,mihawk-bmc', 'ibm,mowgli-bmc', 'ibm,romulus-bmc', 'ibm,swift-bmc', 'ibm,witherspoon-bmc', 'ingrasys,zaius-bmc', 'inspur,fp5280g2-bmc', 'inspur,nf5280m6-bmc', 'inspur,on5263m5-bmc', 'intel,s2600wf-bmc', 'inventec,lanyang-bmc', 'lenovo,hr630-bmc', 'lenovo,hr855xg2-bmc', 'portwell,neptune-bmc', 'qcom,centriq2400-rep-bmc', 'supermicro,x11spi-bmc', 'tyan,s7106-bmc', 'tyan,s8036-bmc', 'yadro,nicole-bmc', 'yadro,vegman-n110-bmc', 'yadro,vegman-rx20-bmc', 'yadro,vegman-sx20-bmc'] 'facebook,darwin-bmc' is not one of ['ampere,mtjefferson-bmc', 'ampere,mtmitchell-bmc', 'aspeed,ast2600-evb', 'aspeed,ast2600-evb-a1', 'asus,x4tf-bmc', 'facebook,bletchley-bmc', 'facebook,catalina-bmc', 'facebook,cloudripper-bmc', 'facebook,elbert-bmc', 'facebook,fuji-bmc', 'facebook,greatlakes-bmc', 'facebook,harma-bmc', 'facebook,minerva-cmc', 'facebook,yosemite4-bmc', 'ibm,blueridge-bmc', 'ibm,everest-bmc', 'ibm,fuji-bmc', 'ibm,rainier-bmc', 'ibm,sbp1-bmc', 'ibm,system1-bmc', 'ibm,tacoma-bmc', 'inventec,starscream-bmc', 'inventec,transformer-bmc', 'jabil,rbp-bmc', 'qcom,dc-scm-v1-bmc', 'quanta,s6q-bmc', 'ufispace,ncplite-bmc'] 'aspeed,ast2400' was expected 'aspeed,ast2500' was expected from schema $id: http://devicetree.org/schemas/arm/aspeed/aspeed.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /: failed to match any schema with compatible: ['facebook,darwin-bmc', 'aspeed,ast2600'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: timer (arm,armv7-timer): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/timer/arm,arch_timer.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /sdram at 1e6e0000: failed to match any schema with compatible: ['aspeed,ast2600-sdram-edac', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: bus at 1e600000 (aspeed,ast2600-ahbc): compatible: ['aspeed,ast2600-ahbc', 'syscon'] is too long from schema $id: http://devicetree.org/schemas/bus/aspeed,ast2600-ahbc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: syscon at 1e6e2000 (aspeed,ast2600-scu): 'smp-memram at 180' does not match any of the regexes: '^interrupt-controller@[0-9a-f]+$', '^p2a-control@[0-9a-f]+$', '^pinctrl(@[0-9a-f]+)?$', '^pinctrl-[0-9]+$', '^silicon-id@[0-9a-f]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed,ast2x00-scu.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb/syscon at 1e6e2000/smp-memram at 180: failed to match any schema with compatible: ['aspeed,ast2600-smpmem'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb/display at 1e6e6000: failed to match any schema with compatible: ['aspeed,ast2600-gfx', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: adc at 1e6e9000 (aspeed,ast2600-adc0): 'interrupts', 'ref_voltage' do not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: adc at 1e6e9100 (aspeed,ast2600-adc1): 'interrupts', 'ref_voltage' do not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: crypto at 1e6fa000 (aspeed,ast2600-acry): 'aspeed,ahbc' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/crypto/aspeed,ast2600-acry.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb/timer at 1e782000: failed to match any schema with compatible: ['aspeed,ast2600-timer'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): reg-io-width: 4 is not of type 'object' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): lpc-snoop at 80: 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: kcs at 24 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: kcs at 28 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: kcs at 2c (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: kcs at 114 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb/lpc at 1e789000/lhc at a0: failed to match any schema with compatible: ['aspeed,ast2600-lhc'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb/lpc at 1e789000/ibt at 140: failed to match any schema with compatible: ['aspeed,ast2600-ibt-bmc'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740100:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740200:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740100: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740200: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: fsi at 1e79b000 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb/fsi at 1e79b000: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: fsi at 1e79b100 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb/fsi at 1e79b100: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb/dma-controller at 1e79e000: failed to match any schema with compatible: ['aspeed,ast2600-udma'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: spi (spi-gpio): gpio-miso: False schema does not allow [64, 189, 0] from schema $id: http://devicetree.org/schemas/spi/spi-gpio.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: spi (spi-gpio): gpio-mosi: False schema does not allow [64, 188, 0] from schema $id: http://devicetree.org/schemas/spi/spi-gpio.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: spi (spi-gpio): gpio-sck: False schema does not allow [64, 187, 0] from schema $id: http://devicetree.org/schemas/spi/spi-gpio.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: spi (spi-gpio): 'sck-gpios' is a required property from schema $id: http://devicetree.org/schemas/spi/spi-gpio.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: spi (spi-gpio): Unevaluated properties are not allowed ('gpio-miso', 'gpio-mosi', 'gpio-sck' were unexpected) from schema $id: http://devicetree.org/schemas/spi/spi-gpio.yaml# From rentao.bupt at gmail.com Thu Jul 3 09:09:42 2025 From: rentao.bupt at gmail.com (Tao Ren) Date: Wed, 2 Jul 2025 16:09:42 -0700 Subject: [PATCH 5/5] ARM: dts: aspeed: Add Facebook Darwin (AST2600) BMC In-Reply-To: References: <20250702050421.13729-1-rentao.bupt@gmail.com> <20250702050421.13729-6-rentao.bupt@gmail.com> Message-ID: On Wed, Jul 02, 2025 at 09:40:40AM +0200, Andrew Lunn wrote: > On Tue, Jul 01, 2025 at 10:04:16PM -0700, rentao.bupt at gmail.com wrote: > > From: Tao Ren > > > > Add initial device tree for the Meta (Facebook) Darwin AST2600 BMC. > > > > Darwin is Meta's rack switch platform with an AST2600 BMC integrated for > > health monitoring purpose. > > > > Signed-off-by: Tao Ren > > --- > > arch/arm/boot/dts/aspeed/Makefile | 1 + > > .../dts/aspeed/aspeed-bmc-facebook-darwin.dts | 92 +++++++++++++++++++ > > 2 files changed, 93 insertions(+) > > create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts > > > > diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile > > index 2e5f4833a073..debbfc0151f8 100644 > > --- a/arch/arm/boot/dts/aspeed/Makefile > > +++ b/arch/arm/boot/dts/aspeed/Makefile > > @@ -20,6 +20,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ > > aspeed-bmc-facebook-bletchley.dtb \ > > aspeed-bmc-facebook-catalina.dtb \ > > aspeed-bmc-facebook-cmm.dtb \ > > + aspeed-bmc-facebook-darwin.dtb \ > > aspeed-bmc-facebook-elbert.dtb \ > > aspeed-bmc-facebook-fuji.dtb \ > > aspeed-bmc-facebook-galaxy100.dtb \ > > diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts > > new file mode 100644 > > index 000000000000..f902230dada3 > > --- /dev/null > > +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts > > @@ -0,0 +1,92 @@ > > +// SPDX-License-Identifier: GPL-2.0+ > > +// Copyright (c) 2021 Facebook Inc. > > + > > +/dts-v1/; > > + > > +#include "ast2600-facebook-netbmc-common.dtsi" > > + > > +/ { > > + model = "Facebook Darwin BMC"; > > + compatible = "facebook,darwin-bmc", "aspeed,ast2600"; > > + > > + aliases { > > + serial0 = &uart5; > > + serial1 = &uart1; > > + serial2 = &uart2; > > + serial3 = &uart3; > > + }; > > + > > + chosen { > > + stdout-path = &uart5; > > + }; > > + > > + iio-hwmon { > > + compatible = "iio-hwmon"; > > + io-channels = <&adc0 0>, <&adc0 1>, <&adc0 2>, <&adc0 3>, > > + <&adc0 4>, <&adc0 5>, <&adc0 6>, <&adc0 7>, > > + <&adc1 0>, <&adc1 1>, <&adc1 2>, <&adc1 3>, > > + <&adc1 4>, <&adc1 5>, <&adc1 6>, <&adc1 7>; > > + }; > > + > > + spi_gpio: spi { > > + num-chipselects = <1>; > > + cs-gpios = <&gpio0 ASPEED_GPIO(X, 0) GPIO_ACTIVE_LOW>; > > + }; > > +}; > > + > > +/* > > + * BMC's "mac3" controller is connected to BCM53134P's IMP_RGMII port > > + * directly (fixed link, no PHY in between). > > + * Note: BMC's "mdio0" controller is connected to BCM53134P's MDIO > > + * interface, and the MDIO channel will be enabled in dts later (when > > + * "bcm53xx" driver's probe failure is solved on the platform). > > + */ > > +&mac3 { > > + status = "okay"; > > + phy-mode = "rgmii"; > > How do RGMII delays work? Connections to switches have to be handled > different to PHYs, to avoid double delays. But is there extra long > clock lines? Or are you expecting the switch to add the delays? > > Andrew Hi Andrew, The delays are introduced in BMC MAC by setting SCU control registers in u-boot. The delays on the switch side are disabled. I will add some comments for the delays in v2 (after addressing the dts schema warnings). Is that okay? Thanks, Tao From rentao.bupt at gmail.com Thu Jul 3 09:13:19 2025 From: rentao.bupt at gmail.com (Tao Ren) Date: Wed, 2 Jul 2025 16:13:19 -0700 Subject: [PATCH 5/5] ARM: dts: aspeed: Add Facebook Darwin (AST2600) BMC In-Reply-To: <34b0f5e2-0341-41cb-8915-8f1606e14827@kernel.org> References: <20250702050421.13729-1-rentao.bupt@gmail.com> <20250702050421.13729-6-rentao.bupt@gmail.com> <34b0f5e2-0341-41cb-8915-8f1606e14827@kernel.org> Message-ID: On Wed, Jul 02, 2025 at 09:50:56AM +0200, Krzysztof Kozlowski wrote: > On 02/07/2025 07:04, rentao.bupt at gmail.com wrote: > > diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts > > new file mode 100644 > > index 000000000000..f902230dada3 > > --- /dev/null > > +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts > > @@ -0,0 +1,92 @@ > > +// SPDX-License-Identifier: GPL-2.0+ > > +// Copyright (c) 2021 Facebook Inc. > > + > > +/dts-v1/; > > + > > +#include "ast2600-facebook-netbmc-common.dtsi" > > + > > +/ { > > + model = "Facebook Darwin BMC"; > > + compatible = "facebook,darwin-bmc", "aspeed,ast2600"; > > Please run scripts/checkpatch.pl on the patches and fix reported > warnings. After that, run also 'scripts/checkpatch.pl --strict' on the > patches and (probably) fix more warnings. Some warnings can be ignored, > especially from --strict run, but the code here looks like it needs a > fix. Feel free to get in touch if the warning is not clear. > > It does not look like you tested the DTS against bindings. Please run > `make dtbs_check W=1` (see > Documentation/devicetree/bindings/writing-schema.rst or > https://www.linaro.org/blog/tips-and-tricks-for-validating-devicetree-sources-with-the-devicetree-schema/ > for instructions). > Maybe you need to update your dtschema and yamllint. Don't rely on > distro packages for dtschema and be sure you are using the latest > released dtschema. > > > > Best regards, > Krzysztof Hi Krzysztof, Thank you for the detailed instructions, and I can see the warnings from my side now. I'm working on the fix, and will try to send out v2 by this week. Thanks, Tao From andrew at lunn.ch Thu Jul 3 17:58:48 2025 From: andrew at lunn.ch (Andrew Lunn) Date: Thu, 3 Jul 2025 09:58:48 +0200 Subject: [PATCH 5/5] ARM: dts: aspeed: Add Facebook Darwin (AST2600) BMC In-Reply-To: References: <20250702050421.13729-1-rentao.bupt@gmail.com> <20250702050421.13729-6-rentao.bupt@gmail.com> Message-ID: <220ac6c2-8373-4742-86fa-f322d6ada624@lunn.ch> > > How do RGMII delays work? Connections to switches have to be handled > > different to PHYs, to avoid double delays. But is there extra long > > clock lines? Or are you expecting the switch to add the delays? > > > > Andrew > > Hi Andrew, > > The delays are introduced in BMC MAC by setting SCU control registers in > u-boot. The delays on the switch side are disabled. Sorry, but not acceptable. This is something i've been NACKing Aspeed DT patches for. You need the MAC driver to interpret the phy-mode and program the SCU control register as needed. Since you have the MAC introducing the delays, you want phy-mode 'rgmii-id'. If you want to submit some DT now, drop the ethernet node. This is what others have been doing while waiting for Aspeed to fix their MAC driver. Having said that, i've not seen any progress from Aspeed, so it either needs their customers to apply more pressure, or somebody in the community to just fix it and submit patches. Andrew --- pw-bot: cr From krzk at kernel.org Thu Jul 3 19:47:58 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Thu, 3 Jul 2025 11:47:58 +0200 Subject: [PATCH v5 2/2] ARM: dts: aspeed: clemente: add Meta Clemente BMC In-Reply-To: References: <20250627-add-support-for-meta-clemente-bmc-v5-0-038ed6f1cb9f@fii-foxconn.com> <20250627-add-support-for-meta-clemente-bmc-v5-2-038ed6f1cb9f@fii-foxconn.com> <06178661-5665-4b9d-8652-de12c2a55f94@kernel.org> Message-ID: <1290da56-1d43-4bb5-a224-f827b411909d@kernel.org> On 03/07/2025 11:44, Leo Wang wrote: > Hi Krzysztof, > > Thanks for your feedback. > > I checked my patches using b4 prep --check, and I see the following two > checkpatch warnings: > > 1. > > WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? > 2. > > WARNING: From:/Signed-off-by: email address mismatch: 'From: Leo Wang < > leo.jt.wang at gmail.com>' != 'Signed-off-by: Leo Wang < > leo.jt.wang at fii-foxconn.com>' > > Are these the issues you were referring to? If there are any other issues > I missed, I?d appreciate your guidance. The second warning. Please don't top post. It makes it difficult to understand what you refer to. Best regards, Krzysztof From robh at kernel.org Fri Jul 4 04:35:07 2025 From: robh at kernel.org (Rob Herring (Arm)) Date: Thu, 3 Jul 2025 13:35:07 -0500 Subject: [PATCH] soc: aspeed: Use of_reserved_mem_region_to_resource() for "memory-region" Message-ID: <20250703183508.2074735-1-robh@kernel.org> Use the newly added of_reserved_mem_region_to_resource() function to handle "memory-region" properties. The error handling is a bit different. "memory-region" is optional, so failed lookup is not an error. But then an error in of_address_to_resource() is treated as an error. However, that distinction is not really important. Either the region is available and usable or it is not. So now, it is just of_reserved_mem_region_to_resource() which is checked for an error. Signed-off-by: Rob Herring (Arm) --- drivers/soc/aspeed/aspeed-lpc-ctrl.c | 14 +++----------- drivers/soc/aspeed/aspeed-p2a-ctrl.c | 14 +++----------- 2 files changed, 6 insertions(+), 22 deletions(-) diff --git a/drivers/soc/aspeed/aspeed-lpc-ctrl.c b/drivers/soc/aspeed/aspeed-lpc-ctrl.c index ee58151bd69e..b7dbb12bd095 100644 --- a/drivers/soc/aspeed/aspeed-lpc-ctrl.c +++ b/drivers/soc/aspeed/aspeed-lpc-ctrl.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -254,17 +255,8 @@ static int aspeed_lpc_ctrl_probe(struct platform_device *pdev) dev_set_drvdata(&pdev->dev, lpc_ctrl); /* If memory-region is described in device tree then store */ - node = of_parse_phandle(dev->of_node, "memory-region", 0); - if (!node) { - dev_dbg(dev, "Didn't find reserved memory\n"); - } else { - rc = of_address_to_resource(node, 0, &resm); - of_node_put(node); - if (rc) { - dev_err(dev, "Couldn't address to resource for reserved memory\n"); - return -ENXIO; - } - + rc = of_reserved_mem_region_to_resource(dev->of_node, 0, &resm); + if (!rc) { lpc_ctrl->mem_size = resource_size(&resm); lpc_ctrl->mem_base = resm.start; diff --git a/drivers/soc/aspeed/aspeed-p2a-ctrl.c b/drivers/soc/aspeed/aspeed-p2a-ctrl.c index 6cc943744e12..3be2e1b1085b 100644 --- a/drivers/soc/aspeed/aspeed-p2a-ctrl.c +++ b/drivers/soc/aspeed/aspeed-p2a-ctrl.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -334,7 +334,6 @@ static int aspeed_p2a_ctrl_probe(struct platform_device *pdev) struct aspeed_p2a_ctrl *misc_ctrl; struct device *dev; struct resource resm; - struct device_node *node; int rc = 0; dev = &pdev->dev; @@ -346,15 +345,8 @@ static int aspeed_p2a_ctrl_probe(struct platform_device *pdev) mutex_init(&misc_ctrl->tracking); /* optional. */ - node = of_parse_phandle(dev->of_node, "memory-region", 0); - if (node) { - rc = of_address_to_resource(node, 0, &resm); - of_node_put(node); - if (rc) { - dev_err(dev, "Couldn't address to resource for reserved memory\n"); - return -ENODEV; - } - + rc = of_reserved_mem_region_to_resource(dev->of_node, 0, &resm); + if (!rc) { misc_ctrl->mem_size = resource_size(&resm); misc_ctrl->mem_base = resm.start; } -- 2.47.2 From rentao.bupt at gmail.com Fri Jul 4 08:15:44 2025 From: rentao.bupt at gmail.com (Tao Ren) Date: Thu, 3 Jul 2025 15:15:44 -0700 Subject: [PATCH 5/5] ARM: dts: aspeed: Add Facebook Darwin (AST2600) BMC In-Reply-To: <220ac6c2-8373-4742-86fa-f322d6ada624@lunn.ch> References: <20250702050421.13729-1-rentao.bupt@gmail.com> <20250702050421.13729-6-rentao.bupt@gmail.com> <220ac6c2-8373-4742-86fa-f322d6ada624@lunn.ch> Message-ID: On Thu, Jul 03, 2025 at 09:58:48AM +0200, Andrew Lunn wrote: > > > How do RGMII delays work? Connections to switches have to be handled > > > different to PHYs, to avoid double delays. But is there extra long > > > clock lines? Or are you expecting the switch to add the delays? > > > > > > Andrew > > > > Hi Andrew, > > > > The delays are introduced in BMC MAC by setting SCU control registers in > > u-boot. The delays on the switch side are disabled. > > Sorry, but not acceptable. This is something i've been NACKing Aspeed > DT patches for. You need the MAC driver to interpret the phy-mode and > program the SCU control register as needed. > > Since you have the MAC introducing the delays, you want phy-mode > 'rgmii-id'. > > If you want to submit some DT now, drop the ethernet node. This is > what others have been doing while waiting for Aspeed to fix their MAC > driver. Having said that, i've not seen any progress from Aspeed, so > it either needs their customers to apply more pressure, or somebody in > the community to just fix it and submit patches. > > Andrew Hi Andrew, Got it, and thanks for sharing the context. I will reach out to ASPEED offline to see if they are actively working on the MAC fix, or if I have enough knowledge to work out the patch. Thanks, Tao From leo.jt.wang at gmail.com Thu Jul 3 19:44:28 2025 From: leo.jt.wang at gmail.com (Leo Wang) Date: Thu, 3 Jul 2025 17:44:28 +0800 Subject: [PATCH v5 2/2] ARM: dts: aspeed: clemente: add Meta Clemente BMC In-Reply-To: <06178661-5665-4b9d-8652-de12c2a55f94@kernel.org> References: <20250627-add-support-for-meta-clemente-bmc-v5-0-038ed6f1cb9f@fii-foxconn.com> <20250627-add-support-for-meta-clemente-bmc-v5-2-038ed6f1cb9f@fii-foxconn.com> <06178661-5665-4b9d-8652-de12c2a55f94@kernel.org> Message-ID: Hi Krzysztof, Thanks for your feedback. I checked my patches using b4 prep --check, and I see the following two checkpatch warnings: 1. WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? 2. WARNING: From:/Signed-off-by: email address mismatch: 'From: Leo Wang < leo.jt.wang at gmail.com>' != 'Signed-off-by: Leo Wang < leo.jt.wang at fii-foxconn.com>' Are these the issues you were referring to? If there are any other issues I missed, I?d appreciate your guidance. Best regards, Leo Wang On Fri, Jun 27, 2025 at 10:47?PM Krzysztof Kozlowski wrote: > On 27/06/2025 09:31, Leo Wang wrote: > > From: Leo Wang > > > > Add linux device tree entry for Meta Clemente compute-tray > > BMC using AST2600 SoC. > > > > Signed-off-by: Leo Wang > No, still checkpatch issues. > > Best regards, > Krzysztof > -------------- next part -------------- An HTML attachment was scrubbed... URL: From karolina.grabas at fravix.pl Thu Jul 3 18:05:03 2025 From: karolina.grabas at fravix.pl (Karolina Grabas) Date: Thu, 3 Jul 2025 08:05:03 GMT Subject: Nowy faktoring Message-ID: <20250703064500-0.1.8s.z9il.0.0som0m0hsi@fravix.pl> Dzie? dobry, czy czas oczekiwania na p?atno?ci nie blokuje u Pa?stwa bie??cych dzia?a?? Oferujemy faktoring, kt?ry pozwala od razu uwolni? ?rodki z wystawionych faktur i zachowa? p?ynno?? bez anga?owania kredytu. Je?li to temat warty rozmowy ? ch?tnie opowiem wi?cej. Pozdrawiam Karolina Grabas From andrew at codeconstruct.com.au Fri Jul 4 10:06:29 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Fri, 04 Jul 2025 09:36:29 +0930 Subject: [PATCH 1/5] ARM: dts: aspeed: Expand data0 partition in facebook-bmc-flash-layout-128.dtsi In-Reply-To: <20250702050421.13729-2-rentao.bupt@gmail.com> References: <20250702050421.13729-1-rentao.bupt@gmail.com> <20250702050421.13729-2-rentao.bupt@gmail.com> Message-ID: <78f9fcbc58261064f248e95eb7740549e338bc78.camel@codeconstruct.com.au> On Tue, 2025-07-01 at 22:04 -0700, rentao.bupt at gmail.com wrote: > From: Tao Ren > > Expand data0 partition to 64MB in facebook-bmc-flash-layout-128.dtsi for > larger persistent storage. > > Signed-off-by: Tao Ren > --- > ?.../boot/dts/aspeed/facebook-bmc-flash-layout-128.dtsi | 10 +++++----- > ?1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128.dtsi b/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128.dtsi > index 7f3652dea550..efd92232cda2 100644 > --- a/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128.dtsi > +++ b/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128.dtsi > @@ -32,19 +32,19 @@ image-meta at f0000 { > ????????}; > ? > ????????/* > -??????? * FIT image: 119 MB. > +??????? * FIT image: 63 MB. > ???????? */ > ????????fit at 100000 { > -???????????????reg = <0x100000 0x7700000>; > +???????????????reg = <0x100000 0x3f00000>; > ????????????????label = "fit"; > ????????}; > ? > ????????/* > -??????? * "data0" partition (8MB) is used by Facebook BMC platforms as > +??????? * "data0" partition (64MB) is used by Facebook BMC platforms as > ???????? * persistent data store. > ???????? */ > -???????data0 at 7800000 { > -???????????????reg = <0x7800000 0x800000>; > +???????data0 at 4000000 { > +???????????????reg = <0x4000000 0x4000000>; > ????????????????label = "data0"; > ????????}; > ? Two existing systems use this dtsi: > git grep facebook-bmc-flash-layout-128.dtsi arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts:#include "facebook-bmc-flash-layout-128.dtsi" arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi:#include "facebook-bmc-flash-layout-128.dtsi" This change requires a full reflash of those devices, which is pretty disruptive. It seems more appropriate to me to create a separate dtsi for the new flash layout to use in new systems. Andrew From andrew at codeconstruct.com.au Fri Jul 4 10:08:39 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Fri, 04 Jul 2025 09:38:39 +0930 Subject: [PATCH 2/5] ARM: dts: aspeed: Remove eMMC from ast2600-facebook-netbmc-common.dtsi In-Reply-To: <20250702050421.13729-3-rentao.bupt@gmail.com> References: <20250702050421.13729-1-rentao.bupt@gmail.com> <20250702050421.13729-3-rentao.bupt@gmail.com> Message-ID: <94e0c5bfe1239e7590cef427cbba405077d56d01.camel@codeconstruct.com.au> On Tue, 2025-07-01 at 22:04 -0700, rentao.bupt at gmail.com wrote: > From: Tao Ren > > Remove eMMC device entries from ast2600-facebook-netbmc-common.dtsi > because eMMC will be removed from future Meta/Facebook AST2600 network > OpenBMC platforms. Please squash this patch with the subsequent two patches so you don't break Fuji and Elbert across a bisect. Andrew From andrew at codeconstruct.com.au Fri Jul 4 10:11:51 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Fri, 04 Jul 2025 09:41:51 +0930 Subject: [PATCH v6 1/2] dt-bindings: mailbox: Add ASPEED AST2700 series SoC In-Reply-To: <20250702011956.47479-2-jammy_huang@aspeedtech.com> References: <20250702011956.47479-1-jammy_huang@aspeedtech.com> <20250702011956.47479-2-jammy_huang@aspeedtech.com> Message-ID: <0782e276f6e22a2f590eb905ef2c5617f0870b63.camel@codeconstruct.com.au> On Wed, 2025-07-02 at 09:19 +0800, Jammy Huang wrote: > Introduce the mailbox module for AST27XX series SoC, which is responsible > for interchanging messages between asymmetric processors. > > Signed-off-by: Jammy Huang > Reviewed-by: Krzysztof Kozlowski Reviewed-by: Andrew Jeffery From andrew at codeconstruct.com.au Fri Jul 4 11:24:45 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Fri, 04 Jul 2025 10:54:45 +0930 Subject: [PATCH v6 2/2] mailbox: aspeed: add mailbox driver for AST27XX series SoC In-Reply-To: <20250702011956.47479-3-jammy_huang@aspeedtech.com> References: <20250702011956.47479-1-jammy_huang@aspeedtech.com> <20250702011956.47479-3-jammy_huang@aspeedtech.com> Message-ID: <444ea7dd85b7e664043e3fae4a22d515fd121433.camel@codeconstruct.com.au> On Wed, 2025-07-02 at 09:19 +0800, Jammy Huang wrote: > Add mailbox controller driver for AST27XX SoCs, which provides > independent tx/rx mailbox between different processors. There are 4 > channels for each tx/rx mailbox and each channel has an 32-byte FIFO. > > Signed-off-by: Jammy Huang Reviewed-by: Andrew Jeffery From rentao.bupt at gmail.com Fri Jul 4 14:45:44 2025 From: rentao.bupt at gmail.com (Tao Ren) Date: Thu, 3 Jul 2025 21:45:44 -0700 Subject: [PATCH 1/5] ARM: dts: aspeed: Expand data0 partition in facebook-bmc-flash-layout-128.dtsi In-Reply-To: <78f9fcbc58261064f248e95eb7740549e338bc78.camel@codeconstruct.com.au> References: <20250702050421.13729-1-rentao.bupt@gmail.com> <20250702050421.13729-2-rentao.bupt@gmail.com> <78f9fcbc58261064f248e95eb7740549e338bc78.camel@codeconstruct.com.au> Message-ID: On Fri, Jul 04, 2025 at 09:36:29AM +0930, Andrew Jeffery wrote: > On Tue, 2025-07-01 at 22:04 -0700, rentao.bupt at gmail.com wrote: > > From: Tao Ren > > > > Expand data0 partition to 64MB in facebook-bmc-flash-layout-128.dtsi for > > larger persistent storage. > > > > Signed-off-by: Tao Ren > > --- > > ?.../boot/dts/aspeed/facebook-bmc-flash-layout-128.dtsi | 10 +++++----- > > ?1 file changed, 5 insertions(+), 5 deletions(-) > > > > diff --git a/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128.dtsi b/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128.dtsi > > index 7f3652dea550..efd92232cda2 100644 > > --- a/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128.dtsi > > +++ b/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128.dtsi > > @@ -32,19 +32,19 @@ image-meta at f0000 { > > ????????}; > > ? > > ????????/* > > -??????? * FIT image: 119 MB. > > +??????? * FIT image: 63 MB. > > ???????? */ > > ????????fit at 100000 { > > -???????????????reg = <0x100000 0x7700000>; > > +???????????????reg = <0x100000 0x3f00000>; > > ????????????????label = "fit"; > > ????????}; > > ? > > ????????/* > > -??????? * "data0" partition (8MB) is used by Facebook BMC platforms as > > +??????? * "data0" partition (64MB) is used by Facebook BMC platforms as > > ???????? * persistent data store. > > ???????? */ > > -???????data0 at 7800000 { > > -???????????????reg = <0x7800000 0x800000>; > > +???????data0 at 4000000 { > > +???????????????reg = <0x4000000 0x4000000>; > > ????????????????label = "data0"; > > ????????}; > > ? > > Two existing systems use this dtsi: > > > git grep facebook-bmc-flash-layout-128.dtsi > arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts:#include "facebook-bmc-flash-layout-128.dtsi" > arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi:#include "facebook-bmc-flash-layout-128.dtsi" > > This change requires a full reflash of those devices, which is pretty > disruptive. > > It seems more appropriate to me to create a separate dtsi for the new > flash layout to use in new systems. > > Andrew Hi Andrew, I agree it's better to create a new layout, and I will take care of it in v2. The migration is already done for all the network BMC platforms except elbert/darwin, and having separate layouts will make my life easier :) Any suggestions about the file name of the new layout? Thanks, Tao From rentao.bupt at gmail.com Fri Jul 4 14:46:29 2025 From: rentao.bupt at gmail.com (Tao Ren) Date: Thu, 3 Jul 2025 21:46:29 -0700 Subject: [PATCH 2/5] ARM: dts: aspeed: Remove eMMC from ast2600-facebook-netbmc-common.dtsi In-Reply-To: <94e0c5bfe1239e7590cef427cbba405077d56d01.camel@codeconstruct.com.au> References: <20250702050421.13729-1-rentao.bupt@gmail.com> <20250702050421.13729-3-rentao.bupt@gmail.com> <94e0c5bfe1239e7590cef427cbba405077d56d01.camel@codeconstruct.com.au> Message-ID: On Fri, Jul 04, 2025 at 09:38:39AM +0930, Andrew Jeffery wrote: > On Tue, 2025-07-01 at 22:04 -0700, rentao.bupt at gmail.com wrote: > > From: Tao Ren > > > > Remove eMMC device entries from ast2600-facebook-netbmc-common.dtsi > > because eMMC will be removed from future Meta/Facebook AST2600 network > > OpenBMC platforms. > > Please squash this patch with the subsequent two patches so you don't > break Fuji and Elbert across a bisect. > > Andrew Got it. I will take care of it in v2. Thanks, Tao From andrew at lunn.ch Fri Jul 4 17:37:20 2025 From: andrew at lunn.ch (Andrew Lunn) Date: Fri, 4 Jul 2025 09:37:20 +0200 Subject: [PATCH 5/5] ARM: dts: aspeed: Add Facebook Darwin (AST2600) BMC In-Reply-To: References: <20250702050421.13729-1-rentao.bupt@gmail.com> <20250702050421.13729-6-rentao.bupt@gmail.com> <220ac6c2-8373-4742-86fa-f322d6ada624@lunn.ch> Message-ID: <95ff4056-d1cc-4564-8c44-0535196e7428@lunn.ch> > Hi Andrew, > > Got it, and thanks for sharing the context. > > I will reach out to ASPEED offline to see if they are actively working > on the MAC fix, or if I have enough knowledge to work out the patch. There was some discussion about what needs to be done a couple of months ago. Look for emails from aspeed and IBM. Andrew From jdelvare at suse.de Sat Jul 5 00:46:37 2025 From: jdelvare at suse.de (Jean Delvare) Date: Fri, 4 Jul 2025 16:46:37 +0200 Subject: [PATCH v2 08/10] soc: aspeed: lpc-snoop: Use dev_err_probe() where possible In-Reply-To: <20250616-aspeed-lpc-snoop-fixes-v2-8-3cdd59c934d3@codeconstruct.com.au> References: <20250616-aspeed-lpc-snoop-fixes-v2-0-3cdd59c934d3@codeconstruct.com.au> <20250616-aspeed-lpc-snoop-fixes-v2-8-3cdd59c934d3@codeconstruct.com.au> Message-ID: <20250704164637.3552933a@endymion> On Mon, 16 Jun 2025 22:43:45 +0930, Andrew Jeffery wrote: > Exploit that it returns the provided error to eliminate some lines, and > return the actual error involved rather than -ENODEV. > > Signed-off-by: Andrew Jeffery > --- > drivers/soc/aspeed/aspeed-lpc-snoop.c | 15 +++++---------- > 1 file changed, 5 insertions(+), 10 deletions(-) > (...) LGTM. Acked-by: Jean Delvare -- Jean Delvare SUSE L3 Support From jdelvare at suse.de Sat Jul 5 00:42:39 2025 From: jdelvare at suse.de (Jean Delvare) Date: Fri, 4 Jul 2025 16:42:39 +0200 Subject: [PATCH v2 07/10] soc: aspeed: lpc-snoop: Switch to devm_clk_get_enabled() In-Reply-To: <20250616-aspeed-lpc-snoop-fixes-v2-7-3cdd59c934d3@codeconstruct.com.au> References: <20250616-aspeed-lpc-snoop-fixes-v2-0-3cdd59c934d3@codeconstruct.com.au> <20250616-aspeed-lpc-snoop-fixes-v2-7-3cdd59c934d3@codeconstruct.com.au> Message-ID: <20250704164239.2f3a7d62@endymion> Hello Andrew, On Mon, 16 Jun 2025 22:43:44 +0930, Andrew Jeffery wrote: > Simplify clock handling as done in other drivers. > > Signed-off-by: Andrew Jeffery > --- > drivers/soc/aspeed/aspeed-lpc-snoop.c | 20 ++++---------------- > 1 file changed, 4 insertions(+), 16 deletions(-) > (...) LGTM. Acked-by: Jean Delvare -- Jean Delvare SUSE L3 Support From jdelvare at suse.de Sat Jul 5 01:13:15 2025 From: jdelvare at suse.de (Jean Delvare) Date: Fri, 4 Jul 2025 17:13:15 +0200 Subject: [PATCH v2 09/10] soc: aspeed: lpc-snoop: Consolidate channel initialisation In-Reply-To: <20250616-aspeed-lpc-snoop-fixes-v2-9-3cdd59c934d3@codeconstruct.com.au> References: <20250616-aspeed-lpc-snoop-fixes-v2-0-3cdd59c934d3@codeconstruct.com.au> <20250616-aspeed-lpc-snoop-fixes-v2-9-3cdd59c934d3@codeconstruct.com.au> Message-ID: <20250704171315.30300f59@endymion> Hi Andrew, On Mon, 16 Jun 2025 22:43:46 +0930, Andrew Jeffery wrote: > Previously, channel initialisation was a bit perilous with respect to > resource cleanup in error paths. While the implementation had issues, > it at least made an effort to eliminate some of its problems by first > testing whether any channels were enabled, and bailing out if not. > > Having improved the robustness of resource handling in probe() we can > now rearrange the initial channel test to be located with the subsequent > test, and rework the unrolled conditional logic to use a loop for an > improvement in readability. I like the idea, this indeed improves readability and would make it much easier to add support for more channels. Three suggestions inline below. > Signed-off-by: Andrew Jeffery > --- > drivers/soc/aspeed/aspeed-lpc-snoop.c | 51 +++++++++++++++++------------------ > 1 file changed, 24 insertions(+), 27 deletions(-) > > diff --git a/drivers/soc/aspeed/aspeed-lpc-snoop.c b/drivers/soc/aspeed/aspeed-lpc-snoop.c > index 8dbc9d4158b89f23bda340f060d205a29bbb43c3..9f88c5471b1b6d85f6d9e1970240f3d1904d166c 100644 > --- a/drivers/soc/aspeed/aspeed-lpc-snoop.c > +++ b/drivers/soc/aspeed/aspeed-lpc-snoop.c > @@ -294,12 +294,21 @@ static void aspeed_lpc_disable_snoop(struct aspeed_lpc_snoop *lpc_snoop, > kfifo_free(&channel->fifo); > } > > +static void aspeed_lpc_snoop_remove(struct platform_device *pdev) > +{ > + struct aspeed_lpc_snoop *lpc_snoop = dev_get_drvdata(&pdev->dev); > + > + /* Disable both snoop channels */ > + aspeed_lpc_disable_snoop(lpc_snoop, ASPEED_LPC_SNOOP_INDEX_0); > + aspeed_lpc_disable_snoop(lpc_snoop, ASPEED_LPC_SNOOP_INDEX_1); For consistency with the probe function, I think it would make sense to use a for loop here as well, instead of hard-coding the channel number to 2. That way, no change will be needed if a future device supports more than 2 channels. > +} > + > static int aspeed_lpc_snoop_probe(struct platform_device *pdev) > { > struct aspeed_lpc_snoop *lpc_snoop; > - struct device *dev; > struct device_node *np; > - u32 port; > + struct device *dev; > + int idx; > int rc; > > dev = &pdev->dev; > @@ -322,12 +331,6 @@ static int aspeed_lpc_snoop_probe(struct platform_device *pdev) > > dev_set_drvdata(&pdev->dev, lpc_snoop); > > - rc = of_property_read_u32_index(dev->of_node, "snoop-ports", 0, &port); > - if (rc) { > - dev_err(dev, "no snoop ports configured\n"); > - return -ENODEV; > - } > - > lpc_snoop->clk = devm_clk_get_enabled(dev, NULL); > if (IS_ERR(lpc_snoop->clk)) > return dev_err_probe(dev, PTR_ERR(lpc_snoop->clk), "couldn't get clock"); > @@ -336,30 +339,24 @@ static int aspeed_lpc_snoop_probe(struct platform_device *pdev) > if (rc) > return rc; > > - rc = aspeed_lpc_enable_snoop(lpc_snoop, dev, ASPEED_LPC_SNOOP_INDEX_0, port); > - if (rc) > - return rc; > + for (idx = ASPEED_LPC_SNOOP_INDEX_0; idx <= ASPEED_LPC_SNOOP_INDEX_MAX; idx++) { > + u32 port; > > - /* Configuration of 2nd snoop channel port is optional */ > - if (of_property_read_u32_index(dev->of_node, "snoop-ports", > - 1, &port) == 0) { > - rc = aspeed_lpc_enable_snoop(lpc_snoop, dev, ASPEED_LPC_SNOOP_INDEX_1, port); > - if (rc) { > - aspeed_lpc_disable_snoop(lpc_snoop, ASPEED_LPC_SNOOP_INDEX_0); > - return rc; > - } > + rc = of_property_read_u32_index(dev->of_node, "snoop-ports", idx, &port); > + if (rc) > + break; > + > + rc = aspeed_lpc_enable_snoop(lpc_snoop, dev, idx, port); > + if (rc) > + goto cleanup_channels; > } > > - return 0; > -} > + return idx == ASPEED_LPC_SNOOP_INDEX_0 ? -ENODEV : 0; The driver used to log an error message when returning -NODEV: "no snoop ports configured". Maybe you could call dev_err_probe() here? It might also be a good idea to add a comment stating that only the first channel is mandatory, to explain why the ASPEED_LPC_SNOOP_INDEX_0 case is handled differently (there used to be a comment /* Configuration of 2nd snoop channel port is optional */ serving that purpose). > > -static void aspeed_lpc_snoop_remove(struct platform_device *pdev) > -{ > - struct aspeed_lpc_snoop *lpc_snoop = dev_get_drvdata(&pdev->dev); > +cleanup_channels: > + aspeed_lpc_snoop_remove(pdev); > > - /* Disable both snoop channels */ > - aspeed_lpc_disable_snoop(lpc_snoop, ASPEED_LPC_SNOOP_INDEX_0); > - aspeed_lpc_disable_snoop(lpc_snoop, ASPEED_LPC_SNOOP_INDEX_1); > + return rc; > } > > static const struct aspeed_lpc_snoop_model_data ast2400_model_data = { > None if this is blocking though, so: Acked-by: Jean Delvare -- Jean Delvare SUSE L3 Support From jdelvare at suse.de Sat Jul 5 01:34:43 2025 From: jdelvare at suse.de (Jean Delvare) Date: Fri, 4 Jul 2025 17:34:43 +0200 Subject: [PATCH v2 06/10] soc: aspeed: lpc-snoop: Rearrange channel paths In-Reply-To: <20250616-aspeed-lpc-snoop-fixes-v2-6-3cdd59c934d3@codeconstruct.com.au> References: <20250616-aspeed-lpc-snoop-fixes-v2-0-3cdd59c934d3@codeconstruct.com.au> <20250616-aspeed-lpc-snoop-fixes-v2-6-3cdd59c934d3@codeconstruct.com.au> Message-ID: <20250704173443.3436f535@endymion> On Mon, 16 Jun 2025 22:43:43 +0930, Andrew Jeffery wrote: > Order assignments such that tests for conditions not involving resource > acquisition are ordered before those testing acquired resources, and > order managed resource acquisition before unmanaged where possible. This > way we minimise the amount of manual cleanup required. > > In the process, improve readability of the code by introducing a channel > pointer that takes the place of the repeated object lookups. > > Acked-by: Jean Delvare > Signed-off-by: Andrew Jeffery > --- > drivers/soc/aspeed/aspeed-lpc-snoop.c | 51 ++++++++++++++++++++--------------- > 1 file changed, 29 insertions(+), 22 deletions(-) > (...) > @@ -238,6 +240,7 @@ static int aspeed_lpc_enable_snoop(struct aspeed_lpc_snoop *lpc_snoop, > goto err_misc_deregister; > } > > + /* Enable LPC snoop channel at requested port */ > regmap_update_bits(lpc_snoop->regmap, HICR5, hicr5_en, hicr5_en); > regmap_update_bits(lpc_snoop->regmap, SNPWADR, snpwadr_mask, > lpc_port << snpwadr_shift); This duplicates a comment which is already present in the driver a few lines before. This duplicated comment gets cleaned up later in patch 10/10 (soc: aspeed: lpc-snoop: Lift channel config to const structs). -- Jean Delvare SUSE L3 Support From jdelvare at suse.de Sat Jul 5 02:23:48 2025 From: jdelvare at suse.de (Jean Delvare) Date: Fri, 4 Jul 2025 18:23:48 +0200 Subject: [PATCH v2 10/10] soc: aspeed: lpc-snoop: Lift channel config to const structs In-Reply-To: <20250616-aspeed-lpc-snoop-fixes-v2-10-3cdd59c934d3@codeconstruct.com.au> References: <20250616-aspeed-lpc-snoop-fixes-v2-0-3cdd59c934d3@codeconstruct.com.au> <20250616-aspeed-lpc-snoop-fixes-v2-10-3cdd59c934d3@codeconstruct.com.au> Message-ID: <20250704182348.53808e0f@endymion> Hi Andrew, On Mon, 16 Jun 2025 22:43:47 +0930, Andrew Jeffery wrote: > The shifts and masks for each channel are defined by hardware and > are not something that changes at runtime. Accordingly, describe the > information in an array of const structs and associate elements with > each channel instance, removing the need for the switch and handling of > its default case. I like this. Note that technically, the removal of the default case in the switch was already possible since patch 06/10 (soc: aspeed: lpc-snoop: Constrain parameters in channel paths). > Signed-off-by: Andrew Jeffery > --- > drivers/soc/aspeed/aspeed-lpc-snoop.c | 100 +++++++++++++++------------------- > 1 file changed, 45 insertions(+), 55 deletions(-) > > diff --git a/drivers/soc/aspeed/aspeed-lpc-snoop.c b/drivers/soc/aspeed/aspeed-lpc-snoop.c > index 9f88c5471b1b6d85f6d9e1970240f3d1904d166c..2d97b8d5fb429e215c321c9c2ee3fa35d39f8618 100644 > --- a/drivers/soc/aspeed/aspeed-lpc-snoop.c > +++ b/drivers/soc/aspeed/aspeed-lpc-snoop.c > @@ -63,7 +63,16 @@ enum aspeed_lpc_snoop_index { > ASPEED_LPC_SNOOP_INDEX_MAX = ASPEED_LPC_SNOOP_INDEX_1, > }; > > +struct aspeed_lpc_snoop_channel_cfg { > + enum aspeed_lpc_snoop_index index; > + u32 hicr5_en; > + u32 snpwadr_mask; > + u32 snpwadr_shift; > + u32 hicrb_en; > +}; > + > struct aspeed_lpc_snoop_channel { > + const struct aspeed_lpc_snoop_channel_cfg *cfg; > bool enabled; > struct kfifo fifo; > wait_queue_head_t wq; > @@ -77,6 +86,23 @@ struct aspeed_lpc_snoop { > struct aspeed_lpc_snoop_channel chan[ASPEED_LPC_SNOOP_INDEX_MAX + 1]; > }; > > +static const struct aspeed_lpc_snoop_channel_cfg channel_cfgs[ASPEED_LPC_SNOOP_INDEX_MAX + 1] = { > + { > + .index = ASPEED_LPC_SNOOP_INDEX_0, > + .hicr5_en = HICR5_EN_SNP0W | HICR5_ENINT_SNP0W, > + .snpwadr_mask = SNPWADR_CH0_MASK, > + .snpwadr_shift = SNPWADR_CH0_SHIFT, > + .hicrb_en = HICRB_ENSNP0D, > + }, > + { > + .index = ASPEED_LPC_SNOOP_INDEX_1, > + .hicr5_en = HICR5_EN_SNP1W | HICR5_ENINT_SNP1W, > + .snpwadr_mask = SNPWADR_CH1_MASK, > + .snpwadr_shift = SNPWADR_CH1_SHIFT, > + .hicrb_en = HICRB_ENSNP1D, > + }, > +}; > + > static struct aspeed_lpc_snoop_channel *snoop_file_to_chan(struct file *file) > { > return container_of(file->private_data, > @@ -189,28 +215,27 @@ static int aspeed_lpc_snoop_config_irq(struct aspeed_lpc_snoop *lpc_snoop, > } > > __attribute__((nonnull)) > -static int aspeed_lpc_enable_snoop(struct aspeed_lpc_snoop *lpc_snoop, > - struct device *dev, > - enum aspeed_lpc_snoop_index index, u16 lpc_port) > +static int aspeed_lpc_enable_snoop(struct device *dev, > + struct aspeed_lpc_snoop *lpc_snoop, > + struct aspeed_lpc_snoop_channel *channel, > + const struct aspeed_lpc_snoop_channel_cfg *cfg, > + u16 lpc_port) > { I'm confused by this new calling convention. With lpc_snoop and index, you could already retrieve the aspeed_lpc_snoop_channel struct and the aspeed_lpc_snoop_channel_cfg struct. I can't see the benefit of the change. It even forces you to add an index field to struct aspeed_lpc_snoop_channel_cfg, which would otherwise not be needed. If you prefer to pass cfg instead of index as a parameter, that does not imply passing channel too. You can get the index from the cfg (if you decide to keep it in that struct), and then the channel from index. Or you could even pass only the channel (to be consistent with aspeed_lpc_disable_snoop), if you set channel->cfg before calling this function. Again this implies keeping index in struct aspeed_lpc_snoop_channel_cfg. > const struct aspeed_lpc_snoop_model_data *model_data; > - u32 hicr5_en, snpwadr_mask, snpwadr_shift, hicrb_en; > - struct aspeed_lpc_snoop_channel *channel; > int rc = 0; > > - channel = &lpc_snoop->chan[index]; > - > if (WARN_ON(channel->enabled)) > return -EBUSY; > > init_waitqueue_head(&channel->wq); > > + channel->cfg = cfg; > channel->miscdev.minor = MISC_DYNAMIC_MINOR; > channel->miscdev.fops = &snoop_fops; > channel->miscdev.parent = dev; > > channel->miscdev.name = > - devm_kasprintf(dev, GFP_KERNEL, "%s%d", DEVICE_NAME, index); > + devm_kasprintf(dev, GFP_KERNEL, "%s%d", DEVICE_NAME, cfg->index); > if (!channel->miscdev.name) > return -ENOMEM; > > @@ -223,39 +248,18 @@ static int aspeed_lpc_enable_snoop(struct aspeed_lpc_snoop *lpc_snoop, > goto err_free_fifo; > > /* Enable LPC snoop channel at requested port */ > - switch (index) { > - case 0: > - hicr5_en = HICR5_EN_SNP0W | HICR5_ENINT_SNP0W; > - snpwadr_mask = SNPWADR_CH0_MASK; > - snpwadr_shift = SNPWADR_CH0_SHIFT; > - hicrb_en = HICRB_ENSNP0D; > - break; > - case 1: > - hicr5_en = HICR5_EN_SNP1W | HICR5_ENINT_SNP1W; > - snpwadr_mask = SNPWADR_CH1_MASK; > - snpwadr_shift = SNPWADR_CH1_SHIFT; > - hicrb_en = HICRB_ENSNP1D; > - break; > - default: > - rc = -EINVAL; > - goto err_misc_deregister; > - } > - > - /* Enable LPC snoop channel at requested port */ > - regmap_update_bits(lpc_snoop->regmap, HICR5, hicr5_en, hicr5_en); > - regmap_update_bits(lpc_snoop->regmap, SNPWADR, snpwadr_mask, > - lpc_port << snpwadr_shift); > + regmap_set_bits(lpc_snoop->regmap, HICR5, cfg->hicr5_en); > + regmap_update_bits(lpc_snoop->regmap, SNPWADR, cfg->snpwadr_mask, > + lpc_port << cfg->snpwadr_shift); It is a good practice to align the second line on the opening parenthesis of the first line (as was done originally). > > model_data = of_device_get_match_data(dev); > if (model_data && model_data->has_hicrb_ensnp) > - regmap_update_bits(lpc_snoop->regmap, HICRB, hicrb_en, hicrb_en); > + regmap_set_bits(lpc_snoop->regmap, HICRB, cfg->hicrb_en); > > channel->enabled = true; > > return 0; > > -err_misc_deregister: > - misc_deregister(&channel->miscdev); > err_free_fifo: > kfifo_free(&channel->fifo); > return rc; > @@ -263,30 +267,13 @@ static int aspeed_lpc_enable_snoop(struct aspeed_lpc_snoop *lpc_snoop, > > __attribute__((nonnull)) > static void aspeed_lpc_disable_snoop(struct aspeed_lpc_snoop *lpc_snoop, > - enum aspeed_lpc_snoop_index index) > + struct aspeed_lpc_snoop_channel *channel) > { > - struct aspeed_lpc_snoop_channel *channel; > - > - channel = &lpc_snoop->chan[index]; > - > if (!channel->enabled) > return; > > /* Disable interrupts along with the device */ > - switch (index) { > - case 0: > - regmap_update_bits(lpc_snoop->regmap, HICR5, > - HICR5_EN_SNP0W | HICR5_ENINT_SNP0W, > - 0); > - break; > - case 1: > - regmap_update_bits(lpc_snoop->regmap, HICR5, > - HICR5_EN_SNP1W | HICR5_ENINT_SNP1W, > - 0); > - break; > - default: > - return; > - } > + regmap_clear_bits(lpc_snoop->regmap, HICR5, channel->cfg->hicr5_en); > > channel->enabled = false; > /* Consider improving safety wrt concurrent reader(s) */ > @@ -299,8 +286,8 @@ static void aspeed_lpc_snoop_remove(struct platform_device *pdev) > struct aspeed_lpc_snoop *lpc_snoop = dev_get_drvdata(&pdev->dev); > > /* Disable both snoop channels */ > - aspeed_lpc_disable_snoop(lpc_snoop, ASPEED_LPC_SNOOP_INDEX_0); > - aspeed_lpc_disable_snoop(lpc_snoop, ASPEED_LPC_SNOOP_INDEX_1); > + aspeed_lpc_disable_snoop(lpc_snoop, &lpc_snoop->chan[0]); > + aspeed_lpc_disable_snoop(lpc_snoop, &lpc_snoop->chan[1]); > } > > static int aspeed_lpc_snoop_probe(struct platform_device *pdev) > @@ -339,6 +326,8 @@ static int aspeed_lpc_snoop_probe(struct platform_device *pdev) > if (rc) > return rc; > > + static_assert(ARRAY_SIZE(channel_cfgs) == ARRAY_SIZE(lpc_snoop->chan), > + "Broken implementation assumption regarding cfg count"); Both also need to be equal to ASPEED_LPC_SNOOP_INDEX_MAX + 1, right? Otherwise the loop below would break. But it turns out that both arrays are now declared that way, so it just has to be true. This makes me believe that this static assert is no longer needed. > for (idx = ASPEED_LPC_SNOOP_INDEX_0; idx <= ASPEED_LPC_SNOOP_INDEX_MAX; idx++) { > u32 port; > > @@ -346,7 +335,8 @@ static int aspeed_lpc_snoop_probe(struct platform_device *pdev) > if (rc) > break; > > - rc = aspeed_lpc_enable_snoop(lpc_snoop, dev, idx, port); > + rc = aspeed_lpc_enable_snoop(dev, lpc_snoop, &lpc_snoop->chan[idx], > + &channel_cfgs[idx], port); > if (rc) > goto cleanup_channels; > } > -- Jean Delvare SUSE L3 Support From jdelvare at suse.de Sat Jul 5 02:44:08 2025 From: jdelvare at suse.de (Jean Delvare) Date: Fri, 4 Jul 2025 18:44:08 +0200 Subject: [PATCH v2 04/10] soc: aspeed: lpc-snoop: Constrain parameters in channel paths In-Reply-To: <20250616-aspeed-lpc-snoop-fixes-v2-4-3cdd59c934d3@codeconstruct.com.au> References: <20250616-aspeed-lpc-snoop-fixes-v2-0-3cdd59c934d3@codeconstruct.com.au> <20250616-aspeed-lpc-snoop-fixes-v2-4-3cdd59c934d3@codeconstruct.com.au> Message-ID: <20250704184408.32227305@endymion> On Mon, 16 Jun 2025 22:43:41 +0930, Andrew Jeffery wrote: > Ensure pointers and the channel index are valid before use. > > Signed-off-by: Andrew Jeffery > --- > drivers/soc/aspeed/aspeed-lpc-snoop.c | 25 ++++++++++++++++--------- > 1 file changed, 16 insertions(+), 9 deletions(-) > > diff --git a/drivers/soc/aspeed/aspeed-lpc-snoop.c b/drivers/soc/aspeed/aspeed-lpc-snoop.c > index ca7536213e0986f737606a52996ffea620df2a7a..804c6ed9c4c671da73a6c66c1de41c59922c82dc 100644 > --- a/drivers/soc/aspeed/aspeed-lpc-snoop.c > +++ b/drivers/soc/aspeed/aspeed-lpc-snoop.c > @@ -25,7 +25,6 @@ > > #define DEVICE_NAME "aspeed-lpc-snoop" > > -#define NUM_SNOOP_CHANNELS 2 > #define SNOOP_FIFO_SIZE 2048 > > #define HICR5 0x80 > @@ -57,6 +56,12 @@ struct aspeed_lpc_snoop_model_data { > unsigned int has_hicrb_ensnp; > }; > > +enum aspeed_lpc_snoop_index { > + ASPEED_LPC_SNOOP_INDEX_0 = 0, > + ASPEED_LPC_SNOOP_INDEX_1 = 1, > + ASPEED_LPC_SNOOP_INDEX_MAX = ASPEED_LPC_SNOOP_INDEX_1, > +}; I don't have a strong opinion on this (again, I'm neither the driver maintainer nor the subsystem maintainer so my opinion has little value), but IMHO the main value of introducing an enum here was to make it possible to get rid of the default statement in the switch constructs. With switch constructs being gone in patch 10/10 (soc: aspeed: lpc-snoop: Lift channel config to const structs), the value of this enum seems pretty low now. You could use NUM_SNOOP_CHANNELS instead of ASPEED_LPC_SNOOP_INDEX_MAX + 1 and 0 and 1 instead of ASPEED_LPC_SNOOP_INDEX_0 and ASPEED_LPC_SNOOP_INDEX_1, respectively, and the code would work just the same, while being more simple, with no downside that I can see. -- Jean Delvare SUSE L3 Support From rentao.bupt at gmail.com Sun Jul 6 14:12:04 2025 From: rentao.bupt at gmail.com (Tao Ren) Date: Sat, 5 Jul 2025 21:12:04 -0700 Subject: [PATCH 5/5] ARM: dts: aspeed: Add Facebook Darwin (AST2600) BMC In-Reply-To: <95ff4056-d1cc-4564-8c44-0535196e7428@lunn.ch> References: <20250702050421.13729-1-rentao.bupt@gmail.com> <20250702050421.13729-6-rentao.bupt@gmail.com> <220ac6c2-8373-4742-86fa-f322d6ada624@lunn.ch> <95ff4056-d1cc-4564-8c44-0535196e7428@lunn.ch> Message-ID: On Fri, Jul 04, 2025 at 09:37:20AM +0200, Andrew Lunn wrote: > > Hi Andrew, > > > > Got it, and thanks for sharing the context. > > > > I will reach out to ASPEED offline to see if they are actively working > > on the MAC fix, or if I have enough knowledge to work out the patch. > > There was some discussion about what needs to be done a couple of > months ago. Look for emails from aspeed and IBM. > > Andrew Hi Andrew, I guess you are referring to the discussions in patch "ARM: dts: aspeed: system1: Add RGMII support", and I can find more of your suggestions in the thread. I will remove mac controller from my v2 for now, and will add it back when the delay support is added to the MAC driver. Thanks again. - Tao From rentao.bupt at gmail.com Sun Jul 6 14:23:50 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sat, 5 Jul 2025 21:23:50 -0700 Subject: [PATCH v2 0/9] ARM: dts: aspeed: Add Meta Darwin dts Message-ID: <20250706042404.138128-1-rentao.bupt@gmail.com> From: Tao Ren The patch series introduces the initial device tree for Meta/Facebook Darwin AST2600 BMC. Patches #1, #2 and #3 fixes the DTB warnings in wedge400/fuji dts and ast2600-facebook-netbmc-common.dtsi. Patches #4, #5 and #6 introduces a new BMC flash layout to be used by wedge400 and fuji (and later more Meta Network BMC platforms). Patch #7 moves eMMC entries from ast2600-facebook-netbmc-common.dtsi to each BMC platform because eMMC was removed from future Meta Network BMC platforms. Patches #8 and #9 adds Meta Darwin BMC and updates devicetree bindings. Tao Ren (9): ARM: dts: aspeed: wedge400: Fix DTB warnings ARM: dts: aspeed: fuji: Fix DTB warnings ARM: dts: aspeed: Fix DTB warnings in ast2600-facebook-netbmc-common.dtsi ARM: dts: aspeed: Add facebook-bmc-flash-layout-128-data64.dtsi ARM: dts: aspeed: wedge400: Extend data0 partition to 64MB ARM: dts: aspeed: Move flash layout out of Facebook netbmc-common.dtsi ARM: dts: aspeed: Move eMMC out of ast2600-facebook-netbmc-common.dtsi dt-bindings: arm: aspeed: add Facebook Darwin board ARM: dts: aspeed: Add Facebook Darwin (AST2600) BMC .../bindings/arm/aspeed/aspeed.yaml | 1 + arch/arm/boot/dts/aspeed/Makefile | 1 + .../dts/aspeed/aspeed-bmc-facebook-darwin.dts | 78 +++++++++++++++++++ .../dts/aspeed/aspeed-bmc-facebook-elbert.dts | 18 +++++ .../dts/aspeed/aspeed-bmc-facebook-fuji.dts | 24 ++++-- .../aspeed/aspeed-bmc-facebook-wedge400.dts | 8 +- .../ast2600-facebook-netbmc-common.dtsi | 24 ++---- .../facebook-bmc-flash-layout-128-data64.dtsi | 60 ++++++++++++++ 8 files changed, 187 insertions(+), 27 deletions(-) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts create mode 100644 arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128-data64.dtsi -- 2.47.1 From rentao.bupt at gmail.com Sun Jul 6 14:23:51 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sat, 5 Jul 2025 21:23:51 -0700 Subject: [PATCH v2 1/9] ARM: dts: aspeed: wedge400: Fix DTB warnings In-Reply-To: <20250706042404.138128-1-rentao.bupt@gmail.com> References: <20250706042404.138128-1-rentao.bupt@gmail.com> Message-ID: <20250706042404.138128-2-rentao.bupt@gmail.com> From: Tao Ren Fix the deprecated spi-gpio properties in wedge400 dts. Signed-off-by: Tao Ren --- Changes in v2: - None (the patch is introduced in v2). arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts index 5a8169bbda87..3e4d30f0884d 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts @@ -75,9 +75,9 @@ spi_gpio: spi { #size-cells = <0>; cs-gpios = <&gpio ASPEED_GPIO(R, 2) GPIO_ACTIVE_LOW>; - gpio-sck = <&gpio ASPEED_GPIO(R, 3) GPIO_ACTIVE_HIGH>; - gpio-mosi = <&gpio ASPEED_GPIO(R, 4) GPIO_ACTIVE_HIGH>; - gpio-miso = <&gpio ASPEED_GPIO(R, 5) GPIO_ACTIVE_HIGH>; + sck-gpios = <&gpio ASPEED_GPIO(R, 3) GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio ASPEED_GPIO(R, 4) GPIO_ACTIVE_HIGH>; + miso-gpios = <&gpio ASPEED_GPIO(R, 5) GPIO_ACTIVE_HIGH>; num-chipselects = <1>; tpm at 0 { -- 2.47.1 From rentao.bupt at gmail.com Sun Jul 6 14:23:52 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sat, 5 Jul 2025 21:23:52 -0700 Subject: [PATCH v2 2/9] ARM: dts: aspeed: fuji: Fix DTB warnings In-Reply-To: <20250706042404.138128-1-rentao.bupt@gmail.com> References: <20250706042404.138128-1-rentao.bupt@gmail.com> Message-ID: <20250706042404.138128-3-rentao.bupt@gmail.com> From: Tao Ren Remove redundant adm1278 properties from fuji dts. Signed-off-by: Tao Ren --- Changes in v2: - None (the patch is introduced in v2). arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts index f23c26a3441d..840d19d6b1d4 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts @@ -248,8 +248,6 @@ imux16: i2c at 0 { adm1278 at 10 { compatible = "adi,adm1278"; reg = <0x10>; - #address-cells = <1>; - #size-cells = <0>; shunt-resistor-micro-ohms = <1500>; }; }; @@ -577,8 +575,6 @@ imux67: i2c at 3 { adm1278 at 10 { compatible = "adi,adm1278"; reg = <0x10>; - #address-cells = <1>; - #size-cells = <0>; shunt-resistor-micro-ohms = <250>; }; }; @@ -648,8 +644,6 @@ imux75: i2c at 3 { adm1278 at 10 { compatible = "adi,adm1278"; reg = <0x10>; - #address-cells = <1>; - #size-cells = <0>; shunt-resistor-micro-ohms = <250>; }; }; -- 2.47.1 From rentao.bupt at gmail.com Sun Jul 6 14:23:53 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sat, 5 Jul 2025 21:23:53 -0700 Subject: [PATCH v2 3/9] ARM: dts: aspeed: Fix DTB warnings in ast2600-facebook-netbmc-common.dtsi In-Reply-To: <20250706042404.138128-1-rentao.bupt@gmail.com> References: <20250706042404.138128-1-rentao.bupt@gmail.com> Message-ID: <20250706042404.138128-4-rentao.bupt@gmail.com> From: Tao Ren Fix deprecated spi-gpio properties in ast2600-facebook-netbmc-common.dtsi. Signed-off-by: Tao Ren --- Changes in v2: - None (the patch is introduced in v2). .../dts/aspeed/ast2600-facebook-netbmc-common.dtsi | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi b/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi index 00e5887c926f..208cf6567ed4 100644 --- a/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi +++ b/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi @@ -31,9 +31,13 @@ spi_gpio: spi { #address-cells = <1>; #size-cells = <0>; - gpio-sck = <&gpio0 ASPEED_GPIO(X, 3) GPIO_ACTIVE_HIGH>; - gpio-mosi = <&gpio0 ASPEED_GPIO(X, 4) GPIO_ACTIVE_HIGH>; - gpio-miso = <&gpio0 ASPEED_GPIO(X, 5) GPIO_ACTIVE_HIGH>; + /* + * chipselect pins are defined in platform .dts files + * separately. + */ + sck-gpios = <&gpio0 ASPEED_GPIO(X, 3) GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio0 ASPEED_GPIO(X, 4) GPIO_ACTIVE_HIGH>; + miso-gpios = <&gpio0 ASPEED_GPIO(X, 5) GPIO_ACTIVE_HIGH>; tpm at 0 { compatible = "infineon,slb9670", "tcg,tpm_tis-spi"; -- 2.47.1 From rentao.bupt at gmail.com Sun Jul 6 14:23:54 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sat, 5 Jul 2025 21:23:54 -0700 Subject: [PATCH v2 4/9] ARM: dts: aspeed: Add facebook-bmc-flash-layout-128-data64.dtsi In-Reply-To: <20250706042404.138128-1-rentao.bupt@gmail.com> References: <20250706042404.138128-1-rentao.bupt@gmail.com> Message-ID: <20250706042404.138128-5-rentao.bupt@gmail.com> From: Tao Ren Add facebook-bmc-flash-layout-128-data64.dts (with 64MB datastore) to be used by Meta Network BMC platforms. Signed-off-by: Tao Ren --- Changes in v2: - None (the patch is introduced in v2 per Andrew's suggestion). .../facebook-bmc-flash-layout-128-data64.dtsi | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128-data64.dtsi diff --git a/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128-data64.dtsi b/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128-data64.dtsi new file mode 100644 index 000000000000..efd92232cda2 --- /dev/null +++ b/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128-data64.dtsi @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Copyright (c) 2020 Facebook Inc. + +partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* + * u-boot partition: 896KB. + */ + u-boot at 0 { + reg = <0x0 0xe0000>; + label = "u-boot"; + }; + + /* + * u-boot environment variables: 64KB. + */ + u-boot-env at e0000 { + reg = <0xe0000 0x10000>; + label = "env"; + }; + + /* + * image metadata partition (64KB), used by Facebook internal + * tools. + */ + image-meta at f0000 { + reg = <0xf0000 0x10000>; + label = "meta"; + }; + + /* + * FIT image: 63 MB. + */ + fit at 100000 { + reg = <0x100000 0x3f00000>; + label = "fit"; + }; + + /* + * "data0" partition (64MB) is used by Facebook BMC platforms as + * persistent data store. + */ + data0 at 4000000 { + reg = <0x4000000 0x4000000>; + label = "data0"; + }; + + /* + * Although the master partition can be created by enabling + * MTD_PARTITIONED_MASTER option, below "flash0" partition is + * explicitly created to avoid breaking legacy applications. + */ + flash0 at 0 { + reg = <0x0 0x8000000>; + label = "flash0"; + }; +}; -- 2.47.1 From rentao.bupt at gmail.com Sun Jul 6 14:23:55 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sat, 5 Jul 2025 21:23:55 -0700 Subject: [PATCH v2 5/9] ARM: dts: aspeed: wedge400: Extend data0 partition to 64MB In-Reply-To: <20250706042404.138128-1-rentao.bupt@gmail.com> References: <20250706042404.138128-1-rentao.bupt@gmail.com> Message-ID: <20250706042404.138128-6-rentao.bupt@gmail.com> From: Tao Ren Extend wedge400 BMC flash's data0 partition to 64MB for larger persistent storage. Signed-off-by: Tao Ren --- Changes in v2: - None (the patch is introduced in v2). arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts index 3e4d30f0884d..cf6c768cbad5 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts @@ -92,7 +92,7 @@ tpm at 0 { * Both firmware flashes are 128MB on Wedge400 BMC. */ &fmc_flash0 { -#include "facebook-bmc-flash-layout-128.dtsi" +#include "facebook-bmc-flash-layout-128-data64.dtsi" }; &fmc_flash1 { -- 2.47.1 From rentao.bupt at gmail.com Sun Jul 6 14:23:56 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sat, 5 Jul 2025 21:23:56 -0700 Subject: [PATCH v2 6/9] ARM: dts: aspeed: Move flash layout out of Facebook netbmc-common.dtsi In-Reply-To: <20250706042404.138128-1-rentao.bupt@gmail.com> References: <20250706042404.138128-1-rentao.bupt@gmail.com> Message-ID: <20250706042404.138128-7-rentao.bupt@gmail.com> From: Tao Ren Move BMC flash layout from ast2600-facebook-netbmc-common.dtsi to each BMC platform so it's easier to apply different layout settings. The fuji data0 partition was already extended to 64MB in Meta environment. Elbert flash layout is not changed. Signed-off-by: Tao Ren --- Changes in v2: - None (the patch is introduced in v2). arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts | 6 ++++++ arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts | 6 ++++++ .../arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi | 2 -- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts index 74f3c67e0eff..673cabbec92e 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts @@ -50,6 +50,12 @@ spi_gpio: spi { }; }; +&fmc { + flash at 0 { +#include "facebook-bmc-flash-layout-128.dtsi" + }; +}; + &lpc_ctrl { status = "okay"; }; diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts index 840d19d6b1d4..71f58ad1ff06 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts @@ -223,6 +223,12 @@ eeprom at 2 { }; }; +&fmc { + flash at 0 { +#include "facebook-bmc-flash-layout-128-data64.dtsi" + }; +}; + &i2c0 { multi-master; bus-frequency = <1000000>; diff --git a/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi b/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi index 208cf6567ed4..4f819bf8c909 100644 --- a/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi +++ b/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi @@ -54,8 +54,6 @@ flash at 0 { status = "okay"; m25p,fast-read; label = "spi0.0"; - -#include "facebook-bmc-flash-layout-128.dtsi" }; flash at 1 { -- 2.47.1 From rentao.bupt at gmail.com Sun Jul 6 14:23:57 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sat, 5 Jul 2025 21:23:57 -0700 Subject: [PATCH v2 7/9] ARM: dts: aspeed: Move eMMC out of ast2600-facebook-netbmc-common.dtsi In-Reply-To: <20250706042404.138128-1-rentao.bupt@gmail.com> References: <20250706042404.138128-1-rentao.bupt@gmail.com> Message-ID: <20250706042404.138128-8-rentao.bupt@gmail.com> From: Tao Ren Move eMMC entries from ast2600-facebook-netbmc-common.dtsi to each platform because eMMC is removed from future Meta/Facebook AST2600 Network BMC platforms. Signed-off-by: Tao Ren --- Changes in v2: - The 3 emmc-related patches in v1 are squashed into this patch. .../boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts | 12 ++++++++++++ .../arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts | 12 ++++++++++++ .../dts/aspeed/ast2600-facebook-netbmc-common.dtsi | 12 ------------ 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts index 673cabbec92e..a21742daf899 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts @@ -207,3 +207,15 @@ fixed-link { full-duplex; }; }; + +&emmc_controller { + status = "okay"; +}; + +&emmc { + status = "okay"; + + non-removable; + max-frequency = <25000000>; + bus-width = <4>; +}; diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts index 71f58ad1ff06..0890b1728658 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts @@ -1249,3 +1249,15 @@ &mac3 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_rgmii4_default>; }; + +&emmc_controller { + status = "okay"; +}; + +&emmc { + status = "okay"; + + non-removable; + max-frequency = <25000000>; + bus-width = <4>; +}; diff --git a/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi b/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi index 4f819bf8c909..d19897ba5dbc 100644 --- a/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi +++ b/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi @@ -154,18 +154,6 @@ &vhub { status = "okay"; }; -&emmc_controller { - status = "okay"; -}; - -&emmc { - status = "okay"; - - non-removable; - max-frequency = <25000000>; - bus-width = <4>; -}; - &rtc { status = "okay"; }; -- 2.47.1 From rentao.bupt at gmail.com Sun Jul 6 14:23:58 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sat, 5 Jul 2025 21:23:58 -0700 Subject: [PATCH v2 8/9] dt-bindings: arm: aspeed: add Facebook Darwin board In-Reply-To: <20250706042404.138128-1-rentao.bupt@gmail.com> References: <20250706042404.138128-1-rentao.bupt@gmail.com> Message-ID: <20250706042404.138128-9-rentao.bupt@gmail.com> From: Tao Ren Document the new compatibles used on Meta/Facebook Darwin board. Signed-off-by: Tao Ren --- Changes in v2: - None (the patch is introduced in v2). Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml index 01333ac111fb..dba3d07cba84 100644 --- a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml +++ b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml @@ -82,6 +82,7 @@ properties: - facebook,bletchley-bmc - facebook,catalina-bmc - facebook,cloudripper-bmc + - facebook,darwin-bmc - facebook,elbert-bmc - facebook,fuji-bmc - facebook,greatlakes-bmc -- 2.47.1 From rentao.bupt at gmail.com Sun Jul 6 14:23:59 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sat, 5 Jul 2025 21:23:59 -0700 Subject: [PATCH v2 9/9] ARM: dts: aspeed: Add Facebook Darwin (AST2600) BMC In-Reply-To: <20250706042404.138128-1-rentao.bupt@gmail.com> References: <20250706042404.138128-1-rentao.bupt@gmail.com> Message-ID: <20250706042404.138128-10-rentao.bupt@gmail.com> From: Tao Ren Add initial device tree for the Meta (Facebook) Darwin AST2600 BMC. Darwin is Meta's rack switch platform with an AST2600 BMC integrated for health monitoring purpose. Signed-off-by: Tao Ren --- Changes in v2: - Removed mac3 controller. - Fixed DTB warnings. arch/arm/boot/dts/aspeed/Makefile | 1 + .../dts/aspeed/aspeed-bmc-facebook-darwin.dts | 78 +++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile index 2e5f4833a073..debbfc0151f8 100644 --- a/arch/arm/boot/dts/aspeed/Makefile +++ b/arch/arm/boot/dts/aspeed/Makefile @@ -20,6 +20,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ aspeed-bmc-facebook-bletchley.dtb \ aspeed-bmc-facebook-catalina.dtb \ aspeed-bmc-facebook-cmm.dtb \ + aspeed-bmc-facebook-darwin.dtb \ aspeed-bmc-facebook-elbert.dtb \ aspeed-bmc-facebook-fuji.dtb \ aspeed-bmc-facebook-galaxy100.dtb \ diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts new file mode 100644 index 000000000000..e2e71b1d02c4 --- /dev/null +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts @@ -0,0 +1,78 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Copyright (c) 2021 Facebook Inc. + +/dts-v1/; + +#include "ast2600-facebook-netbmc-common.dtsi" + +/ { + model = "Facebook Darwin BMC"; + compatible = "facebook,darwin-bmc", "aspeed,ast2600"; + + aliases { + serial0 = &uart5; + serial1 = &uart1; + serial2 = &uart2; + serial3 = &uart3; + }; + + chosen { + stdout-path = &uart5; + }; + + iio-hwmon { + compatible = "iio-hwmon"; + io-channels = <&adc0 0>, <&adc0 1>, <&adc0 2>, <&adc0 3>, + <&adc0 4>, <&adc0 5>, <&adc0 6>, <&adc0 7>, + <&adc1 0>, <&adc1 1>, <&adc1 2>, <&adc1 3>, + <&adc1 4>, <&adc1 5>, <&adc1 6>, <&adc1 7>; + }; + + spi_gpio: spi { + num-chipselects = <1>; + cs-gpios = <&gpio0 ASPEED_GPIO(X, 0) GPIO_ACTIVE_LOW>; + }; +}; + +&fmc { + flash at 0 { +#include "facebook-bmc-flash-layout-128.dtsi" + }; +}; + +&i2c0 { + eeprom at 50 { + compatible = "atmel,24c512"; + reg = <0x50>; + }; +}; + +&adc0 { + status = "okay"; + + pinctrl-0 = <&pinctrl_adc0_default &pinctrl_adc1_default + &pinctrl_adc2_default &pinctrl_adc3_default + &pinctrl_adc4_default &pinctrl_adc5_default + &pinctrl_adc6_default &pinctrl_adc7_default>; +}; + +&adc1 { + status = "okay"; + + pinctrl-0 = <&pinctrl_adc8_default &pinctrl_adc9_default + &pinctrl_adc10_default &pinctrl_adc11_default + &pinctrl_adc12_default &pinctrl_adc13_default + &pinctrl_adc14_default &pinctrl_adc15_default>; +}; + +&emmc_controller { + status = "okay"; +}; + +&emmc { + status = "okay"; + + non-removable; + max-frequency = <25000000>; + bus-width = <4>; +}; -- 2.47.1 From rentao.bupt at gmail.com Sun Jul 6 14:37:14 2025 From: rentao.bupt at gmail.com (Tao Ren) Date: Sat, 5 Jul 2025 21:37:14 -0700 Subject: [PATCH v2 0/9] ARM: dts: aspeed: Add Meta Darwin dts In-Reply-To: <20250706042404.138128-1-rentao.bupt@gmail.com> References: <20250706042404.138128-1-rentao.bupt@gmail.com> Message-ID: On Sat, Jul 05, 2025 at 09:23:50PM -0700, rentao.bupt at gmail.com wrote: > From: Tao Ren > > The patch series introduces the initial device tree for Meta/Facebook > Darwin AST2600 BMC. > > Patches #1, #2 and #3 fixes the DTB warnings in wedge400/fuji dts and > ast2600-facebook-netbmc-common.dtsi. > > Patches #4, #5 and #6 introduces a new BMC flash layout to be used by > wedge400 and fuji (and later more Meta Network BMC platforms). > > Patch #7 moves eMMC entries from ast2600-facebook-netbmc-common.dtsi to > each BMC platform because eMMC was removed from future Meta Network BMC > platforms. > > Patches #8 and #9 adds Meta Darwin BMC and updates devicetree bindings. Hi Krzysztof and Andrew, I've fixed all the "checkpatch.pl --strict" warnings except the "new file" warning, and I guess I can ignore the warning? Regarding the dtb warnings, I've fixed the warnings from the individual dts files, but there are still some warnings from aspeed-g6.dtsi. Are these "known" warnings? Or is it because I'm using out-of-dated dtschema (2025.6.1)? Please suggest. Thank you very much for the review and feedback. Cheers, Tao From krzk at kernel.org Sun Jul 6 17:24:04 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Sun, 6 Jul 2025 09:24:04 +0200 Subject: [PATCH v2 8/9] dt-bindings: arm: aspeed: add Facebook Darwin board In-Reply-To: <20250706042404.138128-9-rentao.bupt@gmail.com> References: <20250706042404.138128-1-rentao.bupt@gmail.com> <20250706042404.138128-9-rentao.bupt@gmail.com> Message-ID: On 06/07/2025 06:23, rentao.bupt at gmail.com wrote: > From: Tao Ren > > Document the new compatibles used on Meta/Facebook Darwin board. > > Signed-off-by: Tao Ren > --- Acked-by: Krzysztof Kozlowski ---
This is an automated instruction, just in case, because many review tags are being ignored. If you know the process, you can skip it (please do not feel offended by me posting it here - no bad intentions intended). If you do not know the process, here is a short explanation: Please add Acked-by/Reviewed-by/Tested-by tags when posting new versions of patchset, under or above your Signed-off-by tag, unless patch changed significantly (e.g. new properties added to the DT bindings). Tag is "received", when provided in a message replied to you on the mailing list. Tools like b4 can help here. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for tags received on the version they apply. Full context and explanation: https://elixir.bootlin.com/linux/v6.12-rc3/source/Documentation/process/submitting-patches.rst#L577
Best regards, Krzysztof From ryan_chen at aspeedtech.com Mon Jul 7 11:18:23 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Mon, 7 Jul 2025 09:18:23 +0800 Subject: [PATCH v11 0/3] Add support for AST2700 clk driver Message-ID: <20250707011826.3719229-1-ryan_chen@aspeedtech.com> This patch series is add clk driver for AST2700. AST2700 is the 8th generation of Integrated Remote Management Processor introduced by ASPEED Technology Inc. Which is Board Management controller (BMC) SoC family. AST2700 have two SoC connected, one is SoC0, another is SoC1, it has it's own scu, this driver inlcude SCU0 and SCU1 driver. v11: -update patch(1/3) commit message subject prefix dt-binding: to dt-bindings: v10: -aspeed,ast2700-scu.h: -add SOC0_CLK_AHBMUX, SOC0_CLK_MPHYSRC, SOC0_CLK_U2PHY_REFCLKSRC, SOC1_CLK_I3C. -clk-ast2700.c -add #include -remove #include -use devm_auxiliary_device_create replace aspeed_reset_controller_register -reset-aspeed.c: -remove aspeed_reset_unregister_adev, aspeed_reset_adev_release, aspeed_reset_controller_register. -compatible name change reset_aspeed.reset0/1 -> clk_ast2700.reset0/1 -remove reset-aspeed.h v9: -aspeed,ast2700-scu.h: no change. add more clear commit description. -clk-ast2700.c: add inlcude bitfield.h remove redundant clk_parent_data soc0_mpll_div8/soc0_ahb/uart13clk/ uart14clk/uart15clk/uart16clk/soc1_ahb/d_clk_sels v8: -aspeed,ast2700-scu.h: remove no use soc0 clock, add new clock -clk-ast2700.c: remove include , include , include -clk-ast2700.c: add include -clk-ast2700.c: modify include order before dt-bindings -clk-ast2700.c: modify define to be tabbed out space -clk-ast2700.c: add union struct for each clk type union { struct ast2700_clk_fixed_factor_data factor; struct ast2700_clk_fixed_rate_data rate; struct ast2700_clk_gate_data gate; struct ast2700_clk_div_data div; struct ast2700_clk_pll_data pll; struct ast2700_clk_mux_data mux; } data; -clk-ast2700.c: modify clk_data = device_get_match_data(dev); -clk-ast2700.c: modify builtin_platform_driver_probe to arch_initcall(clk_ast2700_init) -clk-ast2700.c: ast2700_clk_hw_register_hpll explain: scu010[4:2], scu010[4:2] = 010, hpll force 1.8Ghz scu010[4:2] = 011, hpll force 1.7Ghz scu010[4:2] = 110, hpll force 1.2Ghz scu010[4:2] = 111, hpll force 800Mhz others depend on hpll parameter register setting. v7: -reset-aspeed.h: fix declare static inline aspeed_reset_controller_register if the function is not used. v6: -patch-2: add reset-aspeed.h -reset-aspeed: add include cleanup.h for guard() -reset-aspeed: change ids name clk_aspeed to reset_aspeed -reset-aspeed: move aspeed_reset_controller_register, aspeed_reset_adev_release, aspeed_reset_unregister_adev from clk-ast2700.c -reset-aspeed: drop base check, since it check in clk-ast2700.c -clk-ast2700: sync each gate name from *clk to *clk-gate name. -clk-ast2700: add CLK_GATE_ASPEED to diff clk_hw_register_gate and ast2700_clk_hw_register_gate. v5: -patch-2 Kconfig: add select AUXILIARY_BUS -reset-aspeed: #define to_aspeed_reset(p) turn into static inline function. -reset-aspeed: modify spin_lock_irqsave to guard(spinlock_irqsave) -reset-aspeed: remove unnecessary parentheses. -clk-ast2700: use and refrain from define clk v4: -yaml: keep size-cells=<1>. -merge clk,reset dt binding header with yaml the same patch. -rename clk,reset dt binding header to aspeed,ast2700-scu.h -reset-aspeed: update tables tabs sapces to consistent spaces. -reset-aspeed: remove no use dev_set_drvdata. -clk-ast2700: modify reset_name to const int scu in struct clk_data. -clk-ast2700: use scu number in clk_data generate reset_name for reset driver register. -clk-ast2700: fix pll number mix up scu0,scu1. -clk-ast2700: update dt-binding clock include file. v3: -yaml: v2 missing send yaml patch, v3 add. -yaml: drop 64bits address example. -yaml: add discription about soc0 and soc1 -dt-bindings: remove (), *_NUMS, reserved. -dt-bindings: remove dulipated define number. -dt-bindings: merge clk and reset to be one patch. -reset-aspeed: add auxiliary device for reset driver. -clk-ast2700: modify reset to be auxiliary add. -clk-ast2700: modify to be platform driver. -clk-ast2700: modify each clk to const clk array. v2: -yaml: drop 64bits address example. -yaml: add discription about soc0 and soc1 -dt-bindings: remove (), *_NUMS, reserved. -dt-bindings: remove dulipated define number -clk-ast2700: drop WARN_ON, weird comment. Ryan Chen (3): dt-bindings: clock: ast2700: modify soc0/1 clock define reset: aspeed: register AST2700 reset auxiliary bus device clk: aspeed: add AST2700 clock driver drivers/clk/Kconfig | 8 + drivers/clk/Makefile | 1 + drivers/clk/clk-ast2700.c | 1138 +++++++++++++++++ drivers/reset/Kconfig | 7 + drivers/reset/Makefile | 1 + drivers/reset/reset-aspeed.c | 253 ++++ .../dt-bindings/clock/aspeed,ast2700-scu.h | 4 + 7 files changed, 1412 insertions(+) create mode 100644 drivers/clk/clk-ast2700.c create mode 100644 drivers/reset/reset-aspeed.c -- 2.34.1 From ryan_chen at aspeedtech.com Mon Jul 7 11:18:24 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Mon, 7 Jul 2025 09:18:24 +0800 Subject: [PATCH v11 1/3] dt-bindings: clock: ast2700: modify soc0/1 clock define In-Reply-To: <20250707011826.3719229-1-ryan_chen@aspeedtech.com> References: <20250707011826.3719229-1-ryan_chen@aspeedtech.com> Message-ID: <20250707011826.3719229-2-ryan_chen@aspeedtech.com> -add SOC0_CLK_AHBMUX: add SOC0_CLK_AHBMUX for ahb clock source divide. mpll-> ahb_mux -> div_table -> clk_ahb hpll-> -new add clock: SOC0_CLK_MPHYSRC: UFS MPHY clock source. SOC0_CLK_U2PHY_REFCLKSRC: USB2.0 phy clock reference source. SOC1_CLK_I3C: I3C clock source. Signed-off-by: Ryan Chen Acked-by:Krzysztof Kozlowski --- include/dt-bindings/clock/aspeed,ast2700-scu.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/dt-bindings/clock/aspeed,ast2700-scu.h b/include/dt-bindings/clock/aspeed,ast2700-scu.h index 63021af3caf5..bacf712e8e04 100644 --- a/include/dt-bindings/clock/aspeed,ast2700-scu.h +++ b/include/dt-bindings/clock/aspeed,ast2700-scu.h @@ -68,6 +68,9 @@ #define SCU0_CLK_GATE_UFSCLK 53 #define SCU0_CLK_GATE_EMMCCLK 54 #define SCU0_CLK_GATE_RVAS1CLK 55 +#define SCU0_CLK_U2PHY_REFCLKSRC 56 +#define SCU0_CLK_AHBMUX 57 +#define SCU0_CLK_MPHYSRC 58 /* SOC1 clk */ #define SCU1_CLKIN 0 @@ -159,5 +162,6 @@ #define SCU1_CLK_GATE_PORTCUSB2CLK 84 #define SCU1_CLK_GATE_PORTDUSB2CLK 85 #define SCU1_CLK_GATE_LTPI1TXCLK 86 +#define SCU1_CLK_I3C 87 #endif -- 2.34.1 From ryan_chen at aspeedtech.com Mon Jul 7 11:18:25 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Mon, 7 Jul 2025 09:18:25 +0800 Subject: [PATCH v11 2/3] reset: aspeed: register AST2700 reset auxiliary bus device In-Reply-To: <20250707011826.3719229-1-ryan_chen@aspeedtech.com> References: <20250707011826.3719229-1-ryan_chen@aspeedtech.com> Message-ID: <20250707011826.3719229-3-ryan_chen@aspeedtech.com> The AST2700 reset driver is registered as an auxiliary device due to reset and clock controller share the same register region. Signed-off-by: Ryan Chen Reviewed-by: Philipp Zabel --- drivers/reset/Kconfig | 7 + drivers/reset/Makefile | 1 + drivers/reset/reset-aspeed.c | 253 +++++++++++++++++++++++++++++++++++ 3 files changed, 261 insertions(+) create mode 100644 drivers/reset/reset-aspeed.c diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index d85be5899da6..76918f714eff 100644 --- a/drivers/reset/Kconfig +++ b/drivers/reset/Kconfig @@ -22,6 +22,13 @@ config RESET_A10SR This option enables support for the external reset functions for peripheral PHYs on the Altera Arria10 System Resource Chip. +config RESET_ASPEED + tristate "ASPEED Reset Driver" + depends on ARCH_ASPEED || COMPILE_TEST + select AUXILIARY_BUS + help + This enables the reset controller driver for AST2700. + config RESET_ATH79 bool "AR71xx Reset Driver" if COMPILE_TEST default ATH79 diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile index 91e6348e3351..3c40a4e44f6b 100644 --- a/drivers/reset/Makefile +++ b/drivers/reset/Makefile @@ -6,6 +6,7 @@ obj-y += starfive/ obj-y += sti/ obj-y += tegra/ obj-$(CONFIG_RESET_A10SR) += reset-a10sr.o +obj-$(CONFIG_RESET_ASPEED) += reset-aspeed.o obj-$(CONFIG_RESET_ATH79) += reset-ath79.o obj-$(CONFIG_RESET_AXS10X) += reset-axs10x.o obj-$(CONFIG_RESET_BCM6345) += reset-bcm6345.o diff --git a/drivers/reset/reset-aspeed.c b/drivers/reset/reset-aspeed.c new file mode 100644 index 000000000000..dd2f860a69d7 --- /dev/null +++ b/drivers/reset/reset-aspeed.c @@ -0,0 +1,253 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2024 ASPEED Technology Inc. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#define SCU0_RESET_CTRL1 0x200 +#define SCU0_RESET_CTRL2 0x220 +#define SCU1_RESET_CTRL1 0x200 +#define SCU1_RESET_CTRL2 0x220 +#define SCU1_PCIE3_CTRL 0x908 + +struct ast2700_reset_signal { + bool dedicated_clr; /* dedicated reset clr offset */ + u32 offset, bit; +}; + +struct aspeed_reset_info { + unsigned int nr_resets; + const struct ast2700_reset_signal *signal; +}; + +struct aspeed_reset { + struct reset_controller_dev rcdev; + struct aspeed_reset_info *info; + spinlock_t lock; /* Protect read-modify-write cycle */ + void __iomem *base; +}; + +static const struct ast2700_reset_signal ast2700_reset0_signals[] = { + [SCU0_RESET_SDRAM] = { true, SCU0_RESET_CTRL1, BIT(0) }, + [SCU0_RESET_DDRPHY] = { true, SCU0_RESET_CTRL1, BIT(1) }, + [SCU0_RESET_RSA] = { true, SCU0_RESET_CTRL1, BIT(2) }, + [SCU0_RESET_SHA3] = { true, SCU0_RESET_CTRL1, BIT(3) }, + [SCU0_RESET_HACE] = { true, SCU0_RESET_CTRL1, BIT(4) }, + [SCU0_RESET_SOC] = { true, SCU0_RESET_CTRL1, BIT(5) }, + [SCU0_RESET_VIDEO] = { true, SCU0_RESET_CTRL1, BIT(6) }, + [SCU0_RESET_2D] = { true, SCU0_RESET_CTRL1, BIT(7) }, + [SCU0_RESET_PCIS] = { true, SCU0_RESET_CTRL1, BIT(8) }, + [SCU0_RESET_RVAS0] = { true, SCU0_RESET_CTRL1, BIT(9) }, + [SCU0_RESET_RVAS1] = { true, SCU0_RESET_CTRL1, BIT(10) }, + [SCU0_RESET_SM3] = { true, SCU0_RESET_CTRL1, BIT(11) }, + [SCU0_RESET_SM4] = { true, SCU0_RESET_CTRL1, BIT(12) }, + [SCU0_RESET_CRT0] = { true, SCU0_RESET_CTRL1, BIT(13) }, + [SCU0_RESET_ECC] = { true, SCU0_RESET_CTRL1, BIT(14) }, + [SCU0_RESET_DP_PCI] = { true, SCU0_RESET_CTRL1, BIT(15) }, + [SCU0_RESET_UFS] = { true, SCU0_RESET_CTRL1, BIT(16) }, + [SCU0_RESET_EMMC] = { true, SCU0_RESET_CTRL1, BIT(17) }, + [SCU0_RESET_PCIE1RST] = { true, SCU0_RESET_CTRL1, BIT(18) }, + [SCU0_RESET_PCIE1RSTOE] = { true, SCU0_RESET_CTRL1, BIT(19) }, + [SCU0_RESET_PCIE0RST] = { true, SCU0_RESET_CTRL1, BIT(20) }, + [SCU0_RESET_PCIE0RSTOE] = { true, SCU0_RESET_CTRL1, BIT(21) }, + [SCU0_RESET_JTAG] = { true, SCU0_RESET_CTRL1, BIT(22) }, + [SCU0_RESET_MCTP0] = { true, SCU0_RESET_CTRL1, BIT(23) }, + [SCU0_RESET_MCTP1] = { true, SCU0_RESET_CTRL1, BIT(24) }, + [SCU0_RESET_XDMA0] = { true, SCU0_RESET_CTRL1, BIT(25) }, + [SCU0_RESET_XDMA1] = { true, SCU0_RESET_CTRL1, BIT(26) }, + [SCU0_RESET_H2X1] = { true, SCU0_RESET_CTRL1, BIT(27) }, + [SCU0_RESET_DP] = { true, SCU0_RESET_CTRL1, BIT(28) }, + [SCU0_RESET_DP_MCU] = { true, SCU0_RESET_CTRL1, BIT(29) }, + [SCU0_RESET_SSP] = { true, SCU0_RESET_CTRL1, BIT(30) }, + [SCU0_RESET_H2X0] = { true, SCU0_RESET_CTRL1, BIT(31) }, + [SCU0_RESET_PORTA_VHUB] = { true, SCU0_RESET_CTRL2, BIT(0) }, + [SCU0_RESET_PORTA_PHY3] = { true, SCU0_RESET_CTRL2, BIT(1) }, + [SCU0_RESET_PORTA_XHCI] = { true, SCU0_RESET_CTRL2, BIT(2) }, + [SCU0_RESET_PORTB_VHUB] = { true, SCU0_RESET_CTRL2, BIT(3) }, + [SCU0_RESET_PORTB_PHY3] = { true, SCU0_RESET_CTRL2, BIT(4) }, + [SCU0_RESET_PORTB_XHCI] = { true, SCU0_RESET_CTRL2, BIT(5) }, + [SCU0_RESET_PORTA_VHUB_EHCI] = { true, SCU0_RESET_CTRL2, BIT(6) }, + [SCU0_RESET_PORTB_VHUB_EHCI] = { true, SCU0_RESET_CTRL2, BIT(7) }, + [SCU0_RESET_UHCI] = { true, SCU0_RESET_CTRL2, BIT(8) }, + [SCU0_RESET_TSP] = { true, SCU0_RESET_CTRL2, BIT(9) }, + [SCU0_RESET_E2M0] = { true, SCU0_RESET_CTRL2, BIT(10) }, + [SCU0_RESET_E2M1] = { true, SCU0_RESET_CTRL2, BIT(11) }, + [SCU0_RESET_VLINK] = { true, SCU0_RESET_CTRL2, BIT(12) }, +}; + +static const struct ast2700_reset_signal ast2700_reset1_signals[] = { + [SCU1_RESET_LPC0] = { true, SCU1_RESET_CTRL1, BIT(0) }, + [SCU1_RESET_LPC1] = { true, SCU1_RESET_CTRL1, BIT(1) }, + [SCU1_RESET_MII] = { true, SCU1_RESET_CTRL1, BIT(2) }, + [SCU1_RESET_PECI] = { true, SCU1_RESET_CTRL1, BIT(3) }, + [SCU1_RESET_PWM] = { true, SCU1_RESET_CTRL1, BIT(4) }, + [SCU1_RESET_MAC0] = { true, SCU1_RESET_CTRL1, BIT(5) }, + [SCU1_RESET_MAC1] = { true, SCU1_RESET_CTRL1, BIT(6) }, + [SCU1_RESET_MAC2] = { true, SCU1_RESET_CTRL1, BIT(7) }, + [SCU1_RESET_ADC] = { true, SCU1_RESET_CTRL1, BIT(8) }, + [SCU1_RESET_SD] = { true, SCU1_RESET_CTRL1, BIT(9) }, + [SCU1_RESET_ESPI0] = { true, SCU1_RESET_CTRL1, BIT(10) }, + [SCU1_RESET_ESPI1] = { true, SCU1_RESET_CTRL1, BIT(11) }, + [SCU1_RESET_JTAG1] = { true, SCU1_RESET_CTRL1, BIT(12) }, + [SCU1_RESET_SPI0] = { true, SCU1_RESET_CTRL1, BIT(13) }, + [SCU1_RESET_SPI1] = { true, SCU1_RESET_CTRL1, BIT(14) }, + [SCU1_RESET_SPI2] = { true, SCU1_RESET_CTRL1, BIT(15) }, + [SCU1_RESET_I3C0] = { true, SCU1_RESET_CTRL1, BIT(16) }, + [SCU1_RESET_I3C1] = { true, SCU1_RESET_CTRL1, BIT(17) }, + [SCU1_RESET_I3C2] = { true, SCU1_RESET_CTRL1, BIT(18) }, + [SCU1_RESET_I3C3] = { true, SCU1_RESET_CTRL1, BIT(19) }, + [SCU1_RESET_I3C4] = { true, SCU1_RESET_CTRL1, BIT(20) }, + [SCU1_RESET_I3C5] = { true, SCU1_RESET_CTRL1, BIT(21) }, + [SCU1_RESET_I3C6] = { true, SCU1_RESET_CTRL1, BIT(22) }, + [SCU1_RESET_I3C7] = { true, SCU1_RESET_CTRL1, BIT(23) }, + [SCU1_RESET_I3C8] = { true, SCU1_RESET_CTRL1, BIT(24) }, + [SCU1_RESET_I3C9] = { true, SCU1_RESET_CTRL1, BIT(25) }, + [SCU1_RESET_I3C10] = { true, SCU1_RESET_CTRL1, BIT(26) }, + [SCU1_RESET_I3C11] = { true, SCU1_RESET_CTRL1, BIT(27) }, + [SCU1_RESET_I3C12] = { true, SCU1_RESET_CTRL1, BIT(28) }, + [SCU1_RESET_I3C13] = { true, SCU1_RESET_CTRL1, BIT(29) }, + [SCU1_RESET_I3C14] = { true, SCU1_RESET_CTRL1, BIT(30) }, + [SCU1_RESET_I3C15] = { true, SCU1_RESET_CTRL1, BIT(31) }, + [SCU1_RESET_MCU0] = { true, SCU1_RESET_CTRL2, BIT(0) }, + [SCU1_RESET_MCU1] = { true, SCU1_RESET_CTRL2, BIT(1) }, + [SCU1_RESET_H2A_SPI1] = { true, SCU1_RESET_CTRL2, BIT(2) }, + [SCU1_RESET_H2A_SPI2] = { true, SCU1_RESET_CTRL2, BIT(3) }, + [SCU1_RESET_UART0] = { true, SCU1_RESET_CTRL2, BIT(4) }, + [SCU1_RESET_UART1] = { true, SCU1_RESET_CTRL2, BIT(5) }, + [SCU1_RESET_UART2] = { true, SCU1_RESET_CTRL2, BIT(6) }, + [SCU1_RESET_UART3] = { true, SCU1_RESET_CTRL2, BIT(7) }, + [SCU1_RESET_I2C_FILTER] = { true, SCU1_RESET_CTRL2, BIT(8) }, + [SCU1_RESET_CALIPTRA] = { true, SCU1_RESET_CTRL2, BIT(9) }, + [SCU1_RESET_XDMA] = { true, SCU1_RESET_CTRL2, BIT(10) }, + [SCU1_RESET_FSI] = { true, SCU1_RESET_CTRL2, BIT(12) }, + [SCU1_RESET_CAN] = { true, SCU1_RESET_CTRL2, BIT(13) }, + [SCU1_RESET_MCTP] = { true, SCU1_RESET_CTRL2, BIT(14) }, + [SCU1_RESET_I2C] = { true, SCU1_RESET_CTRL2, BIT(15) }, + [SCU1_RESET_UART6] = { true, SCU1_RESET_CTRL2, BIT(16) }, + [SCU1_RESET_UART7] = { true, SCU1_RESET_CTRL2, BIT(17) }, + [SCU1_RESET_UART8] = { true, SCU1_RESET_CTRL2, BIT(18) }, + [SCU1_RESET_UART9] = { true, SCU1_RESET_CTRL2, BIT(19) }, + [SCU1_RESET_LTPI0] = { true, SCU1_RESET_CTRL2, BIT(20) }, + [SCU1_RESET_VGAL] = { true, SCU1_RESET_CTRL2, BIT(21) }, + [SCU1_RESET_LTPI1] = { true, SCU1_RESET_CTRL2, BIT(22) }, + [SCU1_RESET_ACE] = { true, SCU1_RESET_CTRL2, BIT(23) }, + [SCU1_RESET_E2M] = { true, SCU1_RESET_CTRL2, BIT(24) }, + [SCU1_RESET_UHCI] = { true, SCU1_RESET_CTRL2, BIT(25) }, + [SCU1_RESET_PORTC_USB2UART] = { true, SCU1_RESET_CTRL2, BIT(26) }, + [SCU1_RESET_PORTC_VHUB_EHCI] = { true, SCU1_RESET_CTRL2, BIT(27) }, + [SCU1_RESET_PORTD_USB2UART] = { true, SCU1_RESET_CTRL2, BIT(28) }, + [SCU1_RESET_PORTD_VHUB_EHCI] = { true, SCU1_RESET_CTRL2, BIT(29) }, + [SCU1_RESET_H2X] = { true, SCU1_RESET_CTRL2, BIT(30) }, + [SCU1_RESET_I3CDMA] = { true, SCU1_RESET_CTRL2, BIT(31) }, + [SCU1_RESET_PCIE2RST] = { false, SCU1_PCIE3_CTRL, BIT(0) }, +}; + +static inline struct aspeed_reset *to_aspeed_reset(struct reset_controller_dev *rcdev) +{ + return container_of(rcdev, struct aspeed_reset, rcdev); +} + +static int aspeed_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) +{ + struct aspeed_reset *rc = to_aspeed_reset(rcdev); + void __iomem *reg_offset = rc->base + rc->info->signal[id].offset; + + if (rc->info->signal[id].dedicated_clr) { + writel(rc->info->signal[id].bit, reg_offset); + } else { + guard(spinlock_irqsave)(&rc->lock); + writel(readl(reg_offset) & ~rc->info->signal[id].bit, reg_offset); + } + + return 0; +} + +static int aspeed_reset_deassert(struct reset_controller_dev *rcdev, unsigned long id) +{ + struct aspeed_reset *rc = to_aspeed_reset(rcdev); + void __iomem *reg_offset = rc->base + rc->info->signal[id].offset; + + if (rc->info->signal[id].dedicated_clr) { + writel(rc->info->signal[id].bit, reg_offset + 0x04); + } else { + guard(spinlock_irqsave)(&rc->lock); + writel(readl(reg_offset) | rc->info->signal[id].bit, reg_offset); + } + + return 0; +} + +static int aspeed_reset_status(struct reset_controller_dev *rcdev, unsigned long id) +{ + struct aspeed_reset *rc = to_aspeed_reset(rcdev); + void __iomem *reg_offset = rc->base + rc->info->signal[id].offset; + + return (readl(reg_offset) & rc->info->signal[id].bit) ? 1 : 0; +} + +static const struct reset_control_ops aspeed_reset_ops = { + .assert = aspeed_reset_assert, + .deassert = aspeed_reset_deassert, + .status = aspeed_reset_status, +}; + +static int aspeed_reset_probe(struct auxiliary_device *adev, + const struct auxiliary_device_id *id) +{ + struct aspeed_reset *reset; + struct device *dev = &adev->dev; + + reset = devm_kzalloc(dev, sizeof(*reset), GFP_KERNEL); + if (!reset) + return -ENOMEM; + + spin_lock_init(&reset->lock); + + reset->info = (struct aspeed_reset_info *)id->driver_data; + reset->rcdev.owner = THIS_MODULE; + reset->rcdev.nr_resets = reset->info->nr_resets; + reset->rcdev.ops = &aspeed_reset_ops; + reset->rcdev.of_node = dev->parent->of_node; + reset->rcdev.dev = dev; + reset->rcdev.of_reset_n_cells = 1; + reset->base = (void __iomem *)adev->dev.platform_data; + + return devm_reset_controller_register(dev, &reset->rcdev); +} + +static const struct aspeed_reset_info ast2700_reset0_info = { + .nr_resets = ARRAY_SIZE(ast2700_reset0_signals), + .signal = ast2700_reset0_signals, +}; + +static const struct aspeed_reset_info ast2700_reset1_info = { + .nr_resets = ARRAY_SIZE(ast2700_reset1_signals), + .signal = ast2700_reset1_signals, +}; + +static const struct auxiliary_device_id aspeed_reset_ids[] = { + { .name = "clk_ast2700.reset0", .driver_data = (kernel_ulong_t)&ast2700_reset0_info }, + { .name = "clk_ast2700.reset1", .driver_data = (kernel_ulong_t)&ast2700_reset1_info }, + { } +}; +MODULE_DEVICE_TABLE(auxiliary, aspeed_reset_ids); + +static struct auxiliary_driver aspeed_reset_driver = { + .probe = aspeed_reset_probe, + .id_table = aspeed_reset_ids, +}; + +module_auxiliary_driver(aspeed_reset_driver); + +MODULE_AUTHOR("Ryan Chen "); +MODULE_DESCRIPTION("ASPEED SoC Reset Controller Driver"); +MODULE_LICENSE("GPL"); -- 2.34.1 From ryan_chen at aspeedtech.com Mon Jul 7 11:18:26 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Mon, 7 Jul 2025 09:18:26 +0800 Subject: [PATCH v11 3/3] clk: aspeed: add AST2700 clock driver In-Reply-To: <20250707011826.3719229-1-ryan_chen@aspeedtech.com> References: <20250707011826.3719229-1-ryan_chen@aspeedtech.com> Message-ID: <20250707011826.3719229-4-ryan_chen@aspeedtech.com> Add AST2700 clock controller driver and also use axiliary device framework register the reset controller driver. Due to clock and reset using the same register region. Signed-off-by: Ryan Chen --- drivers/clk/Kconfig | 8 + drivers/clk/Makefile | 1 + drivers/clk/clk-ast2700.c | 1138 +++++++++++++++++++++++++++++++++++++ 3 files changed, 1147 insertions(+) create mode 100644 drivers/clk/clk-ast2700.c diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index 19c1ed280fd7..10b67370f65d 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -288,6 +288,14 @@ config COMMON_CLK_ASPEED The G4 and G5 series, including the ast2400 and ast2500, are supported by this driver. +config COMMON_CLK_AST2700 + bool "Clock driver for AST2700 SoC" + depends on ARCH_ASPEED || COMPILE_TEST + help + This driver provides support for clock on AST2700 SoC. + The driver is responsible for managing the various clocks required + by the peripherals and cores within the AST2700. + config COMMON_CLK_S2MPS11 tristate "Clock driver for S2MPS1X/S5M8767 MFD" depends on MFD_SEC_CORE || COMPILE_TEST diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index 42867cd37c33..3d911b81149c 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile @@ -63,6 +63,7 @@ obj-$(CONFIG_COMMON_CLK_FSL_SAI) += clk-fsl-sai.o obj-$(CONFIG_COMMON_CLK_GEMINI) += clk-gemini.o obj-$(CONFIG_COMMON_CLK_ASPEED) += clk-aspeed.o obj-$(CONFIG_MACH_ASPEED_G6) += clk-ast2600.o +obj-$(CONFIG_COMMON_CLK_AST2700) += clk-ast2700.o obj-$(CONFIG_ARCH_HIGHBANK) += clk-highbank.o obj-$(CONFIG_CLK_HSDK) += clk-hsdk-pll.o obj-$(CONFIG_COMMON_CLK_K210) += clk-k210.o diff --git a/drivers/clk/clk-ast2700.c b/drivers/clk/clk-ast2700.c new file mode 100644 index 000000000000..c6d77e3f4ace --- /dev/null +++ b/drivers/clk/clk-ast2700.c @@ -0,0 +1,1138 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2024 ASPEED Technology Inc. + * Author: Ryan Chen + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define SCU_CLK_12MHZ (12 * HZ_PER_MHZ) +#define SCU_CLK_24MHZ (24 * HZ_PER_MHZ) +#define SCU_CLK_25MHZ (25 * HZ_PER_MHZ) +#define SCU_CLK_192MHZ (192 * HZ_PER_MHZ) + +/* SOC0 */ +#define SCU0_HWSTRAP1 0x010 +#define SCU0_CLK_STOP 0x240 +#define SCU0_CLK_SEL1 0x280 +#define SCU0_CLK_SEL2 0x284 +#define GET_USB_REFCLK_DIV(x) ((GENMASK(23, 20) & (x)) >> 20) +#define UART_DIV13_EN BIT(30) +#define SCU0_HPLL_PARAM 0x300 +#define SCU0_DPLL_PARAM 0x308 +#define SCU0_MPLL_PARAM 0x310 +#define SCU0_D0CLK_PARAM 0x320 +#define SCU0_D1CLK_PARAM 0x330 +#define SCU0_CRT0CLK_PARAM 0x340 +#define SCU0_CRT1CLK_PARAM 0x350 +#define SCU0_MPHYCLK_PARAM 0x360 + +/* SOC1 */ +#define SCU1_REVISION_ID 0x0 +#define REVISION_ID GENMASK(23, 16) +#define SCU1_CLK_STOP 0x240 +#define SCU1_CLK_STOP2 0x260 +#define SCU1_CLK_SEL1 0x280 +#define SCU1_CLK_SEL2 0x284 +#define SCU1_CLK_I3C_DIV_MASK GENMASK(25, 23) +#define SCU1_CLK_I3C_DIV(n) ((n) - 1) +#define UXCLK_MASK GENMASK(1, 0) +#define HUXCLK_MASK GENMASK(4, 3) +#define SCU1_HPLL_PARAM 0x300 +#define SCU1_APLL_PARAM 0x310 +#define SCU1_DPLL_PARAM 0x320 +#define SCU1_UXCLK_CTRL 0x330 +#define SCU1_HUXCLK_CTRL 0x334 +#define SCU1_MAC12_CLK_DLY 0x390 +#define SCU1_MAC12_CLK_DLY_100M 0x394 +#define SCU1_MAC12_CLK_DLY_10M 0x398 + +enum ast2700_clk_type { + CLK_MUX, + CLK_PLL, + CLK_HPLL, + CLK_GATE, + CLK_MISC, + CLK_FIXED, + DCLK_FIXED, + CLK_DIVIDER, + CLK_UART_PLL, + CLK_FIXED_FACTOR, + CLK_GATE_ASPEED, +}; + +struct ast2700_clk_fixed_factor_data { + const struct clk_parent_data *parent; + unsigned int mult; + unsigned int div; +}; + +struct ast2700_clk_gate_data { + const struct clk_parent_data *parent; + u32 flags; + u32 reg; + u8 bit; +}; + +struct ast2700_clk_mux_data { + const struct clk_parent_data *parents; + unsigned int num_parents; + u8 bit_shift; + u8 bit_width; + u32 reg; +}; + +struct ast2700_clk_div_data { + const struct clk_div_table *div_table; + const struct clk_parent_data *parent; + u8 bit_shift; + u8 bit_width; + u32 reg; +}; + +struct ast2700_clk_pll_data { + const struct clk_parent_data *parent; + u32 reg; +}; + +struct ast2700_clk_fixed_rate_data { + unsigned long fixed_rate; +}; + +struct ast2700_clk_info { + const char *name; + u8 clk_idx; + u32 reg; + u32 type; + union { + struct ast2700_clk_fixed_factor_data factor; + struct ast2700_clk_fixed_rate_data rate; + struct ast2700_clk_gate_data gate; + struct ast2700_clk_div_data div; + struct ast2700_clk_pll_data pll; + struct ast2700_clk_mux_data mux; + } data; +}; + +struct ast2700_clk_data { + struct ast2700_clk_info const *clk_info; + unsigned int nr_clks; + const int scu; +}; + +struct ast2700_clk_ctrl { + const struct ast2700_clk_data *clk_data; + struct device *dev; + void __iomem *base; + spinlock_t lock; /* clk lock */ +}; + +static const struct clk_div_table ast2700_rgmii_div_table[] = { + { 0x0, 4 }, + { 0x1, 4 }, + { 0x2, 6 }, + { 0x3, 8 }, + { 0x4, 10 }, + { 0x5, 12 }, + { 0x6, 14 }, + { 0x7, 16 }, + { 0 } +}; + +static const struct clk_div_table ast2700_rmii_div_table[] = { + { 0x0, 8 }, + { 0x1, 8 }, + { 0x2, 12 }, + { 0x3, 16 }, + { 0x4, 20 }, + { 0x5, 24 }, + { 0x6, 28 }, + { 0x7, 32 }, + { 0 } +}; + +static const struct clk_div_table ast2700_clk_div_table[] = { + { 0x0, 2 }, + { 0x1, 2 }, + { 0x2, 3 }, + { 0x3, 4 }, + { 0x4, 5 }, + { 0x5, 6 }, + { 0x6, 7 }, + { 0x7, 8 }, + { 0 } +}; + +static const struct clk_div_table ast2700_clk_div_table2[] = { + { 0x0, 2 }, + { 0x1, 4 }, + { 0x2, 6 }, + { 0x3, 8 }, + { 0x4, 10 }, + { 0x5, 12 }, + { 0x6, 14 }, + { 0x7, 16 }, + { 0 } +}; + +static const struct clk_div_table ast2700_hclk_div_table[] = { + { 0x0, 6 }, + { 0x1, 5 }, + { 0x2, 4 }, + { 0x3, 7 }, + { 0 } +}; + +static const struct clk_div_table ast2700_clk_uart_div_table[] = { + { 0x0, 1 }, + { 0x1, 13 }, + { 0 } +}; + +static const struct clk_parent_data soc0_clkin[] = { + { .fw_name = "soc0-clkin", .name = "soc0-clkin" }, +}; + +static const struct clk_parent_data pspclk[] = { + { .fw_name = "pspclk", .name = "pspclk" }, +}; + +static const struct clk_parent_data mphysrc[] = { + { .fw_name = "mphysrc", .name = "mphysrc" }, +}; + +static const struct clk_parent_data u2phy_refclksrc[] = { + { .fw_name = "u2phy_refclksrc", .name = "u2phy_refclksrc" }, +}; + +static const struct clk_parent_data soc0_hpll[] = { + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, +}; + +static const struct clk_parent_data soc0_mpll[] = { + { .fw_name = "soc0-mpll", .name = "soc0-mpll" }, +}; + +static const struct clk_parent_data axi0clk[] = { + { .fw_name = "axi0clk", .name = "axi0clk" }, +}; + +static const struct clk_parent_data soc0_ahbmux[] = { + { .fw_name = "soc0-ahbmux", .name = "soc0-ahbmux" }, +}; + +static const struct clk_parent_data soc0_uartclk[] = { + { .fw_name = "soc0-uartclk", .name = "soc0-uartclk" }, +}; + +static const struct clk_parent_data emmcclk[] = { + { .fw_name = "emmcclk", .name = "emmcclk" }, +}; + +static const struct clk_parent_data emmcsrc_mux[] = { + { .fw_name = "emmcsrc-mux", .name = "emmcsrc-mux" }, +}; + +static const struct clk_parent_data soc1_clkin[] = { + { .fw_name = "soc1-clkin", .name = "soc1-clkin" }, +}; + +static const struct clk_parent_data soc1_hpll[] = { + { .fw_name = "soc1-hpll", .name = "soc1-hpll" }, +}; + +static const struct clk_parent_data soc1_apll[] = { + { .fw_name = "soc1-apll", .name = "soc1-apll" }, +}; + +static const struct clk_parent_data sdclk[] = { + { .fw_name = "sdclk", .name = "sdclk" }, +}; + +static const struct clk_parent_data sdclk_mux[] = { + { .fw_name = "sdclk-mux", .name = "sdclk-mux" }, +}; + +static const struct clk_parent_data huartxclk[] = { + { .fw_name = "huartxclk", .name = "huartxclk" }, +}; + +static const struct clk_parent_data uxclk[] = { + { .fw_name = "uxclk", .name = "uxclk" }, +}; + +static const struct clk_parent_data huxclk[] = { + { .fw_name = "huxclk", .name = "huxclk" }, +}; + +static const struct clk_parent_data uart0clk[] = { + { .fw_name = "uart0clk", .name = "uart0clk" }, +}; + +static const struct clk_parent_data uart1clk[] = { + { .fw_name = "uart1clk", .name = "uart1clk" }, +}; + +static const struct clk_parent_data uart2clk[] = { + { .fw_name = "uart2clk", .name = "uart2clk" }, +}; + +static const struct clk_parent_data uart3clk[] = { + { .fw_name = "uart3clk", .name = "uart3clk" }, +}; + +static const struct clk_parent_data uart5clk[] = { + { .fw_name = "uart5clk", .name = "uart5clk" }, +}; + +static const struct clk_parent_data uart4clk[] = { + { .fw_name = "uart4clk", .name = "uart4clk" }, +}; + +static const struct clk_parent_data uart6clk[] = { + { .fw_name = "uart6clk", .name = "uart6clk" }, +}; + +static const struct clk_parent_data uart7clk[] = { + { .fw_name = "uart7clk", .name = "uart7clk" }, +}; + +static const struct clk_parent_data uart8clk[] = { + { .fw_name = "uart8clk", .name = "uart8clk" }, +}; + +static const struct clk_parent_data uart9clk[] = { + { .fw_name = "uart9clk", .name = "uart9clk" }, +}; + +static const struct clk_parent_data uart10clk[] = { + { .fw_name = "uart10clk", .name = "uart10clk" }, +}; + +static const struct clk_parent_data uart11clk[] = { + { .fw_name = "uart11clk", .name = "uart11clk" }, +}; + +static const struct clk_parent_data uart12clk[] = { + { .fw_name = "uart12clk", .name = "uart12clk" }, +}; + +static const struct clk_parent_data uart13clk[] = { + { .fw_name = "uart13clk", .name = "uart13clk" }, +}; + +static const struct clk_parent_data uart14clk[] = { + { .fw_name = "uart14clk", .name = "uart14clk" }, +}; + +static const struct clk_parent_data soc1_i3c[] = { + { .fw_name = "soc1-i3c", .name = "soc1-i3c" }, +}; + +static const struct clk_parent_data canclk[] = { + { .fw_name = "canclk", .name = "canclk" }, +}; + +static const struct clk_parent_data rmii[] = { + { .fw_name = "rmii", .name = "rmii" }, +}; + +static const struct clk_parent_data hclk_clk_sels[] = { + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, + { .fw_name = "soc0-mpll", .name = "soc0-mpll" }, +}; + +static const struct clk_parent_data mhpll_clk_sels[] = { + { .fw_name = "soc0-mpll", .name = "soc0-mpll" }, + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, +}; + +static const struct clk_parent_data mphy_clk_sels[] = { + { .fw_name = "soc0-mpll", .name = "soc0-mpll" }, + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, + { .fw_name = "soc0-dpll", .name = "soc0-dpll" }, + { .fw_name = "soc0-clk192Mhz", .name = "soc0-clk192Mhz" }, +}; + +static const struct clk_parent_data psp_clk_sels[] = { + { .fw_name = "soc0-mpll", .name = "soc0-mpll" }, + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, + { .fw_name = "soc0-mpll_div2", .name = "soc0-mpll_div2" }, + { .fw_name = "soc0-hpll_div2", .name = "soc0-hpll_div2" }, + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, +}; + +static const struct clk_parent_data uart_clk_sels[] = { + { .fw_name = "soc0-clk24Mhz", .name = "soc0-clk24Mhz" }, + { .fw_name = "soc0-clk192Mhz", .name = "soc0-clk192Mhz" }, +}; + +static const struct clk_parent_data emmc_clk_sels[] = { + { .fw_name = "soc0-mpll_div4", .name = "soc0-mpll_div4" }, + { .fw_name = "soc0-hpll_div4", .name = "soc0-hpll_div4" }, +}; + +static const struct clk_parent_data sdio_clk_sels[] = { + { .fw_name = "soc1-hpll", .name = "soc1-hpll" }, + { .fw_name = "soc1-apll", .name = "soc1-apll" }, +}; + +static const struct clk_parent_data ux_clk_sels[] = { + { .fw_name = "soc1-apll_div4", .name = "soc1-apll_div4" }, + { .fw_name = "soc1-apll_div2", .name = "soc1-apll_div2" }, + { .fw_name = "soc1-apll", .name = "soc1-apll" }, + { .fw_name = "soc1-hpll", .name = "soc1-hpll" }, +}; + +static const struct clk_parent_data uartx_clk_sels[] = { + { .fw_name = "uartxclk", .name = "uartxclk" }, + { .fw_name = "huartxclk", .name = "huartxclk" }, +}; + +#define FIXED_CLK(_id, _name, _rate) \ + [_id] = { \ + .type = CLK_FIXED, \ + .name = _name, \ + .data = { .rate = { .fixed_rate = _rate, } }, \ + } + +#define PLL_CLK(_id, _type, _name, _parent, _reg) \ + [_id] = { \ + .type = _type, \ + .name = _name, \ + .data = { .pll = { .parent = _parent, .reg = _reg, } }, \ + } + +#define MUX_CLK(_id, _name, _parents, _num_parents, _reg, _shift, _width) \ + [_id] = { \ + .type = CLK_MUX, \ + .name = _name, \ + .data = { \ + .mux = { \ + .parents = _parents, \ + .num_parents = _num_parents, \ + .reg = _reg, \ + .bit_shift = _shift, \ + .bit_width = _width, \ + }, \ + }, \ + } + +#define DIVIDER_CLK(_id, _name, _parent, _reg, _shift, _width, _div_table) \ + [_id] = { \ + .type = CLK_DIVIDER, \ + .name = _name, \ + .data = { \ + .div = { \ + .parent = _parent, \ + .reg = _reg, \ + .bit_shift = _shift, \ + .bit_width = _width, \ + .div_table = _div_table, \ + }, \ + }, \ + } + +#define FIXED_FACTOR_CLK(_id, _name, _parent, _mult, _div) \ + [_id] = { \ + .type = CLK_FIXED_FACTOR, \ + .name = _name, \ + .data = { .factor = { .parent = _parent, .mult = _mult, .div = _div, } }, \ + } + +#define GATE_CLK(_id, _type, _name, _parent, _reg, _bit, _flags) \ + [_id] = { \ + .type = _type, \ + .name = _name, \ + .data = { \ + .gate = { \ + .parent = _parent, \ + .reg = _reg, \ + .bit = _bit, \ + .flags = _flags, \ + }, \ + }, \ + } + +static const struct ast2700_clk_info ast2700_scu0_clk_info[] __initconst = { + FIXED_CLK(SCU0_CLKIN, "soc0-clkin", SCU_CLK_25MHZ), + FIXED_CLK(SCU0_CLK_24M, "soc0-clk24Mhz", SCU_CLK_24MHZ), + FIXED_CLK(SCU0_CLK_192M, "soc0-clk192Mhz", SCU_CLK_192MHZ), + FIXED_CLK(SCU0_CLK_U2PHY_CLK12M, "u2phy_clk12m", SCU_CLK_12MHZ), + PLL_CLK(SCU0_CLK_HPLL, CLK_HPLL, "soc0-hpll", soc0_clkin, SCU0_HPLL_PARAM), + PLL_CLK(SCU0_CLK_DPLL, CLK_PLL, "soc0-dpll", soc0_clkin, SCU0_DPLL_PARAM), + PLL_CLK(SCU0_CLK_MPLL, CLK_PLL, "soc0-mpll", soc0_clkin, SCU0_MPLL_PARAM), + PLL_CLK(SCU0_CLK_D0, DCLK_FIXED, "d0clk", NULL, SCU0_D0CLK_PARAM), + PLL_CLK(SCU0_CLK_D1, DCLK_FIXED, "d1clk", NULL, SCU0_D1CLK_PARAM), + PLL_CLK(SCU0_CLK_CRT0, DCLK_FIXED, "crt0clk", NULL, SCU0_CRT0CLK_PARAM), + PLL_CLK(SCU0_CLK_CRT1, DCLK_FIXED, "crt1clk", NULL, SCU0_CRT1CLK_PARAM), + PLL_CLK(SCU0_CLK_MPHY, CLK_MISC, "mphyclk", mphysrc, SCU0_MPHYCLK_PARAM), + PLL_CLK(SCU0_CLK_U2PHY_REFCLK, CLK_MISC, "u2phy_refclk", u2phy_refclksrc, SCU0_CLK_SEL2), + FIXED_FACTOR_CLK(SCU0_CLK_HPLL_DIV2, "soc0-hpll_div2", soc0_hpll, 1, 2), + FIXED_FACTOR_CLK(SCU0_CLK_HPLL_DIV4, "soc0-hpll_div4", soc0_hpll, 1, 4), + FIXED_FACTOR_CLK(SCU0_CLK_MPLL_DIV2, "soc0-mpll_div2", soc0_mpll, 1, 2), + FIXED_FACTOR_CLK(SCU0_CLK_MPLL_DIV4, "soc0-mpll_div4", soc0_mpll, 1, 4), + FIXED_FACTOR_CLK(SCU0_CLK_MPLL_DIV8, "soc0-mpll_div8", soc0_mpll, 1, 8), + FIXED_FACTOR_CLK(SCU0_CLK_AXI0, "axi0clk", pspclk, 1, 2), + FIXED_FACTOR_CLK(SCU0_CLK_AXI1, "axi1clk", soc0_mpll, 1, 4), + DIVIDER_CLK(SCU0_CLK_AHB, "soc0-ahb", soc0_ahbmux, + SCU0_HWSTRAP1, 5, 2, ast2700_hclk_div_table), + DIVIDER_CLK(SCU0_CLK_EMMC, "emmcclk", emmcsrc_mux, + SCU0_CLK_SEL1, 12, 3, ast2700_clk_div_table2), + DIVIDER_CLK(SCU0_CLK_APB, "soc0-apb", axi0clk, + SCU0_CLK_SEL1, 23, 3, ast2700_clk_div_table2), + DIVIDER_CLK(SCU0_CLK_UART4, "uart4clk", soc0_uartclk, + SCU0_CLK_SEL2, 30, 1, ast2700_clk_uart_div_table), + DIVIDER_CLK(SCU0_CLK_HPLL_DIV_AHB, "soc0-hpll-ahb", soc0_hpll, + SCU0_HWSTRAP1, 5, 2, ast2700_hclk_div_table), + DIVIDER_CLK(SCU0_CLK_MPLL_DIV_AHB, "soc0-mpll-ahb", soc0_mpll, + SCU0_HWSTRAP1, 5, 2, ast2700_hclk_div_table), + MUX_CLK(SCU0_CLK_PSP, "pspclk", psp_clk_sels, ARRAY_SIZE(psp_clk_sels), + SCU0_HWSTRAP1, 2, 3), + MUX_CLK(SCU0_CLK_AHBMUX, "soc0-ahbmux", hclk_clk_sels, ARRAY_SIZE(hclk_clk_sels), + SCU0_HWSTRAP1, 7, 1), + MUX_CLK(SCU0_CLK_EMMCMUX, "emmcsrc-mux", emmc_clk_sels, ARRAY_SIZE(emmc_clk_sels), + SCU0_CLK_SEL1, 11, 1), + MUX_CLK(SCU0_CLK_MPHYSRC, "mphysrc", mphy_clk_sels, ARRAY_SIZE(mphy_clk_sels), + SCU0_CLK_SEL2, 18, 2), + MUX_CLK(SCU0_CLK_U2PHY_REFCLKSRC, "u2phy_refclksrc", mhpll_clk_sels, + ARRAY_SIZE(mhpll_clk_sels), SCU0_CLK_SEL2, 23, 1), + MUX_CLK(SCU0_CLK_UART, "soc0-uartclk", uart_clk_sels, ARRAY_SIZE(uart_clk_sels), + SCU0_CLK_SEL2, 14, 1), + GATE_CLK(SCU0_CLK_GATE_MCLK, CLK_GATE_ASPEED, "mclk-gate", soc0_mpll, + SCU0_CLK_STOP, 0, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_ECLK, CLK_GATE_ASPEED, "eclk-gate", NULL, SCU0_CLK_STOP, 1, 0), + GATE_CLK(SCU0_CLK_GATE_2DCLK, CLK_GATE_ASPEED, "gclk-gate", NULL, SCU0_CLK_STOP, 2, 0), + GATE_CLK(SCU0_CLK_GATE_VCLK, CLK_GATE_ASPEED, "vclk-gate", NULL, SCU0_CLK_STOP, 3, 0), + GATE_CLK(SCU0_CLK_GATE_BCLK, CLK_GATE_ASPEED, "bclk-gate", NULL, + SCU0_CLK_STOP, 4, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_VGA0CLK, CLK_GATE_ASPEED, "vga0clk-gate", NULL, + SCU0_CLK_STOP, 5, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_REFCLK, CLK_GATE_ASPEED, "soc0-refclk-gate", soc0_clkin, + SCU0_CLK_STOP, 6, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_PORTBUSB2CLK, CLK_GATE_ASPEED, "portb-usb2clk-gate", NULL, + SCU0_CLK_STOP, 7, 0), + GATE_CLK(SCU0_CLK_GATE_UHCICLK, CLK_GATE_ASPEED, "uhciclk-gate", NULL, SCU0_CLK_STOP, 9, 0), + GATE_CLK(SCU0_CLK_GATE_VGA1CLK, CLK_GATE_ASPEED, "vga1clk-gate", NULL, + SCU0_CLK_STOP, 10, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_DDRPHYCLK, CLK_GATE_ASPEED, "ddrphy-gate", NULL, + SCU0_CLK_STOP, 11, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_E2M0CLK, CLK_GATE_ASPEED, "e2m0clk-gate", NULL, + SCU0_CLK_STOP, 12, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_HACCLK, CLK_GATE_ASPEED, "hacclk-gate", NULL, SCU0_CLK_STOP, 13, 0), + GATE_CLK(SCU0_CLK_GATE_PORTAUSB2CLK, CLK_GATE_ASPEED, "porta-usb2clk-gate", NULL, + SCU0_CLK_STOP, 14, 0), + GATE_CLK(SCU0_CLK_GATE_UART4CLK, CLK_GATE_ASPEED, "uart4clk-gate", uart4clk, + SCU0_CLK_STOP, 15, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_SLICLK, CLK_GATE_ASPEED, "soc0-sliclk-gate", NULL, + SCU0_CLK_STOP, 16, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_DACCLK, CLK_GATE_ASPEED, "dacclk-gate", NULL, + SCU0_CLK_STOP, 17, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_DP, CLK_GATE_ASPEED, "dpclk-gate", NULL, + SCU0_CLK_STOP, 18, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_E2M1CLK, CLK_GATE_ASPEED, "e2m1clk-gate", NULL, + SCU0_CLK_STOP, 19, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_CRT0CLK, CLK_GATE_ASPEED, "crt0clk-gate", NULL, + SCU0_CLK_STOP, 20, 0), + GATE_CLK(SCU0_CLK_GATE_CRT1CLK, CLK_GATE_ASPEED, "crt1clk-gate", NULL, + SCU0_CLK_STOP, 21, 0), + GATE_CLK(SCU0_CLK_GATE_ECDSACLK, CLK_GATE_ASPEED, "eccclk-gate", NULL, + SCU0_CLK_STOP, 23, 0), + GATE_CLK(SCU0_CLK_GATE_RSACLK, CLK_GATE_ASPEED, "rsaclk-gate", NULL, + SCU0_CLK_STOP, 24, 0), + GATE_CLK(SCU0_CLK_GATE_RVAS0CLK, CLK_GATE_ASPEED, "rvas0clk-gate", NULL, + SCU0_CLK_STOP, 25, 0), + GATE_CLK(SCU0_CLK_GATE_UFSCLK, CLK_GATE_ASPEED, "ufsclk-gate", NULL, + SCU0_CLK_STOP, 26, 0), + GATE_CLK(SCU0_CLK_GATE_EMMCCLK, CLK_GATE_ASPEED, "emmcclk-gate", emmcclk, + SCU0_CLK_STOP, 27, 0), + GATE_CLK(SCU0_CLK_GATE_RVAS1CLK, CLK_GATE_ASPEED, "rvas1clk-gate", NULL, + SCU0_CLK_STOP, 28, 0), +}; + +static const struct ast2700_clk_info ast2700_scu1_clk_info[] __initconst = { + FIXED_CLK(SCU1_CLKIN, "soc1-clkin", SCU_CLK_25MHZ), + PLL_CLK(SCU1_CLK_HPLL, CLK_PLL, "soc1-hpll", soc1_clkin, SCU1_HPLL_PARAM), + PLL_CLK(SCU1_CLK_APLL, CLK_PLL, "soc1-apll", soc1_clkin, SCU1_APLL_PARAM), + PLL_CLK(SCU1_CLK_DPLL, CLK_PLL, "soc1-dpll", soc1_clkin, SCU1_DPLL_PARAM), + PLL_CLK(SCU1_CLK_UARTX, CLK_UART_PLL, "uartxclk", uxclk, SCU1_UXCLK_CTRL), + PLL_CLK(SCU1_CLK_HUARTX, CLK_UART_PLL, "huartxclk", huxclk, SCU1_HUXCLK_CTRL), + FIXED_FACTOR_CLK(SCU1_CLK_APLL_DIV2, "soc1-apll_div2", soc1_apll, 1, 2), + FIXED_FACTOR_CLK(SCU1_CLK_APLL_DIV4, "soc1-apll_div4", soc1_apll, 1, 4), + FIXED_FACTOR_CLK(SCU1_CLK_UART13, "uart13clk", huartxclk, 1, 1), + FIXED_FACTOR_CLK(SCU1_CLK_UART14, "uart14clk", huartxclk, 1, 1), + FIXED_FACTOR_CLK(SCU1_CLK_CAN, "canclk", soc1_apll, 1, 10), + DIVIDER_CLK(SCU1_CLK_SDCLK, "sdclk", sdclk_mux, + SCU1_CLK_SEL1, 14, 3, ast2700_clk_div_table), + DIVIDER_CLK(SCU1_CLK_APB, "soc1-apb", soc1_hpll, + SCU1_CLK_SEL1, 18, 3, ast2700_clk_div_table2), + DIVIDER_CLK(SCU1_CLK_RMII, "rmii", soc1_hpll, + SCU1_CLK_SEL1, 21, 3, ast2700_rmii_div_table), + DIVIDER_CLK(SCU1_CLK_RGMII, "rgmii", soc1_hpll, + SCU1_CLK_SEL1, 25, 3, ast2700_rgmii_div_table), + DIVIDER_CLK(SCU1_CLK_MACHCLK, "machclk", soc1_hpll, + SCU1_CLK_SEL1, 29, 3, ast2700_clk_div_table), + DIVIDER_CLK(SCU1_CLK_APLL_DIVN, "soc1-apll_divn", soc1_apll, + SCU1_CLK_SEL2, 8, 3, ast2700_clk_div_table), + DIVIDER_CLK(SCU1_CLK_AHB, "soc1-ahb", soc1_hpll, + SCU1_CLK_SEL2, 20, 3, ast2700_clk_div_table), + DIVIDER_CLK(SCU1_CLK_I3C, "soc1-i3c", soc1_hpll, + SCU1_CLK_SEL2, 23, 3, ast2700_clk_div_table), + MUX_CLK(SCU1_CLK_UART0, "uart0clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 0, 1), + MUX_CLK(SCU1_CLK_UART1, "uart1clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 1, 1), + MUX_CLK(SCU1_CLK_UART2, "uart2clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 2, 1), + MUX_CLK(SCU1_CLK_UART3, "uart3clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 3, 1), + MUX_CLK(SCU1_CLK_UART5, "uart5clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 5, 1), + MUX_CLK(SCU1_CLK_UART6, "uart6clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 6, 1), + MUX_CLK(SCU1_CLK_UART7, "uart7clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 7, 1), + MUX_CLK(SCU1_CLK_UART8, "uart8clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 8, 1), + MUX_CLK(SCU1_CLK_UART9, "uart9clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 9, 1), + MUX_CLK(SCU1_CLK_UART10, "uart10clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 10, 1), + MUX_CLK(SCU1_CLK_UART11, "uart11clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 11, 1), + MUX_CLK(SCU1_CLK_UART12, "uart12clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 12, 1), + MUX_CLK(SCU1_CLK_SDMUX, "sdclk-mux", sdio_clk_sels, ARRAY_SIZE(sdio_clk_sels), + SCU1_CLK_SEL1, 13, 1), + MUX_CLK(SCU1_CLK_UXCLK, "uxclk", ux_clk_sels, ARRAY_SIZE(ux_clk_sels), + SCU1_CLK_SEL2, 0, 2), + MUX_CLK(SCU1_CLK_HUXCLK, "huxclk", ux_clk_sels, ARRAY_SIZE(ux_clk_sels), + SCU1_CLK_SEL2, 3, 2), + GATE_CLK(SCU1_CLK_MAC0RCLK, CLK_GATE, "mac0rclk-gate", rmii, SCU1_MAC12_CLK_DLY, 29, 0), + GATE_CLK(SCU1_CLK_MAC1RCLK, CLK_GATE, "mac1rclk-gate", rmii, SCU1_MAC12_CLK_DLY, 30, 0), + GATE_CLK(SCU1_CLK_GATE_LCLK0, CLK_GATE_ASPEED, "lclk0-gate", NULL, + SCU1_CLK_STOP, 0, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_LCLK1, CLK_GATE_ASPEED, "lclk1-gate", NULL, + SCU1_CLK_STOP, 1, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_ESPI0CLK, CLK_GATE_ASPEED, "espi0clk-gate", NULL, + SCU1_CLK_STOP, 2, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_ESPI1CLK, CLK_GATE_ASPEED, "espi1clk-gate", NULL, + SCU1_CLK_STOP, 3, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_SDCLK, CLK_GATE_ASPEED, "sdclk-gate", sdclk, + SCU1_CLK_STOP, 4, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_IPEREFCLK, CLK_GATE_ASPEED, "soc1-iperefclk-gate", NULL, + SCU1_CLK_STOP, 5, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_REFCLK, CLK_GATE_ASPEED, "soc1-refclk-gate", NULL, + SCU1_CLK_STOP, 6, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_LPCHCLK, CLK_GATE_ASPEED, "lpchclk-gate", NULL, + SCU1_CLK_STOP, 7, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_MAC0CLK, CLK_GATE_ASPEED, "mac0clk-gate", NULL, + SCU1_CLK_STOP, 8, 0), + GATE_CLK(SCU1_CLK_GATE_MAC1CLK, CLK_GATE_ASPEED, "mac1clk-gate", NULL, + SCU1_CLK_STOP, 9, 0), + GATE_CLK(SCU1_CLK_GATE_MAC2CLK, CLK_GATE_ASPEED, "mac2clk-gate", NULL, + SCU1_CLK_STOP, 10, 0), + GATE_CLK(SCU1_CLK_GATE_UART0CLK, CLK_GATE_ASPEED, "uart0clk-gate", uart0clk, + SCU1_CLK_STOP, 11, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_UART1CLK, CLK_GATE_ASPEED, "uart1clk-gate", uart1clk, + SCU1_CLK_STOP, 12, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_UART2CLK, CLK_GATE_ASPEED, "uart2clk-gate", uart2clk, + SCU1_CLK_STOP, 13, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_UART3CLK, CLK_GATE_ASPEED, "uart3clk-gate", uart3clk, + SCU1_CLK_STOP, 14, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_I2CCLK, CLK_GATE_ASPEED, "i2cclk-gate", NULL, SCU1_CLK_STOP, 15, 0), + GATE_CLK(SCU1_CLK_GATE_I3C0CLK, CLK_GATE_ASPEED, "i3c0clk-gate", soc1_i3c, + SCU1_CLK_STOP, 16, 0), + GATE_CLK(SCU1_CLK_GATE_I3C1CLK, CLK_GATE_ASPEED, "i3c1clk-gate", soc1_i3c, + SCU1_CLK_STOP, 17, 0), + GATE_CLK(SCU1_CLK_GATE_I3C2CLK, CLK_GATE_ASPEED, "i3c2clk-gate", soc1_i3c, + SCU1_CLK_STOP, 18, 0), + GATE_CLK(SCU1_CLK_GATE_I3C3CLK, CLK_GATE_ASPEED, "i3c3clk-gate", soc1_i3c, + SCU1_CLK_STOP, 19, 0), + GATE_CLK(SCU1_CLK_GATE_I3C4CLK, CLK_GATE_ASPEED, "i3c4clk-gate", soc1_i3c, + SCU1_CLK_STOP, 20, 0), + GATE_CLK(SCU1_CLK_GATE_I3C5CLK, CLK_GATE_ASPEED, "i3c5clk-gate", soc1_i3c, + SCU1_CLK_STOP, 21, 0), + GATE_CLK(SCU1_CLK_GATE_I3C6CLK, CLK_GATE_ASPEED, "i3c6clk-gate", soc1_i3c, + SCU1_CLK_STOP, 22, 0), + GATE_CLK(SCU1_CLK_GATE_I3C7CLK, CLK_GATE_ASPEED, "i3c7clk-gate", soc1_i3c, + SCU1_CLK_STOP, 23, 0), + GATE_CLK(SCU1_CLK_GATE_I3C8CLK, CLK_GATE_ASPEED, "i3c8clk-gate", soc1_i3c, + SCU1_CLK_STOP, 24, 0), + GATE_CLK(SCU1_CLK_GATE_I3C9CLK, CLK_GATE_ASPEED, "i3c9clk-gate", soc1_i3c, + SCU1_CLK_STOP, 25, 0), + GATE_CLK(SCU1_CLK_GATE_I3C10CLK, CLK_GATE_ASPEED, "i3c10clk-gate", soc1_i3c, + SCU1_CLK_STOP, 26, 0), + GATE_CLK(SCU1_CLK_GATE_I3C11CLK, CLK_GATE_ASPEED, "i3c11clk-gate", soc1_i3c, + SCU1_CLK_STOP, 27, 0), + GATE_CLK(SCU1_CLK_GATE_I3C12CLK, CLK_GATE_ASPEED, "i3c12clk-gate", soc1_i3c, + SCU1_CLK_STOP, 28, 0), + GATE_CLK(SCU1_CLK_GATE_I3C13CLK, CLK_GATE_ASPEED, "i3c13clk-gate", soc1_i3c, + SCU1_CLK_STOP, 29, 0), + GATE_CLK(SCU1_CLK_GATE_I3C14CLK, CLK_GATE_ASPEED, "i3c14clk-gate", soc1_i3c, + SCU1_CLK_STOP, 30, 0), + GATE_CLK(SCU1_CLK_GATE_I3C15CLK, CLK_GATE_ASPEED, "i3c15clk-gate", soc1_i3c, + SCU1_CLK_STOP, 31, 0), + GATE_CLK(SCU1_CLK_GATE_UART5CLK, CLK_GATE_ASPEED, "uart5clk-gate", uart5clk, + SCU1_CLK_STOP2, 0, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_UART6CLK, CLK_GATE_ASPEED, "uart6clk-gate", uart6clk, + SCU1_CLK_STOP2, 1, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_UART7CLK, CLK_GATE_ASPEED, "uart7clk-gate", uart7clk, + SCU1_CLK_STOP2, 2, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_UART8CLK, CLK_GATE_ASPEED, "uart8clk-gate", uart8clk, + SCU1_CLK_STOP2, 3, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_UART9CLK, CLK_GATE_ASPEED, "uart9clk-gate", uart9clk, + SCU1_CLK_STOP2, 4, 0), + GATE_CLK(SCU1_CLK_GATE_UART10CLK, CLK_GATE_ASPEED, "uart10clk-gate", uart10clk, + SCU1_CLK_STOP2, 5, 0), + GATE_CLK(SCU1_CLK_GATE_UART11CLK, CLK_GATE_ASPEED, "uart11clk-gate", uart11clk, + SCU1_CLK_STOP2, 6, 0), + GATE_CLK(SCU1_CLK_GATE_UART12CLK, CLK_GATE_ASPEED, "uart12clk-gate", uart12clk, + SCU1_CLK_STOP2, 7, 0), + GATE_CLK(SCU1_CLK_GATE_FSICLK, CLK_GATE_ASPEED, "fsiclk-gate", NULL, SCU1_CLK_STOP2, 8, 0), + GATE_CLK(SCU1_CLK_GATE_LTPIPHYCLK, CLK_GATE_ASPEED, "ltpiphyclk-gate", NULL, + SCU1_CLK_STOP2, 9, 0), + GATE_CLK(SCU1_CLK_GATE_LTPICLK, CLK_GATE_ASPEED, "ltpiclk-gate", NULL, + SCU1_CLK_STOP2, 10, 0), + GATE_CLK(SCU1_CLK_GATE_VGALCLK, CLK_GATE_ASPEED, "vgalclk-gate", NULL, + SCU1_CLK_STOP2, 11, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_UHCICLK, CLK_GATE_ASPEED, "usbuartclk-gate", NULL, + SCU1_CLK_STOP2, 12, 0), + GATE_CLK(SCU1_CLK_GATE_CANCLK, CLK_GATE_ASPEED, "canclk-gate", canclk, + SCU1_CLK_STOP2, 13, 0), + GATE_CLK(SCU1_CLK_GATE_PCICLK, CLK_GATE_ASPEED, "pciclk-gate", NULL, + SCU1_CLK_STOP2, 14, 0), + GATE_CLK(SCU1_CLK_GATE_SLICLK, CLK_GATE_ASPEED, "soc1-sliclk-gate", NULL, + SCU1_CLK_STOP2, 15, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_E2MCLK, CLK_GATE_ASPEED, "soc1-e2m-gate", NULL, + SCU1_CLK_STOP2, 16, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_PORTCUSB2CLK, CLK_GATE_ASPEED, "portcusb2-gate", NULL, + SCU1_CLK_STOP2, 17, 0), + GATE_CLK(SCU1_CLK_GATE_PORTDUSB2CLK, CLK_GATE_ASPEED, "portdusb2-gate", NULL, + SCU1_CLK_STOP2, 18, 0), + GATE_CLK(SCU1_CLK_GATE_LTPI1TXCLK, CLK_GATE_ASPEED, "ltp1tx-gate", NULL, + SCU1_CLK_STOP2, 19, 0), +}; + +static struct clk_hw *ast2700_clk_hw_register_hpll(void __iomem *reg, + const char *name, const char *parent_name, + struct ast2700_clk_ctrl *clk_ctrl) +{ + unsigned int mult, div; + u32 val; + + val = readl(clk_ctrl->base + SCU0_HWSTRAP1); + if ((readl(clk_ctrl->base) & REVISION_ID) && (val & BIT(3))) { + switch ((val & GENMASK(4, 2)) >> 2) { + case 2: + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, NULL, + 0, 1800 * HZ_PER_MHZ); + case 3: + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, NULL, + 0, 1700 * HZ_PER_MHZ); + case 6: + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, NULL, + 0, 1200 * HZ_PER_MHZ); + case 7: + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, NULL, + 0, 800 * HZ_PER_MHZ); + default: + return ERR_PTR(-EINVAL); + } + } else if ((val & GENMASK(3, 2)) != 0) { + switch ((val & GENMASK(3, 2)) >> 2) { + case 1: + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, NULL, + 0, 1900 * HZ_PER_MHZ); + case 2: + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, NULL, + 0, 1800 * HZ_PER_MHZ); + case 3: + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, NULL, + 0, 1700 * HZ_PER_MHZ); + default: + return ERR_PTR(-EINVAL); + } + } else { + val = readl(reg); + + if (val & BIT(24)) { + /* Pass through mode */ + mult = 1; + div = 1; + } else { + u32 m = val & 0x1fff; + u32 n = (val >> 13) & 0x3f; + u32 p = (val >> 19) & 0xf; + + mult = (m + 1) / (2 * (n + 1)); + div = (p + 1); + } + } + + return devm_clk_hw_register_fixed_factor(clk_ctrl->dev, name, parent_name, 0, mult, div); +} + +static struct clk_hw *ast2700_clk_hw_register_pll(int clk_idx, void __iomem *reg, + const char *name, const char *parent_name, + struct ast2700_clk_ctrl *clk_ctrl) +{ + int scu = clk_ctrl->clk_data->scu; + unsigned int mult, div; + u32 val = readl(reg); + + if (val & BIT(24)) { + /* Pass through mode */ + mult = 1; + div = 1; + } else { + u32 m = val & 0x1fff; + u32 n = (val >> 13) & 0x3f; + u32 p = (val >> 19) & 0xf; + + if (scu) { + mult = (m + 1) / (n + 1); + div = (p + 1); + } else { + if (clk_idx == SCU0_CLK_MPLL) { + mult = m / (n + 1); + div = (p + 1); + } else { + mult = (m + 1) / (2 * (n + 1)); + div = (p + 1); + } + } + } + + return devm_clk_hw_register_fixed_factor(clk_ctrl->dev, name, parent_name, 0, mult, div); +} + +static struct clk_hw *ast2700_clk_hw_register_dclk(void __iomem *reg, const char *name, + struct ast2700_clk_ctrl *clk_ctrl) +{ + unsigned int mult, div, r, n; + u32 xdclk; + u32 val; + + val = readl(clk_ctrl->base + 0x284); + if (val & BIT(29)) + xdclk = 800 * HZ_PER_MHZ; + else + xdclk = 1000 * HZ_PER_MHZ; + + val = readl(reg); + r = val & GENMASK(15, 0); + n = (val >> 16) & GENMASK(15, 0); + mult = r; + div = 2 * n; + + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, NULL, 0, (xdclk * mult) / div); +} + +static struct clk_hw *ast2700_clk_hw_register_uartpll(void __iomem *reg, + const char *name, const char *parent_name, + struct ast2700_clk_ctrl *clk_ctrl) +{ + unsigned int mult, div; + u32 val = readl(reg); + u32 r = val & 0xff; + u32 n = (val >> 8) & 0x3ff; + + mult = r; + div = n * 2; + + return devm_clk_hw_register_fixed_factor(clk_ctrl->dev, name, + parent_name, 0, mult, div); +} + +static struct clk_hw *ast2700_clk_hw_register_misc(int clk_idx, void __iomem *reg, + const char *name, const char *parent_name, + struct ast2700_clk_ctrl *clk_ctrl) +{ + u32 div = 0; + + if (clk_idx == SCU0_CLK_MPHY) { + div = readl(reg) + 1; + } else if (clk_idx == SCU0_CLK_U2PHY_REFCLK) { + if (readl(clk_ctrl->base) & REVISION_ID) + div = (GET_USB_REFCLK_DIV(readl(reg)) + 1) << 4; + else + div = (GET_USB_REFCLK_DIV(readl(reg)) + 1) << 1; + } else { + return ERR_PTR(-EINVAL); + } + + return devm_clk_hw_register_fixed_factor(clk_ctrl->dev, name, + parent_name, 0, 1, div); +} + +static int ast2700_clk_is_enabled(struct clk_hw *hw) +{ + struct clk_gate *gate = to_clk_gate(hw); + u32 clk = BIT(gate->bit_idx); + u32 reg; + + reg = readl(gate->reg); + + return !(reg & clk); +} + +static int ast2700_clk_enable(struct clk_hw *hw) +{ + struct clk_gate *gate = to_clk_gate(hw); + u32 clk = BIT(gate->bit_idx); + + if (readl(gate->reg) & clk) + writel(clk, gate->reg + 0x04); + + return 0; +} + +static void ast2700_clk_disable(struct clk_hw *hw) +{ + struct clk_gate *gate = to_clk_gate(hw); + u32 clk = BIT(gate->bit_idx); + + /* Clock is set to enable, so use write to set register */ + writel(clk, gate->reg); +} + +static const struct clk_ops ast2700_clk_gate_ops = { + .enable = ast2700_clk_enable, + .disable = ast2700_clk_disable, + .is_enabled = ast2700_clk_is_enabled, +}; + +static struct clk_hw *ast2700_clk_hw_register_gate(struct device *dev, const char *name, + const struct clk_parent_data *parent, + void __iomem *reg, u8 clock_idx, + unsigned long clk_gate_flags, spinlock_t *lock) +{ + struct clk_gate *gate; + struct clk_hw *hw; + struct clk_init_data init; + int ret = -EINVAL; + + gate = kzalloc(sizeof(*gate), GFP_KERNEL); + if (!gate) + return ERR_PTR(-ENOMEM); + + init.name = name; + init.ops = &ast2700_clk_gate_ops; + init.flags = clk_gate_flags; + init.parent_names = parent ? &parent->name : NULL; + init.num_parents = parent ? 1 : 0; + + gate->reg = reg; + gate->bit_idx = clock_idx; + gate->flags = 0; + gate->lock = lock; + gate->hw.init = &init; + + hw = &gate->hw; + ret = clk_hw_register(dev, hw); + if (ret) { + kfree(gate); + hw = ERR_PTR(ret); + } + + return hw; +} + +static void ast2700_soc1_configure_i3c_clk(struct ast2700_clk_ctrl *clk_ctrl) +{ + if (readl(clk_ctrl->base + SCU1_REVISION_ID) & REVISION_ID) + /* I3C 250MHz = HPLL/4 */ + writel((readl(clk_ctrl->base + SCU1_CLK_SEL2) & + ~SCU1_CLK_I3C_DIV_MASK) | + FIELD_PREP(SCU1_CLK_I3C_DIV_MASK, + SCU1_CLK_I3C_DIV(4)), + clk_ctrl->base + SCU1_CLK_SEL2); +} + +static int ast2700_soc_clk_probe(struct platform_device *pdev) +{ + const struct ast2700_clk_data *clk_data; + struct clk_hw_onecell_data *clk_hw_data; + struct ast2700_clk_ctrl *clk_ctrl; + struct device *dev = &pdev->dev; + struct auxiliary_device *adev; + void __iomem *clk_base; + struct clk_hw **hws; + char *reset_name; + int ret; + int i; + + clk_ctrl = devm_kzalloc(dev, sizeof(*clk_ctrl), GFP_KERNEL); + if (!clk_ctrl) + return -ENOMEM; + clk_ctrl->dev = dev; + dev_set_drvdata(&pdev->dev, clk_ctrl); + + spin_lock_init(&clk_ctrl->lock); + + clk_base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(clk_base)) + return PTR_ERR(clk_base); + + clk_ctrl->base = clk_base; + + clk_data = device_get_match_data(dev); + if (!clk_data) + return -ENODEV; + + clk_ctrl->clk_data = clk_data; + reset_name = devm_kasprintf(dev, GFP_KERNEL, "reset%d", clk_data->scu); + + clk_hw_data = devm_kzalloc(dev, struct_size(clk_hw_data, hws, clk_data->nr_clks), + GFP_KERNEL); + if (!clk_hw_data) + return -ENOMEM; + + clk_hw_data->num = clk_data->nr_clks; + hws = clk_hw_data->hws; + + if (clk_data->scu) + ast2700_soc1_configure_i3c_clk(clk_ctrl); + + for (i = 0; i < clk_data->nr_clks; i++) { + const struct ast2700_clk_info *clk = &clk_data->clk_info[i]; + void __iomem *reg; + + if (clk->type == CLK_FIXED) { + const struct ast2700_clk_fixed_rate_data *fixed_rate = &clk->data.rate; + + hws[i] = devm_clk_hw_register_fixed_rate(dev, clk->name, NULL, 0, + fixed_rate->fixed_rate); + } else if (clk->type == CLK_FIXED_FACTOR) { + const struct ast2700_clk_fixed_factor_data *factor = &clk->data.factor; + + hws[i] = devm_clk_hw_register_fixed_factor(dev, clk->name, + factor->parent->name, + 0, factor->mult, factor->div); + } else if (clk->type == DCLK_FIXED) { + const struct ast2700_clk_pll_data *pll = &clk->data.pll; + + reg = clk_ctrl->base + pll->reg; + hws[i] = ast2700_clk_hw_register_dclk(reg, clk->name, clk_ctrl); + } else if (clk->type == CLK_HPLL) { + const struct ast2700_clk_pll_data *pll = &clk->data.pll; + + reg = clk_ctrl->base + pll->reg; + hws[i] = ast2700_clk_hw_register_hpll(reg, clk->name, + pll->parent->name, clk_ctrl); + } else if (clk->type == CLK_PLL) { + const struct ast2700_clk_pll_data *pll = &clk->data.pll; + + reg = clk_ctrl->base + pll->reg; + hws[i] = ast2700_clk_hw_register_pll(i, reg, clk->name, + pll->parent->name, clk_ctrl); + } else if (clk->type == CLK_UART_PLL) { + const struct ast2700_clk_pll_data *pll = &clk->data.pll; + + reg = clk_ctrl->base + pll->reg; + hws[i] = ast2700_clk_hw_register_uartpll(reg, clk->name, + pll->parent->name, clk_ctrl); + } else if (clk->type == CLK_MUX) { + const struct ast2700_clk_mux_data *mux = &clk->data.mux; + + reg = clk_ctrl->base + mux->reg; + hws[i] = devm_clk_hw_register_mux_parent_data_table(dev, clk->name, + mux->parents, + mux->num_parents, 0, + reg, mux->bit_shift, + mux->bit_width, 0, + NULL, &clk_ctrl->lock); + } else if (clk->type == CLK_MISC) { + const struct ast2700_clk_pll_data *misc = &clk->data.pll; + + reg = clk_ctrl->base + misc->reg; + hws[i] = ast2700_clk_hw_register_misc(i, reg, clk->name, + misc->parent->name, clk_ctrl); + } else if (clk->type == CLK_DIVIDER) { + const struct ast2700_clk_div_data *div = &clk->data.div; + + reg = clk_ctrl->base + div->reg; + hws[i] = devm_clk_hw_register_divider_table(dev, clk->name, + div->parent->name, 0, + reg, div->bit_shift, + div->bit_width, 0, + div->div_table, + &clk_ctrl->lock); + } else if (clk->type == CLK_GATE_ASPEED) { + const struct ast2700_clk_gate_data *gate = &clk->data.gate; + + reg = clk_ctrl->base + gate->reg; + hws[i] = ast2700_clk_hw_register_gate(dev, clk->name, gate->parent, + reg, gate->bit, gate->flags, + &clk_ctrl->lock); + + } else { + const struct ast2700_clk_gate_data *gate = &clk->data.gate; + + reg = clk_ctrl->base + gate->reg; + hws[i] = devm_clk_hw_register_gate_parent_data(dev, clk->name, gate->parent, + 0, reg, clk->clk_idx, 0, + &clk_ctrl->lock); + } + + if (IS_ERR(hws[i])) + return PTR_ERR(hws[i]); + } + + ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, clk_hw_data); + if (ret) + return ret; + + adev = devm_auxiliary_device_create(dev, reset_name, (__force void *)clk_base); + if (!adev) + return -ENODEV; + + return 0; +} + +static const struct ast2700_clk_data ast2700_clk0_data = { + .scu = 0, + .nr_clks = ARRAY_SIZE(ast2700_scu0_clk_info), + .clk_info = ast2700_scu0_clk_info, +}; + +static const struct ast2700_clk_data ast2700_clk1_data = { + .scu = 1, + .nr_clks = ARRAY_SIZE(ast2700_scu1_clk_info), + .clk_info = ast2700_scu1_clk_info, +}; + +static const struct of_device_id ast2700_scu_match[] = { + { .compatible = "aspeed,ast2700-scu0", .data = &ast2700_clk0_data }, + { .compatible = "aspeed,ast2700-scu1", .data = &ast2700_clk1_data }, + { /* sentinel */ } +}; + +MODULE_DEVICE_TABLE(of, ast2700_scu_match); + +static struct platform_driver ast2700_scu_driver = { + .probe = ast2700_soc_clk_probe, + .driver = { + .name = "clk-ast2700", + .of_match_table = ast2700_scu_match, + }, +}; + +static int __init clk_ast2700_init(void) +{ + return platform_driver_register(&ast2700_scu_driver); +} +arch_initcall(clk_ast2700_init); -- 2.34.1 From krzk at kernel.org Mon Jul 7 16:16:59 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Mon, 7 Jul 2025 08:16:59 +0200 Subject: [PATCH v11 1/3] dt-bindings: clock: ast2700: modify soc0/1 clock define In-Reply-To: <20250707011826.3719229-2-ryan_chen@aspeedtech.com> References: <20250707011826.3719229-1-ryan_chen@aspeedtech.com> <20250707011826.3719229-2-ryan_chen@aspeedtech.com> Message-ID: <20250707-spectacular-platinum-hippo-9ab32e@krzk-bin> On Mon, Jul 07, 2025 at 09:18:24AM +0800, Ryan Chen wrote: > -add SOC0_CLK_AHBMUX: > add SOC0_CLK_AHBMUX for ahb clock source divide. > mpll-> > ahb_mux -> div_table -> clk_ahb > hpll-> > > -new add clock: > SOC0_CLK_MPHYSRC: UFS MPHY clock source. > SOC0_CLK_U2PHY_REFCLKSRC: USB2.0 phy clock reference source. > SOC1_CLK_I3C: I3C clock source. > > Signed-off-by: Ryan Chen > Acked-by:Krzysztof Kozlowski Don't edit or fake the tags. You must paste it exactly how you received it. This needs fixes. I suggest using b4 in your workflow, so you will not make such mistakes. Best regards, Krzysztof From robh at kernel.org Tue Jul 8 03:55:26 2025 From: robh at kernel.org (Rob Herring (Arm)) Date: Mon, 07 Jul 2025 12:55:26 -0500 Subject: [PATCH v2 0/9] ARM: dts: aspeed: Add Meta Darwin dts In-Reply-To: <20250706042404.138128-1-rentao.bupt@gmail.com> References: <20250706042404.138128-1-rentao.bupt@gmail.com> Message-ID: <175191074290.3364643.3141046769008476356.robh@kernel.org> On Sat, 05 Jul 2025 21:23:50 -0700, rentao.bupt at gmail.com wrote: > From: Tao Ren > > The patch series introduces the initial device tree for Meta/Facebook > Darwin AST2600 BMC. > > Patches #1, #2 and #3 fixes the DTB warnings in wedge400/fuji dts and > ast2600-facebook-netbmc-common.dtsi. > > Patches #4, #5 and #6 introduces a new BMC flash layout to be used by > wedge400 and fuji (and later more Meta Network BMC platforms). > > Patch #7 moves eMMC entries from ast2600-facebook-netbmc-common.dtsi to > each BMC platform because eMMC was removed from future Meta Network BMC > platforms. > > Patches #8 and #9 adds Meta Darwin BMC and updates devicetree bindings. > > Tao Ren (9): > ARM: dts: aspeed: wedge400: Fix DTB warnings > ARM: dts: aspeed: fuji: Fix DTB warnings > ARM: dts: aspeed: Fix DTB warnings in > ast2600-facebook-netbmc-common.dtsi > ARM: dts: aspeed: Add facebook-bmc-flash-layout-128-data64.dtsi > ARM: dts: aspeed: wedge400: Extend data0 partition to 64MB > ARM: dts: aspeed: Move flash layout out of Facebook netbmc-common.dtsi > ARM: dts: aspeed: Move eMMC out of ast2600-facebook-netbmc-common.dtsi > dt-bindings: arm: aspeed: add Facebook Darwin board > ARM: dts: aspeed: Add Facebook Darwin (AST2600) BMC > > .../bindings/arm/aspeed/aspeed.yaml | 1 + > arch/arm/boot/dts/aspeed/Makefile | 1 + > .../dts/aspeed/aspeed-bmc-facebook-darwin.dts | 78 +++++++++++++++++++ > .../dts/aspeed/aspeed-bmc-facebook-elbert.dts | 18 +++++ > .../dts/aspeed/aspeed-bmc-facebook-fuji.dts | 24 ++++-- > .../aspeed/aspeed-bmc-facebook-wedge400.dts | 8 +- > .../ast2600-facebook-netbmc-common.dtsi | 24 ++---- > .../facebook-bmc-flash-layout-128-data64.dtsi | 60 ++++++++++++++ > 8 files changed, 187 insertions(+), 27 deletions(-) > create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts > create mode 100644 arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128-data64.dtsi > > -- > 2.47.1 > > > My bot found new DTB warnings on the .dts files added or changed in this series. Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments. If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date: pip3 install dtschema --upgrade This patch series was applied (using b4) to base: Base: attempting to guess base-commit... Base: tags/next-20250704 (best guess, 4/6 blobs matched) If this is not the correct base, please add 'base-commit' tag (or use b4 which does this automatically) New warnings running 'make CHECK_DTBS=y for arch/arm/boot/dts/aspeed/' for 20250706042404.138128-1-rentao.bupt at gmail.com: arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: timer (arm,armv7-timer): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/timer/arm,arch_timer.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /sdram at 1e6e0000: failed to match any schema with compatible: ['aspeed,ast2600-sdram-edac', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: bus at 1e600000 (aspeed,ast2600-ahbc): compatible: ['aspeed,ast2600-ahbc', 'syscon'] is too long from schema $id: http://devicetree.org/schemas/bus/aspeed,ast2600-ahbc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: syscon at 1e6e2000 (aspeed,ast2600-scu): 'smp-memram at 180' does not match any of the regexes: '^interrupt-controller@[0-9a-f]+$', '^p2a-control@[0-9a-f]+$', '^pinctrl(@[0-9a-f]+)?$', '^pinctrl-[0-9]+$', '^silicon-id@[0-9a-f]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed,ast2x00-scu.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb at 1e6e0000/syscon at 1e6e2000/smp-memram at 180: failed to match any schema with compatible: ['aspeed,ast2600-smpmem'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb at 1e6e0000/display at 1e6e6000: failed to match any schema with compatible: ['aspeed,ast2600-gfx', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: adc at 1e6e9000 (aspeed,ast2600-adc0): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: adc at 1e6e9100 (aspeed,ast2600-adc1): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: crypto at 1e6fa000 (aspeed,ast2600-acry): 'aspeed,ahbc' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/crypto/aspeed,ast2600-acry.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740100:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740200:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/sdc at 1e740000/sdhci at 1e740100: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/sdc at 1e740000/sdhci at 1e740200: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb at 1e780000/timer at 1e782000: failed to match any schema with compatible: ['aspeed,ast2600-timer'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): reg-io-width: 4 is not of type 'object' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): lpc-snoop at 80: 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: kcs at 24 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: kcs at 28 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: kcs at 2c (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: kcs at 114 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb at 1e780000/lpc at 1e789000/lhc at a0: failed to match any schema with compatible: ['aspeed,ast2600-lhc'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb at 1e780000/lpc at 1e789000/ibt at 140: failed to match any schema with compatible: ['aspeed,ast2600-ibt-bmc'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: fsi at 1e79b000 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb at 1e790000/fsi at 1e79b000: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: fsi at 1e79b100 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb at 1e790000/fsi at 1e79b100: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb at 1e790000/dma-controller at 1e79e000: failed to match any schema with compatible: ['aspeed,ast2600-udma'] From andrew at codeconstruct.com.au Tue Jul 8 12:06:39 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Tue, 08 Jul 2025 11:36:39 +0930 Subject: [PATCH v2 04/10] soc: aspeed: lpc-snoop: Constrain parameters in channel paths In-Reply-To: <20250704184408.32227305@endymion> References: <20250616-aspeed-lpc-snoop-fixes-v2-0-3cdd59c934d3@codeconstruct.com.au> <20250616-aspeed-lpc-snoop-fixes-v2-4-3cdd59c934d3@codeconstruct.com.au> <20250704184408.32227305@endymion> Message-ID: Hi Jean, On Fri, 2025-07-04 at 18:44 +0200, Jean Delvare wrote: > On Mon, 16 Jun 2025 22:43:41 +0930, Andrew Jeffery wrote: > > Ensure pointers and the channel index are valid before use. > > > > Signed-off-by: Andrew Jeffery > > --- > > ?drivers/soc/aspeed/aspeed-lpc-snoop.c | 25 ++++++++++++++++--------- > > ?1 file changed, 16 insertions(+), 9 deletions(-) > > > > diff --git a/drivers/soc/aspeed/aspeed-lpc-snoop.c b/drivers/soc/aspeed/aspeed-lpc-snoop.c > > index ca7536213e0986f737606a52996ffea620df2a7a..804c6ed9c4c671da73a6c66c1de41c59922c82dc 100644 > > --- a/drivers/soc/aspeed/aspeed-lpc-snoop.c > > +++ b/drivers/soc/aspeed/aspeed-lpc-snoop.c > > @@ -25,7 +25,6 @@ > > ? > > ?#define DEVICE_NAME????"aspeed-lpc-snoop" > > ? > > -#define NUM_SNOOP_CHANNELS 2 > > ?#define SNOOP_FIFO_SIZE 2048 > > ? > > ?#define HICR5??0x80 > > @@ -57,6 +56,12 @@ struct aspeed_lpc_snoop_model_data { > > ????????unsigned int has_hicrb_ensnp; > > ?}; > > ? > > +enum aspeed_lpc_snoop_index { > > +???????ASPEED_LPC_SNOOP_INDEX_0 = 0, > > +???????ASPEED_LPC_SNOOP_INDEX_1 = 1, > > +???????ASPEED_LPC_SNOOP_INDEX_MAX = ASPEED_LPC_SNOOP_INDEX_1, > > +}; > > I don't have a strong opinion on this (again, I'm neither the driver > maintainer nor the subsystem maintainer so my opinion has little > value), but IMHO the main value of introducing an enum here was to make > it possible to get rid of the default statement in the switch > constructs. With switch constructs being gone in patch 10/10 (soc: > aspeed: lpc-snoop: Lift channel config to const structs), the value of > this enum seems pretty low now. You could use NUM_SNOOP_CHANNELS > instead of ASPEED_LPC_SNOOP_INDEX_MAX + 1 and 0 and 1 instead of > ASPEED_LPC_SNOOP_INDEX_0 and ASPEED_LPC_SNOOP_INDEX_1, respectively, > and the code would work just the same, while being more simple, with no > downside that I can see. > Yeah, I agonised over it a bit before posting. However, I'm on leave, and I'd like to draw a line under this series. This patch is in the middle of it, and I'd rather not disrupt it too much and go around again with a v3. I'm going to keep the enum for now, but if I need to tidy up the driver down again the track I'll reconsider its worth. Andrew From andrew at codeconstruct.com.au Tue Jul 8 12:06:48 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Tue, 08 Jul 2025 11:36:48 +0930 Subject: [PATCH v2 06/10] soc: aspeed: lpc-snoop: Rearrange channel paths In-Reply-To: <20250704173443.3436f535@endymion> References: <20250616-aspeed-lpc-snoop-fixes-v2-0-3cdd59c934d3@codeconstruct.com.au> <20250616-aspeed-lpc-snoop-fixes-v2-6-3cdd59c934d3@codeconstruct.com.au> <20250704173443.3436f535@endymion> Message-ID: <7e4738d944c611cfb0e4eba4ce2926ed55a0096a.camel@codeconstruct.com.au> Hi Jean, On Fri, 2025-07-04 at 17:34 +0200, Jean Delvare wrote: > On Mon, 16 Jun 2025 22:43:43 +0930, Andrew Jeffery wrote: > > Order assignments such that tests for conditions not involving resource > > acquisition are ordered before those testing acquired resources, and > > order managed resource acquisition before unmanaged where possible. This > > way we minimise the amount of manual cleanup required. > > > > In the process, improve readability of the code by introducing a channel > > pointer that takes the place of the repeated object lookups. > > > > Acked-by: Jean Delvare > > Signed-off-by: Andrew Jeffery > > --- > > ?drivers/soc/aspeed/aspeed-lpc-snoop.c | 51 ++++++++++++++++++++--------------- > > ?1 file changed, 29 insertions(+), 22 deletions(-) > > (...) > > @@ -238,6 +240,7 @@ static int aspeed_lpc_enable_snoop(struct aspeed_lpc_snoop *lpc_snoop, > > ????????????????goto err_misc_deregister; > > ????????} > > ? > > +???????/* Enable LPC snoop channel at requested port */ > > ????????regmap_update_bits(lpc_snoop->regmap, HICR5, hicr5_en, hicr5_en); > > ????????regmap_update_bits(lpc_snoop->regmap, SNPWADR, snpwadr_mask, > > ?????????????????????????? lpc_port << snpwadr_shift); > > This duplicates a comment which is already present in the driver a few > lines before. > > This duplicated comment gets cleaned up later in patch 10/10 (soc: > aspeed: lpc-snoop: Lift channel config to const structs). > Thanks, I've dropped the duplicate in the process of applying the patches. Andrew From andrew at codeconstruct.com.au Tue Jul 8 12:06:59 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Tue, 08 Jul 2025 11:36:59 +0930 Subject: [PATCH v2 09/10] soc: aspeed: lpc-snoop: Consolidate channel initialisation In-Reply-To: <20250704171315.30300f59@endymion> References: <20250616-aspeed-lpc-snoop-fixes-v2-0-3cdd59c934d3@codeconstruct.com.au> <20250616-aspeed-lpc-snoop-fixes-v2-9-3cdd59c934d3@codeconstruct.com.au> <20250704171315.30300f59@endymion> Message-ID: <6ae95d064de0c1b6333c234e461eae3e8da80168.camel@codeconstruct.com.au> Hi Jean, On Fri, 2025-07-04 at 17:13 +0200, Jean Delvare wrote: > > > Signed-off-by: Andrew Jeffery > > --- > > ?drivers/soc/aspeed/aspeed-lpc-snoop.c | 51 +++++++++++++++++------------------ > > ?1 file changed, 24 insertions(+), 27 deletions(-) > > > > diff --git a/drivers/soc/aspeed/aspeed-lpc-snoop.c b/drivers/soc/aspeed/aspeed-lpc-snoop.c > > index 8dbc9d4158b89f23bda340f060d205a29bbb43c3..9f88c5471b1b6d85f6d9e1970240f3d1904d166c 100644 > > --- a/drivers/soc/aspeed/aspeed-lpc-snoop.c > > +++ b/drivers/soc/aspeed/aspeed-lpc-snoop.c > > @@ -294,12 +294,21 @@ static void aspeed_lpc_disable_snoop(struct aspeed_lpc_snoop *lpc_snoop, > > ????????kfifo_free(&channel->fifo); > > ?} > > ? > > +static void aspeed_lpc_snoop_remove(struct platform_device *pdev) > > +{ > > +???????struct aspeed_lpc_snoop *lpc_snoop = dev_get_drvdata(&pdev->dev); > > + > > +???????/* Disable both snoop channels */ > > +???????aspeed_lpc_disable_snoop(lpc_snoop, ASPEED_LPC_SNOOP_INDEX_0); > > +???????aspeed_lpc_disable_snoop(lpc_snoop, ASPEED_LPC_SNOOP_INDEX_1); > > For consistency with the probe function, I think it would make sense to > use a for loop here as well, instead of hard-coding the channel number > to 2. That way, no change will be needed if a future device supports > more than 2 channels. You're right, but for now I'm not bothered by it. I'm going to leave it as is, as the motivation for the loop in the probe() path was to consolidate the logic required for both channels. This one is an easy thing to fix down the track. > > None if this is blocking though, so: > > Acked-by: Jean Delvare > Thanks. Andrew From andrew at codeconstruct.com.au Tue Jul 8 12:07:33 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Tue, 08 Jul 2025 11:37:33 +0930 Subject: [PATCH v2 10/10] soc: aspeed: lpc-snoop: Lift channel config to const structs In-Reply-To: <20250704182348.53808e0f@endymion> References: <20250616-aspeed-lpc-snoop-fixes-v2-0-3cdd59c934d3@codeconstruct.com.au> <20250616-aspeed-lpc-snoop-fixes-v2-10-3cdd59c934d3@codeconstruct.com.au> <20250704182348.53808e0f@endymion> Message-ID: <24c957d3e63bf6dcd58b0807df79350d4b111926.camel@codeconstruct.com.au> Hi Jean, On Fri, 2025-07-04 at 18:23 +0200, Jean Delvare wrote: > > > @@ -189,28 +215,27 @@ static int aspeed_lpc_snoop_config_irq(struct aspeed_lpc_snoop *lpc_snoop, > > ?} > > ? > > ?__attribute__((nonnull)) > > -static int aspeed_lpc_enable_snoop(struct aspeed_lpc_snoop *lpc_snoop, > > -????????????????????????????????? struct device *dev, > > -????????????????????????????????? enum aspeed_lpc_snoop_index index, u16 lpc_port) > > +static int aspeed_lpc_enable_snoop(struct device *dev, > > +?????????????????????????????????? struct aspeed_lpc_snoop *lpc_snoop, > > +?????????????????????????????????? struct aspeed_lpc_snoop_channel *channel, > > +?????????????????????????????????? const struct aspeed_lpc_snoop_channel_cfg *cfg, > > +?????????????????????????????????? u16 lpc_port) > > ?{ > > I'm confused by this new calling convention. With lpc_snoop and index, > you could already retrieve the aspeed_lpc_snoop_channel struct and the > aspeed_lpc_snoop_channel_cfg struct. I can't see the benefit of the > change.? > My motivation for this choice was to isolate the association between indexes into the arrays to the call-site of aspeed_lpc_enable_snoop(), rather than have that information spread through the implementation. I considered the approaches you outline next before posting v2, so while they have their merits as well, I'm going to chalk this one up to personal preference on my part. > It even forces you to add an index field to struct > aspeed_lpc_snoop_channel_cfg, which would otherwise not be needed. > > If you prefer to pass cfg instead of index as a parameter, that does > not imply passing channel too. You can get the index from the cfg (if > you decide to keep it in that struct), and then the channel from index. > > Or you could even pass only the channel (to be consistent with > aspeed_lpc_disable_snoop), if you set channel->cfg before calling this > function. Again this implies keeping index in struct > aspeed_lpc_snoop_channel_cfg. *snip* > > > - > > -???????/* Enable LPC snoop channel at requested port */ > > -???????regmap_update_bits(lpc_snoop->regmap, HICR5, hicr5_en, hicr5_en); > > -???????regmap_update_bits(lpc_snoop->regmap, SNPWADR, snpwadr_mask, > > -????????????????????????? lpc_port << snpwadr_shift); > > +???????regmap_set_bits(lpc_snoop->regmap, HICR5, cfg->hicr5_en); > > +???????regmap_update_bits(lpc_snoop->regmap, SNPWADR, cfg->snpwadr_mask, > > +???????????????lpc_port << cfg->snpwadr_shift); > > It is a good practice to align the second line on the opening > parenthesis of the first line (as was done originally). Thanks, I've fixed this up. *snip* > > ? > > ?static int aspeed_lpc_snoop_probe(struct platform_device *pdev) > > @@ -339,6 +326,8 @@ static int aspeed_lpc_snoop_probe(struct platform_device *pdev) > > ????????if (rc) > > ????????????????return rc; > > ? > > +???????static_assert(ARRAY_SIZE(channel_cfgs) == ARRAY_SIZE(lpc_snoop->chan), > > +???????????????"Broken implementation assumption regarding cfg count"); > > Both also need to be equal to ASPEED_LPC_SNOOP_INDEX_MAX + 1, right? > Otherwise the loop below would break. But it turns out that both arrays > are now declared that way, so it just has to be true. This makes me > believe that this static assert is no longer needed. My intent was to convey that we require the arrays to be the same length, as opposed to being declared such that they happen to have the same length. It's a property of the design rather than the implementation. All static_assert()s should be obviously true; IMO their purpose is to communicate requirements and constrain change. With the view to getting these patches applied I intend to keep it. Thanks, Andrew From ryan_chen at aspeedtech.com Tue Jul 8 15:29:06 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Tue, 8 Jul 2025 13:29:06 +0800 Subject: [PATCH v12 0/3] Add support for AST2700 clk driver Message-ID: <20250708052909.4145983-1-ryan_chen@aspeedtech.com> This patch series is add clk driver for AST2700. AST2700 is the 8th generation of Integrated Remote Management Processor introduced by ASPEED Technology Inc. Which is Board Management controller (BMC) SoC family. AST2700 have two SoC connected, one is SoC0, another is SoC1, it has it's own scu, this driver inlcude SCU0 and SCU1 driver. v12: -fix mistakes commit message Acked-by:Krzysztof Kozlowski to Acked-by: Krzysztof Kozlowski v11: -update patch(1/3) commit message subject prefix dt-binding: to dt-bindings: v10: -aspeed,ast2700-scu.h: -add SOC0_CLK_AHBMUX, SOC0_CLK_MPHYSRC, SOC0_CLK_U2PHY_REFCLKSRC, SOC1_CLK_I3C. -clk-ast2700.c -add #include -remove #include -use devm_auxiliary_device_create replace aspeed_reset_controller_register -reset-aspeed.c: -remove aspeed_reset_unregister_adev, aspeed_reset_adev_release, aspeed_reset_controller_register. -compatible name change reset_aspeed.reset0/1 -> clk_ast2700.reset0/1 -remove reset-aspeed.h v9: -aspeed,ast2700-scu.h: no change. add more clear commit description. -clk-ast2700.c: add inlcude bitfield.h remove redundant clk_parent_data soc0_mpll_div8/soc0_ahb/uart13clk/ uart14clk/uart15clk/uart16clk/soc1_ahb/d_clk_sels v8: -aspeed,ast2700-scu.h: remove no use soc0 clock, add new clock -clk-ast2700.c: remove include , include , include -clk-ast2700.c: add include -clk-ast2700.c: modify include order before dt-bindings -clk-ast2700.c: modify define to be tabbed out space -clk-ast2700.c: add union struct for each clk type union { struct ast2700_clk_fixed_factor_data factor; struct ast2700_clk_fixed_rate_data rate; struct ast2700_clk_gate_data gate; struct ast2700_clk_div_data div; struct ast2700_clk_pll_data pll; struct ast2700_clk_mux_data mux; } data; -clk-ast2700.c: modify clk_data = device_get_match_data(dev); -clk-ast2700.c: modify builtin_platform_driver_probe to arch_initcall(clk_ast2700_init) -clk-ast2700.c: ast2700_clk_hw_register_hpll explain: scu010[4:2], scu010[4:2] = 010, hpll force 1.8Ghz scu010[4:2] = 011, hpll force 1.7Ghz scu010[4:2] = 110, hpll force 1.2Ghz scu010[4:2] = 111, hpll force 800Mhz others depend on hpll parameter register setting. v7: -reset-aspeed.h: fix declare static inline aspeed_reset_controller_register if the function is not used. v6: -patch-2: add reset-aspeed.h -reset-aspeed: add include cleanup.h for guard() -reset-aspeed: change ids name clk_aspeed to reset_aspeed -reset-aspeed: move aspeed_reset_controller_register, aspeed_reset_adev_release, aspeed_reset_unregister_adev from clk-ast2700.c -reset-aspeed: drop base check, since it check in clk-ast2700.c -clk-ast2700: sync each gate name from *clk to *clk-gate name. -clk-ast2700: add CLK_GATE_ASPEED to diff clk_hw_register_gate and ast2700_clk_hw_register_gate. v5: -patch-2 Kconfig: add select AUXILIARY_BUS -reset-aspeed: #define to_aspeed_reset(p) turn into static inline function. -reset-aspeed: modify spin_lock_irqsave to guard(spinlock_irqsave) -reset-aspeed: remove unnecessary parentheses. -clk-ast2700: use and refrain from define clk v4: -yaml: keep size-cells=<1>. -merge clk,reset dt binding header with yaml the same patch. -rename clk,reset dt binding header to aspeed,ast2700-scu.h -reset-aspeed: update tables tabs sapces to consistent spaces. -reset-aspeed: remove no use dev_set_drvdata. -clk-ast2700: modify reset_name to const int scu in struct clk_data. -clk-ast2700: use scu number in clk_data generate reset_name for reset driver register. -clk-ast2700: fix pll number mix up scu0,scu1. -clk-ast2700: update dt-binding clock include file. v3: -yaml: v2 missing send yaml patch, v3 add. -yaml: drop 64bits address example. -yaml: add discription about soc0 and soc1 -dt-bindings: remove (), *_NUMS, reserved. -dt-bindings: remove dulipated define number. -dt-bindings: merge clk and reset to be one patch. -reset-aspeed: add auxiliary device for reset driver. -clk-ast2700: modify reset to be auxiliary add. -clk-ast2700: modify to be platform driver. -clk-ast2700: modify each clk to const clk array. v2: -yaml: drop 64bits address example. -yaml: add discription about soc0 and soc1 -dt-bindings: remove (), *_NUMS, reserved. -dt-bindings: remove dulipated define number -clk-ast2700: drop WARN_ON, weird comment. Ryan Chen (3): dt-bindings: clock: ast2700: modify soc0/1 clock define reset: aspeed: register AST2700 reset auxiliary bus device clk: aspeed: add AST2700 clock driver drivers/clk/Kconfig | 8 + drivers/clk/Makefile | 1 + drivers/clk/clk-ast2700.c | 1138 +++++++++++++++++ drivers/reset/Kconfig | 7 + drivers/reset/Makefile | 1 + drivers/reset/reset-aspeed.c | 253 ++++ .../dt-bindings/clock/aspeed,ast2700-scu.h | 4 + 7 files changed, 1412 insertions(+) create mode 100644 drivers/clk/clk-ast2700.c create mode 100644 drivers/reset/reset-aspeed.c -- 2.34.1 From ryan_chen at aspeedtech.com Tue Jul 8 15:29:07 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Tue, 8 Jul 2025 13:29:07 +0800 Subject: [PATCH v12 1/3] dt-bindings: clock: ast2700: modify soc0/1 clock define In-Reply-To: <20250708052909.4145983-1-ryan_chen@aspeedtech.com> References: <20250708052909.4145983-1-ryan_chen@aspeedtech.com> Message-ID: <20250708052909.4145983-2-ryan_chen@aspeedtech.com> -add SOC0_CLK_AHBMUX: add SOC0_CLK_AHBMUX for ahb clock source divide. mpll-> ahb_mux -> div_table -> clk_ahb hpll-> -new add clock: SOC0_CLK_MPHYSRC: UFS MPHY clock source. SOC0_CLK_U2PHY_REFCLKSRC: USB2.0 phy clock reference source. SOC1_CLK_I3C: I3C clock source. Signed-off-by: Ryan Chen Acked-by: Krzysztof Kozlowski --- include/dt-bindings/clock/aspeed,ast2700-scu.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/dt-bindings/clock/aspeed,ast2700-scu.h b/include/dt-bindings/clock/aspeed,ast2700-scu.h index 63021af3caf5..bacf712e8e04 100644 --- a/include/dt-bindings/clock/aspeed,ast2700-scu.h +++ b/include/dt-bindings/clock/aspeed,ast2700-scu.h @@ -68,6 +68,9 @@ #define SCU0_CLK_GATE_UFSCLK 53 #define SCU0_CLK_GATE_EMMCCLK 54 #define SCU0_CLK_GATE_RVAS1CLK 55 +#define SCU0_CLK_U2PHY_REFCLKSRC 56 +#define SCU0_CLK_AHBMUX 57 +#define SCU0_CLK_MPHYSRC 58 /* SOC1 clk */ #define SCU1_CLKIN 0 @@ -159,5 +162,6 @@ #define SCU1_CLK_GATE_PORTCUSB2CLK 84 #define SCU1_CLK_GATE_PORTDUSB2CLK 85 #define SCU1_CLK_GATE_LTPI1TXCLK 86 +#define SCU1_CLK_I3C 87 #endif -- 2.34.1 From ryan_chen at aspeedtech.com Tue Jul 8 15:29:08 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Tue, 8 Jul 2025 13:29:08 +0800 Subject: [PATCH v12 2/3] reset: aspeed: register AST2700 reset auxiliary bus device In-Reply-To: <20250708052909.4145983-1-ryan_chen@aspeedtech.com> References: <20250708052909.4145983-1-ryan_chen@aspeedtech.com> Message-ID: <20250708052909.4145983-3-ryan_chen@aspeedtech.com> The AST2700 reset driver is registered as an auxiliary device due to reset and clock controller share the same register region. Signed-off-by: Ryan Chen Reviewed-by: Philipp Zabel --- drivers/reset/Kconfig | 7 + drivers/reset/Makefile | 1 + drivers/reset/reset-aspeed.c | 253 +++++++++++++++++++++++++++++++++++ 3 files changed, 261 insertions(+) create mode 100644 drivers/reset/reset-aspeed.c diff --git a/drivers/reset/Kconfig b/drivers/reset/Kconfig index d85be5899da6..76918f714eff 100644 --- a/drivers/reset/Kconfig +++ b/drivers/reset/Kconfig @@ -22,6 +22,13 @@ config RESET_A10SR This option enables support for the external reset functions for peripheral PHYs on the Altera Arria10 System Resource Chip. +config RESET_ASPEED + tristate "ASPEED Reset Driver" + depends on ARCH_ASPEED || COMPILE_TEST + select AUXILIARY_BUS + help + This enables the reset controller driver for AST2700. + config RESET_ATH79 bool "AR71xx Reset Driver" if COMPILE_TEST default ATH79 diff --git a/drivers/reset/Makefile b/drivers/reset/Makefile index 91e6348e3351..3c40a4e44f6b 100644 --- a/drivers/reset/Makefile +++ b/drivers/reset/Makefile @@ -6,6 +6,7 @@ obj-y += starfive/ obj-y += sti/ obj-y += tegra/ obj-$(CONFIG_RESET_A10SR) += reset-a10sr.o +obj-$(CONFIG_RESET_ASPEED) += reset-aspeed.o obj-$(CONFIG_RESET_ATH79) += reset-ath79.o obj-$(CONFIG_RESET_AXS10X) += reset-axs10x.o obj-$(CONFIG_RESET_BCM6345) += reset-bcm6345.o diff --git a/drivers/reset/reset-aspeed.c b/drivers/reset/reset-aspeed.c new file mode 100644 index 000000000000..dd2f860a69d7 --- /dev/null +++ b/drivers/reset/reset-aspeed.c @@ -0,0 +1,253 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (c) 2024 ASPEED Technology Inc. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#define SCU0_RESET_CTRL1 0x200 +#define SCU0_RESET_CTRL2 0x220 +#define SCU1_RESET_CTRL1 0x200 +#define SCU1_RESET_CTRL2 0x220 +#define SCU1_PCIE3_CTRL 0x908 + +struct ast2700_reset_signal { + bool dedicated_clr; /* dedicated reset clr offset */ + u32 offset, bit; +}; + +struct aspeed_reset_info { + unsigned int nr_resets; + const struct ast2700_reset_signal *signal; +}; + +struct aspeed_reset { + struct reset_controller_dev rcdev; + struct aspeed_reset_info *info; + spinlock_t lock; /* Protect read-modify-write cycle */ + void __iomem *base; +}; + +static const struct ast2700_reset_signal ast2700_reset0_signals[] = { + [SCU0_RESET_SDRAM] = { true, SCU0_RESET_CTRL1, BIT(0) }, + [SCU0_RESET_DDRPHY] = { true, SCU0_RESET_CTRL1, BIT(1) }, + [SCU0_RESET_RSA] = { true, SCU0_RESET_CTRL1, BIT(2) }, + [SCU0_RESET_SHA3] = { true, SCU0_RESET_CTRL1, BIT(3) }, + [SCU0_RESET_HACE] = { true, SCU0_RESET_CTRL1, BIT(4) }, + [SCU0_RESET_SOC] = { true, SCU0_RESET_CTRL1, BIT(5) }, + [SCU0_RESET_VIDEO] = { true, SCU0_RESET_CTRL1, BIT(6) }, + [SCU0_RESET_2D] = { true, SCU0_RESET_CTRL1, BIT(7) }, + [SCU0_RESET_PCIS] = { true, SCU0_RESET_CTRL1, BIT(8) }, + [SCU0_RESET_RVAS0] = { true, SCU0_RESET_CTRL1, BIT(9) }, + [SCU0_RESET_RVAS1] = { true, SCU0_RESET_CTRL1, BIT(10) }, + [SCU0_RESET_SM3] = { true, SCU0_RESET_CTRL1, BIT(11) }, + [SCU0_RESET_SM4] = { true, SCU0_RESET_CTRL1, BIT(12) }, + [SCU0_RESET_CRT0] = { true, SCU0_RESET_CTRL1, BIT(13) }, + [SCU0_RESET_ECC] = { true, SCU0_RESET_CTRL1, BIT(14) }, + [SCU0_RESET_DP_PCI] = { true, SCU0_RESET_CTRL1, BIT(15) }, + [SCU0_RESET_UFS] = { true, SCU0_RESET_CTRL1, BIT(16) }, + [SCU0_RESET_EMMC] = { true, SCU0_RESET_CTRL1, BIT(17) }, + [SCU0_RESET_PCIE1RST] = { true, SCU0_RESET_CTRL1, BIT(18) }, + [SCU0_RESET_PCIE1RSTOE] = { true, SCU0_RESET_CTRL1, BIT(19) }, + [SCU0_RESET_PCIE0RST] = { true, SCU0_RESET_CTRL1, BIT(20) }, + [SCU0_RESET_PCIE0RSTOE] = { true, SCU0_RESET_CTRL1, BIT(21) }, + [SCU0_RESET_JTAG] = { true, SCU0_RESET_CTRL1, BIT(22) }, + [SCU0_RESET_MCTP0] = { true, SCU0_RESET_CTRL1, BIT(23) }, + [SCU0_RESET_MCTP1] = { true, SCU0_RESET_CTRL1, BIT(24) }, + [SCU0_RESET_XDMA0] = { true, SCU0_RESET_CTRL1, BIT(25) }, + [SCU0_RESET_XDMA1] = { true, SCU0_RESET_CTRL1, BIT(26) }, + [SCU0_RESET_H2X1] = { true, SCU0_RESET_CTRL1, BIT(27) }, + [SCU0_RESET_DP] = { true, SCU0_RESET_CTRL1, BIT(28) }, + [SCU0_RESET_DP_MCU] = { true, SCU0_RESET_CTRL1, BIT(29) }, + [SCU0_RESET_SSP] = { true, SCU0_RESET_CTRL1, BIT(30) }, + [SCU0_RESET_H2X0] = { true, SCU0_RESET_CTRL1, BIT(31) }, + [SCU0_RESET_PORTA_VHUB] = { true, SCU0_RESET_CTRL2, BIT(0) }, + [SCU0_RESET_PORTA_PHY3] = { true, SCU0_RESET_CTRL2, BIT(1) }, + [SCU0_RESET_PORTA_XHCI] = { true, SCU0_RESET_CTRL2, BIT(2) }, + [SCU0_RESET_PORTB_VHUB] = { true, SCU0_RESET_CTRL2, BIT(3) }, + [SCU0_RESET_PORTB_PHY3] = { true, SCU0_RESET_CTRL2, BIT(4) }, + [SCU0_RESET_PORTB_XHCI] = { true, SCU0_RESET_CTRL2, BIT(5) }, + [SCU0_RESET_PORTA_VHUB_EHCI] = { true, SCU0_RESET_CTRL2, BIT(6) }, + [SCU0_RESET_PORTB_VHUB_EHCI] = { true, SCU0_RESET_CTRL2, BIT(7) }, + [SCU0_RESET_UHCI] = { true, SCU0_RESET_CTRL2, BIT(8) }, + [SCU0_RESET_TSP] = { true, SCU0_RESET_CTRL2, BIT(9) }, + [SCU0_RESET_E2M0] = { true, SCU0_RESET_CTRL2, BIT(10) }, + [SCU0_RESET_E2M1] = { true, SCU0_RESET_CTRL2, BIT(11) }, + [SCU0_RESET_VLINK] = { true, SCU0_RESET_CTRL2, BIT(12) }, +}; + +static const struct ast2700_reset_signal ast2700_reset1_signals[] = { + [SCU1_RESET_LPC0] = { true, SCU1_RESET_CTRL1, BIT(0) }, + [SCU1_RESET_LPC1] = { true, SCU1_RESET_CTRL1, BIT(1) }, + [SCU1_RESET_MII] = { true, SCU1_RESET_CTRL1, BIT(2) }, + [SCU1_RESET_PECI] = { true, SCU1_RESET_CTRL1, BIT(3) }, + [SCU1_RESET_PWM] = { true, SCU1_RESET_CTRL1, BIT(4) }, + [SCU1_RESET_MAC0] = { true, SCU1_RESET_CTRL1, BIT(5) }, + [SCU1_RESET_MAC1] = { true, SCU1_RESET_CTRL1, BIT(6) }, + [SCU1_RESET_MAC2] = { true, SCU1_RESET_CTRL1, BIT(7) }, + [SCU1_RESET_ADC] = { true, SCU1_RESET_CTRL1, BIT(8) }, + [SCU1_RESET_SD] = { true, SCU1_RESET_CTRL1, BIT(9) }, + [SCU1_RESET_ESPI0] = { true, SCU1_RESET_CTRL1, BIT(10) }, + [SCU1_RESET_ESPI1] = { true, SCU1_RESET_CTRL1, BIT(11) }, + [SCU1_RESET_JTAG1] = { true, SCU1_RESET_CTRL1, BIT(12) }, + [SCU1_RESET_SPI0] = { true, SCU1_RESET_CTRL1, BIT(13) }, + [SCU1_RESET_SPI1] = { true, SCU1_RESET_CTRL1, BIT(14) }, + [SCU1_RESET_SPI2] = { true, SCU1_RESET_CTRL1, BIT(15) }, + [SCU1_RESET_I3C0] = { true, SCU1_RESET_CTRL1, BIT(16) }, + [SCU1_RESET_I3C1] = { true, SCU1_RESET_CTRL1, BIT(17) }, + [SCU1_RESET_I3C2] = { true, SCU1_RESET_CTRL1, BIT(18) }, + [SCU1_RESET_I3C3] = { true, SCU1_RESET_CTRL1, BIT(19) }, + [SCU1_RESET_I3C4] = { true, SCU1_RESET_CTRL1, BIT(20) }, + [SCU1_RESET_I3C5] = { true, SCU1_RESET_CTRL1, BIT(21) }, + [SCU1_RESET_I3C6] = { true, SCU1_RESET_CTRL1, BIT(22) }, + [SCU1_RESET_I3C7] = { true, SCU1_RESET_CTRL1, BIT(23) }, + [SCU1_RESET_I3C8] = { true, SCU1_RESET_CTRL1, BIT(24) }, + [SCU1_RESET_I3C9] = { true, SCU1_RESET_CTRL1, BIT(25) }, + [SCU1_RESET_I3C10] = { true, SCU1_RESET_CTRL1, BIT(26) }, + [SCU1_RESET_I3C11] = { true, SCU1_RESET_CTRL1, BIT(27) }, + [SCU1_RESET_I3C12] = { true, SCU1_RESET_CTRL1, BIT(28) }, + [SCU1_RESET_I3C13] = { true, SCU1_RESET_CTRL1, BIT(29) }, + [SCU1_RESET_I3C14] = { true, SCU1_RESET_CTRL1, BIT(30) }, + [SCU1_RESET_I3C15] = { true, SCU1_RESET_CTRL1, BIT(31) }, + [SCU1_RESET_MCU0] = { true, SCU1_RESET_CTRL2, BIT(0) }, + [SCU1_RESET_MCU1] = { true, SCU1_RESET_CTRL2, BIT(1) }, + [SCU1_RESET_H2A_SPI1] = { true, SCU1_RESET_CTRL2, BIT(2) }, + [SCU1_RESET_H2A_SPI2] = { true, SCU1_RESET_CTRL2, BIT(3) }, + [SCU1_RESET_UART0] = { true, SCU1_RESET_CTRL2, BIT(4) }, + [SCU1_RESET_UART1] = { true, SCU1_RESET_CTRL2, BIT(5) }, + [SCU1_RESET_UART2] = { true, SCU1_RESET_CTRL2, BIT(6) }, + [SCU1_RESET_UART3] = { true, SCU1_RESET_CTRL2, BIT(7) }, + [SCU1_RESET_I2C_FILTER] = { true, SCU1_RESET_CTRL2, BIT(8) }, + [SCU1_RESET_CALIPTRA] = { true, SCU1_RESET_CTRL2, BIT(9) }, + [SCU1_RESET_XDMA] = { true, SCU1_RESET_CTRL2, BIT(10) }, + [SCU1_RESET_FSI] = { true, SCU1_RESET_CTRL2, BIT(12) }, + [SCU1_RESET_CAN] = { true, SCU1_RESET_CTRL2, BIT(13) }, + [SCU1_RESET_MCTP] = { true, SCU1_RESET_CTRL2, BIT(14) }, + [SCU1_RESET_I2C] = { true, SCU1_RESET_CTRL2, BIT(15) }, + [SCU1_RESET_UART6] = { true, SCU1_RESET_CTRL2, BIT(16) }, + [SCU1_RESET_UART7] = { true, SCU1_RESET_CTRL2, BIT(17) }, + [SCU1_RESET_UART8] = { true, SCU1_RESET_CTRL2, BIT(18) }, + [SCU1_RESET_UART9] = { true, SCU1_RESET_CTRL2, BIT(19) }, + [SCU1_RESET_LTPI0] = { true, SCU1_RESET_CTRL2, BIT(20) }, + [SCU1_RESET_VGAL] = { true, SCU1_RESET_CTRL2, BIT(21) }, + [SCU1_RESET_LTPI1] = { true, SCU1_RESET_CTRL2, BIT(22) }, + [SCU1_RESET_ACE] = { true, SCU1_RESET_CTRL2, BIT(23) }, + [SCU1_RESET_E2M] = { true, SCU1_RESET_CTRL2, BIT(24) }, + [SCU1_RESET_UHCI] = { true, SCU1_RESET_CTRL2, BIT(25) }, + [SCU1_RESET_PORTC_USB2UART] = { true, SCU1_RESET_CTRL2, BIT(26) }, + [SCU1_RESET_PORTC_VHUB_EHCI] = { true, SCU1_RESET_CTRL2, BIT(27) }, + [SCU1_RESET_PORTD_USB2UART] = { true, SCU1_RESET_CTRL2, BIT(28) }, + [SCU1_RESET_PORTD_VHUB_EHCI] = { true, SCU1_RESET_CTRL2, BIT(29) }, + [SCU1_RESET_H2X] = { true, SCU1_RESET_CTRL2, BIT(30) }, + [SCU1_RESET_I3CDMA] = { true, SCU1_RESET_CTRL2, BIT(31) }, + [SCU1_RESET_PCIE2RST] = { false, SCU1_PCIE3_CTRL, BIT(0) }, +}; + +static inline struct aspeed_reset *to_aspeed_reset(struct reset_controller_dev *rcdev) +{ + return container_of(rcdev, struct aspeed_reset, rcdev); +} + +static int aspeed_reset_assert(struct reset_controller_dev *rcdev, unsigned long id) +{ + struct aspeed_reset *rc = to_aspeed_reset(rcdev); + void __iomem *reg_offset = rc->base + rc->info->signal[id].offset; + + if (rc->info->signal[id].dedicated_clr) { + writel(rc->info->signal[id].bit, reg_offset); + } else { + guard(spinlock_irqsave)(&rc->lock); + writel(readl(reg_offset) & ~rc->info->signal[id].bit, reg_offset); + } + + return 0; +} + +static int aspeed_reset_deassert(struct reset_controller_dev *rcdev, unsigned long id) +{ + struct aspeed_reset *rc = to_aspeed_reset(rcdev); + void __iomem *reg_offset = rc->base + rc->info->signal[id].offset; + + if (rc->info->signal[id].dedicated_clr) { + writel(rc->info->signal[id].bit, reg_offset + 0x04); + } else { + guard(spinlock_irqsave)(&rc->lock); + writel(readl(reg_offset) | rc->info->signal[id].bit, reg_offset); + } + + return 0; +} + +static int aspeed_reset_status(struct reset_controller_dev *rcdev, unsigned long id) +{ + struct aspeed_reset *rc = to_aspeed_reset(rcdev); + void __iomem *reg_offset = rc->base + rc->info->signal[id].offset; + + return (readl(reg_offset) & rc->info->signal[id].bit) ? 1 : 0; +} + +static const struct reset_control_ops aspeed_reset_ops = { + .assert = aspeed_reset_assert, + .deassert = aspeed_reset_deassert, + .status = aspeed_reset_status, +}; + +static int aspeed_reset_probe(struct auxiliary_device *adev, + const struct auxiliary_device_id *id) +{ + struct aspeed_reset *reset; + struct device *dev = &adev->dev; + + reset = devm_kzalloc(dev, sizeof(*reset), GFP_KERNEL); + if (!reset) + return -ENOMEM; + + spin_lock_init(&reset->lock); + + reset->info = (struct aspeed_reset_info *)id->driver_data; + reset->rcdev.owner = THIS_MODULE; + reset->rcdev.nr_resets = reset->info->nr_resets; + reset->rcdev.ops = &aspeed_reset_ops; + reset->rcdev.of_node = dev->parent->of_node; + reset->rcdev.dev = dev; + reset->rcdev.of_reset_n_cells = 1; + reset->base = (void __iomem *)adev->dev.platform_data; + + return devm_reset_controller_register(dev, &reset->rcdev); +} + +static const struct aspeed_reset_info ast2700_reset0_info = { + .nr_resets = ARRAY_SIZE(ast2700_reset0_signals), + .signal = ast2700_reset0_signals, +}; + +static const struct aspeed_reset_info ast2700_reset1_info = { + .nr_resets = ARRAY_SIZE(ast2700_reset1_signals), + .signal = ast2700_reset1_signals, +}; + +static const struct auxiliary_device_id aspeed_reset_ids[] = { + { .name = "clk_ast2700.reset0", .driver_data = (kernel_ulong_t)&ast2700_reset0_info }, + { .name = "clk_ast2700.reset1", .driver_data = (kernel_ulong_t)&ast2700_reset1_info }, + { } +}; +MODULE_DEVICE_TABLE(auxiliary, aspeed_reset_ids); + +static struct auxiliary_driver aspeed_reset_driver = { + .probe = aspeed_reset_probe, + .id_table = aspeed_reset_ids, +}; + +module_auxiliary_driver(aspeed_reset_driver); + +MODULE_AUTHOR("Ryan Chen "); +MODULE_DESCRIPTION("ASPEED SoC Reset Controller Driver"); +MODULE_LICENSE("GPL"); -- 2.34.1 From ryan_chen at aspeedtech.com Tue Jul 8 15:29:09 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Tue, 8 Jul 2025 13:29:09 +0800 Subject: [PATCH v12 3/3] clk: aspeed: add AST2700 clock driver In-Reply-To: <20250708052909.4145983-1-ryan_chen@aspeedtech.com> References: <20250708052909.4145983-1-ryan_chen@aspeedtech.com> Message-ID: <20250708052909.4145983-4-ryan_chen@aspeedtech.com> Add AST2700 clock controller driver and also use axiliary device framework register the reset controller driver. Due to clock and reset using the same register region. Signed-off-by: Ryan Chen --- drivers/clk/Kconfig | 8 + drivers/clk/Makefile | 1 + drivers/clk/clk-ast2700.c | 1138 +++++++++++++++++++++++++++++++++++++ 3 files changed, 1147 insertions(+) create mode 100644 drivers/clk/clk-ast2700.c diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index 19c1ed280fd7..10b67370f65d 100644 --- a/drivers/clk/Kconfig +++ b/drivers/clk/Kconfig @@ -288,6 +288,14 @@ config COMMON_CLK_ASPEED The G4 and G5 series, including the ast2400 and ast2500, are supported by this driver. +config COMMON_CLK_AST2700 + bool "Clock driver for AST2700 SoC" + depends on ARCH_ASPEED || COMPILE_TEST + help + This driver provides support for clock on AST2700 SoC. + The driver is responsible for managing the various clocks required + by the peripherals and cores within the AST2700. + config COMMON_CLK_S2MPS11 tristate "Clock driver for S2MPS1X/S5M8767 MFD" depends on MFD_SEC_CORE || COMPILE_TEST diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index 42867cd37c33..3d911b81149c 100644 --- a/drivers/clk/Makefile +++ b/drivers/clk/Makefile @@ -63,6 +63,7 @@ obj-$(CONFIG_COMMON_CLK_FSL_SAI) += clk-fsl-sai.o obj-$(CONFIG_COMMON_CLK_GEMINI) += clk-gemini.o obj-$(CONFIG_COMMON_CLK_ASPEED) += clk-aspeed.o obj-$(CONFIG_MACH_ASPEED_G6) += clk-ast2600.o +obj-$(CONFIG_COMMON_CLK_AST2700) += clk-ast2700.o obj-$(CONFIG_ARCH_HIGHBANK) += clk-highbank.o obj-$(CONFIG_CLK_HSDK) += clk-hsdk-pll.o obj-$(CONFIG_COMMON_CLK_K210) += clk-k210.o diff --git a/drivers/clk/clk-ast2700.c b/drivers/clk/clk-ast2700.c new file mode 100644 index 000000000000..c6d77e3f4ace --- /dev/null +++ b/drivers/clk/clk-ast2700.c @@ -0,0 +1,1138 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2024 ASPEED Technology Inc. + * Author: Ryan Chen + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define SCU_CLK_12MHZ (12 * HZ_PER_MHZ) +#define SCU_CLK_24MHZ (24 * HZ_PER_MHZ) +#define SCU_CLK_25MHZ (25 * HZ_PER_MHZ) +#define SCU_CLK_192MHZ (192 * HZ_PER_MHZ) + +/* SOC0 */ +#define SCU0_HWSTRAP1 0x010 +#define SCU0_CLK_STOP 0x240 +#define SCU0_CLK_SEL1 0x280 +#define SCU0_CLK_SEL2 0x284 +#define GET_USB_REFCLK_DIV(x) ((GENMASK(23, 20) & (x)) >> 20) +#define UART_DIV13_EN BIT(30) +#define SCU0_HPLL_PARAM 0x300 +#define SCU0_DPLL_PARAM 0x308 +#define SCU0_MPLL_PARAM 0x310 +#define SCU0_D0CLK_PARAM 0x320 +#define SCU0_D1CLK_PARAM 0x330 +#define SCU0_CRT0CLK_PARAM 0x340 +#define SCU0_CRT1CLK_PARAM 0x350 +#define SCU0_MPHYCLK_PARAM 0x360 + +/* SOC1 */ +#define SCU1_REVISION_ID 0x0 +#define REVISION_ID GENMASK(23, 16) +#define SCU1_CLK_STOP 0x240 +#define SCU1_CLK_STOP2 0x260 +#define SCU1_CLK_SEL1 0x280 +#define SCU1_CLK_SEL2 0x284 +#define SCU1_CLK_I3C_DIV_MASK GENMASK(25, 23) +#define SCU1_CLK_I3C_DIV(n) ((n) - 1) +#define UXCLK_MASK GENMASK(1, 0) +#define HUXCLK_MASK GENMASK(4, 3) +#define SCU1_HPLL_PARAM 0x300 +#define SCU1_APLL_PARAM 0x310 +#define SCU1_DPLL_PARAM 0x320 +#define SCU1_UXCLK_CTRL 0x330 +#define SCU1_HUXCLK_CTRL 0x334 +#define SCU1_MAC12_CLK_DLY 0x390 +#define SCU1_MAC12_CLK_DLY_100M 0x394 +#define SCU1_MAC12_CLK_DLY_10M 0x398 + +enum ast2700_clk_type { + CLK_MUX, + CLK_PLL, + CLK_HPLL, + CLK_GATE, + CLK_MISC, + CLK_FIXED, + DCLK_FIXED, + CLK_DIVIDER, + CLK_UART_PLL, + CLK_FIXED_FACTOR, + CLK_GATE_ASPEED, +}; + +struct ast2700_clk_fixed_factor_data { + const struct clk_parent_data *parent; + unsigned int mult; + unsigned int div; +}; + +struct ast2700_clk_gate_data { + const struct clk_parent_data *parent; + u32 flags; + u32 reg; + u8 bit; +}; + +struct ast2700_clk_mux_data { + const struct clk_parent_data *parents; + unsigned int num_parents; + u8 bit_shift; + u8 bit_width; + u32 reg; +}; + +struct ast2700_clk_div_data { + const struct clk_div_table *div_table; + const struct clk_parent_data *parent; + u8 bit_shift; + u8 bit_width; + u32 reg; +}; + +struct ast2700_clk_pll_data { + const struct clk_parent_data *parent; + u32 reg; +}; + +struct ast2700_clk_fixed_rate_data { + unsigned long fixed_rate; +}; + +struct ast2700_clk_info { + const char *name; + u8 clk_idx; + u32 reg; + u32 type; + union { + struct ast2700_clk_fixed_factor_data factor; + struct ast2700_clk_fixed_rate_data rate; + struct ast2700_clk_gate_data gate; + struct ast2700_clk_div_data div; + struct ast2700_clk_pll_data pll; + struct ast2700_clk_mux_data mux; + } data; +}; + +struct ast2700_clk_data { + struct ast2700_clk_info const *clk_info; + unsigned int nr_clks; + const int scu; +}; + +struct ast2700_clk_ctrl { + const struct ast2700_clk_data *clk_data; + struct device *dev; + void __iomem *base; + spinlock_t lock; /* clk lock */ +}; + +static const struct clk_div_table ast2700_rgmii_div_table[] = { + { 0x0, 4 }, + { 0x1, 4 }, + { 0x2, 6 }, + { 0x3, 8 }, + { 0x4, 10 }, + { 0x5, 12 }, + { 0x6, 14 }, + { 0x7, 16 }, + { 0 } +}; + +static const struct clk_div_table ast2700_rmii_div_table[] = { + { 0x0, 8 }, + { 0x1, 8 }, + { 0x2, 12 }, + { 0x3, 16 }, + { 0x4, 20 }, + { 0x5, 24 }, + { 0x6, 28 }, + { 0x7, 32 }, + { 0 } +}; + +static const struct clk_div_table ast2700_clk_div_table[] = { + { 0x0, 2 }, + { 0x1, 2 }, + { 0x2, 3 }, + { 0x3, 4 }, + { 0x4, 5 }, + { 0x5, 6 }, + { 0x6, 7 }, + { 0x7, 8 }, + { 0 } +}; + +static const struct clk_div_table ast2700_clk_div_table2[] = { + { 0x0, 2 }, + { 0x1, 4 }, + { 0x2, 6 }, + { 0x3, 8 }, + { 0x4, 10 }, + { 0x5, 12 }, + { 0x6, 14 }, + { 0x7, 16 }, + { 0 } +}; + +static const struct clk_div_table ast2700_hclk_div_table[] = { + { 0x0, 6 }, + { 0x1, 5 }, + { 0x2, 4 }, + { 0x3, 7 }, + { 0 } +}; + +static const struct clk_div_table ast2700_clk_uart_div_table[] = { + { 0x0, 1 }, + { 0x1, 13 }, + { 0 } +}; + +static const struct clk_parent_data soc0_clkin[] = { + { .fw_name = "soc0-clkin", .name = "soc0-clkin" }, +}; + +static const struct clk_parent_data pspclk[] = { + { .fw_name = "pspclk", .name = "pspclk" }, +}; + +static const struct clk_parent_data mphysrc[] = { + { .fw_name = "mphysrc", .name = "mphysrc" }, +}; + +static const struct clk_parent_data u2phy_refclksrc[] = { + { .fw_name = "u2phy_refclksrc", .name = "u2phy_refclksrc" }, +}; + +static const struct clk_parent_data soc0_hpll[] = { + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, +}; + +static const struct clk_parent_data soc0_mpll[] = { + { .fw_name = "soc0-mpll", .name = "soc0-mpll" }, +}; + +static const struct clk_parent_data axi0clk[] = { + { .fw_name = "axi0clk", .name = "axi0clk" }, +}; + +static const struct clk_parent_data soc0_ahbmux[] = { + { .fw_name = "soc0-ahbmux", .name = "soc0-ahbmux" }, +}; + +static const struct clk_parent_data soc0_uartclk[] = { + { .fw_name = "soc0-uartclk", .name = "soc0-uartclk" }, +}; + +static const struct clk_parent_data emmcclk[] = { + { .fw_name = "emmcclk", .name = "emmcclk" }, +}; + +static const struct clk_parent_data emmcsrc_mux[] = { + { .fw_name = "emmcsrc-mux", .name = "emmcsrc-mux" }, +}; + +static const struct clk_parent_data soc1_clkin[] = { + { .fw_name = "soc1-clkin", .name = "soc1-clkin" }, +}; + +static const struct clk_parent_data soc1_hpll[] = { + { .fw_name = "soc1-hpll", .name = "soc1-hpll" }, +}; + +static const struct clk_parent_data soc1_apll[] = { + { .fw_name = "soc1-apll", .name = "soc1-apll" }, +}; + +static const struct clk_parent_data sdclk[] = { + { .fw_name = "sdclk", .name = "sdclk" }, +}; + +static const struct clk_parent_data sdclk_mux[] = { + { .fw_name = "sdclk-mux", .name = "sdclk-mux" }, +}; + +static const struct clk_parent_data huartxclk[] = { + { .fw_name = "huartxclk", .name = "huartxclk" }, +}; + +static const struct clk_parent_data uxclk[] = { + { .fw_name = "uxclk", .name = "uxclk" }, +}; + +static const struct clk_parent_data huxclk[] = { + { .fw_name = "huxclk", .name = "huxclk" }, +}; + +static const struct clk_parent_data uart0clk[] = { + { .fw_name = "uart0clk", .name = "uart0clk" }, +}; + +static const struct clk_parent_data uart1clk[] = { + { .fw_name = "uart1clk", .name = "uart1clk" }, +}; + +static const struct clk_parent_data uart2clk[] = { + { .fw_name = "uart2clk", .name = "uart2clk" }, +}; + +static const struct clk_parent_data uart3clk[] = { + { .fw_name = "uart3clk", .name = "uart3clk" }, +}; + +static const struct clk_parent_data uart5clk[] = { + { .fw_name = "uart5clk", .name = "uart5clk" }, +}; + +static const struct clk_parent_data uart4clk[] = { + { .fw_name = "uart4clk", .name = "uart4clk" }, +}; + +static const struct clk_parent_data uart6clk[] = { + { .fw_name = "uart6clk", .name = "uart6clk" }, +}; + +static const struct clk_parent_data uart7clk[] = { + { .fw_name = "uart7clk", .name = "uart7clk" }, +}; + +static const struct clk_parent_data uart8clk[] = { + { .fw_name = "uart8clk", .name = "uart8clk" }, +}; + +static const struct clk_parent_data uart9clk[] = { + { .fw_name = "uart9clk", .name = "uart9clk" }, +}; + +static const struct clk_parent_data uart10clk[] = { + { .fw_name = "uart10clk", .name = "uart10clk" }, +}; + +static const struct clk_parent_data uart11clk[] = { + { .fw_name = "uart11clk", .name = "uart11clk" }, +}; + +static const struct clk_parent_data uart12clk[] = { + { .fw_name = "uart12clk", .name = "uart12clk" }, +}; + +static const struct clk_parent_data uart13clk[] = { + { .fw_name = "uart13clk", .name = "uart13clk" }, +}; + +static const struct clk_parent_data uart14clk[] = { + { .fw_name = "uart14clk", .name = "uart14clk" }, +}; + +static const struct clk_parent_data soc1_i3c[] = { + { .fw_name = "soc1-i3c", .name = "soc1-i3c" }, +}; + +static const struct clk_parent_data canclk[] = { + { .fw_name = "canclk", .name = "canclk" }, +}; + +static const struct clk_parent_data rmii[] = { + { .fw_name = "rmii", .name = "rmii" }, +}; + +static const struct clk_parent_data hclk_clk_sels[] = { + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, + { .fw_name = "soc0-mpll", .name = "soc0-mpll" }, +}; + +static const struct clk_parent_data mhpll_clk_sels[] = { + { .fw_name = "soc0-mpll", .name = "soc0-mpll" }, + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, +}; + +static const struct clk_parent_data mphy_clk_sels[] = { + { .fw_name = "soc0-mpll", .name = "soc0-mpll" }, + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, + { .fw_name = "soc0-dpll", .name = "soc0-dpll" }, + { .fw_name = "soc0-clk192Mhz", .name = "soc0-clk192Mhz" }, +}; + +static const struct clk_parent_data psp_clk_sels[] = { + { .fw_name = "soc0-mpll", .name = "soc0-mpll" }, + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, + { .fw_name = "soc0-mpll_div2", .name = "soc0-mpll_div2" }, + { .fw_name = "soc0-hpll_div2", .name = "soc0-hpll_div2" }, + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, +}; + +static const struct clk_parent_data uart_clk_sels[] = { + { .fw_name = "soc0-clk24Mhz", .name = "soc0-clk24Mhz" }, + { .fw_name = "soc0-clk192Mhz", .name = "soc0-clk192Mhz" }, +}; + +static const struct clk_parent_data emmc_clk_sels[] = { + { .fw_name = "soc0-mpll_div4", .name = "soc0-mpll_div4" }, + { .fw_name = "soc0-hpll_div4", .name = "soc0-hpll_div4" }, +}; + +static const struct clk_parent_data sdio_clk_sels[] = { + { .fw_name = "soc1-hpll", .name = "soc1-hpll" }, + { .fw_name = "soc1-apll", .name = "soc1-apll" }, +}; + +static const struct clk_parent_data ux_clk_sels[] = { + { .fw_name = "soc1-apll_div4", .name = "soc1-apll_div4" }, + { .fw_name = "soc1-apll_div2", .name = "soc1-apll_div2" }, + { .fw_name = "soc1-apll", .name = "soc1-apll" }, + { .fw_name = "soc1-hpll", .name = "soc1-hpll" }, +}; + +static const struct clk_parent_data uartx_clk_sels[] = { + { .fw_name = "uartxclk", .name = "uartxclk" }, + { .fw_name = "huartxclk", .name = "huartxclk" }, +}; + +#define FIXED_CLK(_id, _name, _rate) \ + [_id] = { \ + .type = CLK_FIXED, \ + .name = _name, \ + .data = { .rate = { .fixed_rate = _rate, } }, \ + } + +#define PLL_CLK(_id, _type, _name, _parent, _reg) \ + [_id] = { \ + .type = _type, \ + .name = _name, \ + .data = { .pll = { .parent = _parent, .reg = _reg, } }, \ + } + +#define MUX_CLK(_id, _name, _parents, _num_parents, _reg, _shift, _width) \ + [_id] = { \ + .type = CLK_MUX, \ + .name = _name, \ + .data = { \ + .mux = { \ + .parents = _parents, \ + .num_parents = _num_parents, \ + .reg = _reg, \ + .bit_shift = _shift, \ + .bit_width = _width, \ + }, \ + }, \ + } + +#define DIVIDER_CLK(_id, _name, _parent, _reg, _shift, _width, _div_table) \ + [_id] = { \ + .type = CLK_DIVIDER, \ + .name = _name, \ + .data = { \ + .div = { \ + .parent = _parent, \ + .reg = _reg, \ + .bit_shift = _shift, \ + .bit_width = _width, \ + .div_table = _div_table, \ + }, \ + }, \ + } + +#define FIXED_FACTOR_CLK(_id, _name, _parent, _mult, _div) \ + [_id] = { \ + .type = CLK_FIXED_FACTOR, \ + .name = _name, \ + .data = { .factor = { .parent = _parent, .mult = _mult, .div = _div, } }, \ + } + +#define GATE_CLK(_id, _type, _name, _parent, _reg, _bit, _flags) \ + [_id] = { \ + .type = _type, \ + .name = _name, \ + .data = { \ + .gate = { \ + .parent = _parent, \ + .reg = _reg, \ + .bit = _bit, \ + .flags = _flags, \ + }, \ + }, \ + } + +static const struct ast2700_clk_info ast2700_scu0_clk_info[] __initconst = { + FIXED_CLK(SCU0_CLKIN, "soc0-clkin", SCU_CLK_25MHZ), + FIXED_CLK(SCU0_CLK_24M, "soc0-clk24Mhz", SCU_CLK_24MHZ), + FIXED_CLK(SCU0_CLK_192M, "soc0-clk192Mhz", SCU_CLK_192MHZ), + FIXED_CLK(SCU0_CLK_U2PHY_CLK12M, "u2phy_clk12m", SCU_CLK_12MHZ), + PLL_CLK(SCU0_CLK_HPLL, CLK_HPLL, "soc0-hpll", soc0_clkin, SCU0_HPLL_PARAM), + PLL_CLK(SCU0_CLK_DPLL, CLK_PLL, "soc0-dpll", soc0_clkin, SCU0_DPLL_PARAM), + PLL_CLK(SCU0_CLK_MPLL, CLK_PLL, "soc0-mpll", soc0_clkin, SCU0_MPLL_PARAM), + PLL_CLK(SCU0_CLK_D0, DCLK_FIXED, "d0clk", NULL, SCU0_D0CLK_PARAM), + PLL_CLK(SCU0_CLK_D1, DCLK_FIXED, "d1clk", NULL, SCU0_D1CLK_PARAM), + PLL_CLK(SCU0_CLK_CRT0, DCLK_FIXED, "crt0clk", NULL, SCU0_CRT0CLK_PARAM), + PLL_CLK(SCU0_CLK_CRT1, DCLK_FIXED, "crt1clk", NULL, SCU0_CRT1CLK_PARAM), + PLL_CLK(SCU0_CLK_MPHY, CLK_MISC, "mphyclk", mphysrc, SCU0_MPHYCLK_PARAM), + PLL_CLK(SCU0_CLK_U2PHY_REFCLK, CLK_MISC, "u2phy_refclk", u2phy_refclksrc, SCU0_CLK_SEL2), + FIXED_FACTOR_CLK(SCU0_CLK_HPLL_DIV2, "soc0-hpll_div2", soc0_hpll, 1, 2), + FIXED_FACTOR_CLK(SCU0_CLK_HPLL_DIV4, "soc0-hpll_div4", soc0_hpll, 1, 4), + FIXED_FACTOR_CLK(SCU0_CLK_MPLL_DIV2, "soc0-mpll_div2", soc0_mpll, 1, 2), + FIXED_FACTOR_CLK(SCU0_CLK_MPLL_DIV4, "soc0-mpll_div4", soc0_mpll, 1, 4), + FIXED_FACTOR_CLK(SCU0_CLK_MPLL_DIV8, "soc0-mpll_div8", soc0_mpll, 1, 8), + FIXED_FACTOR_CLK(SCU0_CLK_AXI0, "axi0clk", pspclk, 1, 2), + FIXED_FACTOR_CLK(SCU0_CLK_AXI1, "axi1clk", soc0_mpll, 1, 4), + DIVIDER_CLK(SCU0_CLK_AHB, "soc0-ahb", soc0_ahbmux, + SCU0_HWSTRAP1, 5, 2, ast2700_hclk_div_table), + DIVIDER_CLK(SCU0_CLK_EMMC, "emmcclk", emmcsrc_mux, + SCU0_CLK_SEL1, 12, 3, ast2700_clk_div_table2), + DIVIDER_CLK(SCU0_CLK_APB, "soc0-apb", axi0clk, + SCU0_CLK_SEL1, 23, 3, ast2700_clk_div_table2), + DIVIDER_CLK(SCU0_CLK_UART4, "uart4clk", soc0_uartclk, + SCU0_CLK_SEL2, 30, 1, ast2700_clk_uart_div_table), + DIVIDER_CLK(SCU0_CLK_HPLL_DIV_AHB, "soc0-hpll-ahb", soc0_hpll, + SCU0_HWSTRAP1, 5, 2, ast2700_hclk_div_table), + DIVIDER_CLK(SCU0_CLK_MPLL_DIV_AHB, "soc0-mpll-ahb", soc0_mpll, + SCU0_HWSTRAP1, 5, 2, ast2700_hclk_div_table), + MUX_CLK(SCU0_CLK_PSP, "pspclk", psp_clk_sels, ARRAY_SIZE(psp_clk_sels), + SCU0_HWSTRAP1, 2, 3), + MUX_CLK(SCU0_CLK_AHBMUX, "soc0-ahbmux", hclk_clk_sels, ARRAY_SIZE(hclk_clk_sels), + SCU0_HWSTRAP1, 7, 1), + MUX_CLK(SCU0_CLK_EMMCMUX, "emmcsrc-mux", emmc_clk_sels, ARRAY_SIZE(emmc_clk_sels), + SCU0_CLK_SEL1, 11, 1), + MUX_CLK(SCU0_CLK_MPHYSRC, "mphysrc", mphy_clk_sels, ARRAY_SIZE(mphy_clk_sels), + SCU0_CLK_SEL2, 18, 2), + MUX_CLK(SCU0_CLK_U2PHY_REFCLKSRC, "u2phy_refclksrc", mhpll_clk_sels, + ARRAY_SIZE(mhpll_clk_sels), SCU0_CLK_SEL2, 23, 1), + MUX_CLK(SCU0_CLK_UART, "soc0-uartclk", uart_clk_sels, ARRAY_SIZE(uart_clk_sels), + SCU0_CLK_SEL2, 14, 1), + GATE_CLK(SCU0_CLK_GATE_MCLK, CLK_GATE_ASPEED, "mclk-gate", soc0_mpll, + SCU0_CLK_STOP, 0, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_ECLK, CLK_GATE_ASPEED, "eclk-gate", NULL, SCU0_CLK_STOP, 1, 0), + GATE_CLK(SCU0_CLK_GATE_2DCLK, CLK_GATE_ASPEED, "gclk-gate", NULL, SCU0_CLK_STOP, 2, 0), + GATE_CLK(SCU0_CLK_GATE_VCLK, CLK_GATE_ASPEED, "vclk-gate", NULL, SCU0_CLK_STOP, 3, 0), + GATE_CLK(SCU0_CLK_GATE_BCLK, CLK_GATE_ASPEED, "bclk-gate", NULL, + SCU0_CLK_STOP, 4, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_VGA0CLK, CLK_GATE_ASPEED, "vga0clk-gate", NULL, + SCU0_CLK_STOP, 5, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_REFCLK, CLK_GATE_ASPEED, "soc0-refclk-gate", soc0_clkin, + SCU0_CLK_STOP, 6, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_PORTBUSB2CLK, CLK_GATE_ASPEED, "portb-usb2clk-gate", NULL, + SCU0_CLK_STOP, 7, 0), + GATE_CLK(SCU0_CLK_GATE_UHCICLK, CLK_GATE_ASPEED, "uhciclk-gate", NULL, SCU0_CLK_STOP, 9, 0), + GATE_CLK(SCU0_CLK_GATE_VGA1CLK, CLK_GATE_ASPEED, "vga1clk-gate", NULL, + SCU0_CLK_STOP, 10, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_DDRPHYCLK, CLK_GATE_ASPEED, "ddrphy-gate", NULL, + SCU0_CLK_STOP, 11, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_E2M0CLK, CLK_GATE_ASPEED, "e2m0clk-gate", NULL, + SCU0_CLK_STOP, 12, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_HACCLK, CLK_GATE_ASPEED, "hacclk-gate", NULL, SCU0_CLK_STOP, 13, 0), + GATE_CLK(SCU0_CLK_GATE_PORTAUSB2CLK, CLK_GATE_ASPEED, "porta-usb2clk-gate", NULL, + SCU0_CLK_STOP, 14, 0), + GATE_CLK(SCU0_CLK_GATE_UART4CLK, CLK_GATE_ASPEED, "uart4clk-gate", uart4clk, + SCU0_CLK_STOP, 15, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_SLICLK, CLK_GATE_ASPEED, "soc0-sliclk-gate", NULL, + SCU0_CLK_STOP, 16, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_DACCLK, CLK_GATE_ASPEED, "dacclk-gate", NULL, + SCU0_CLK_STOP, 17, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_DP, CLK_GATE_ASPEED, "dpclk-gate", NULL, + SCU0_CLK_STOP, 18, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_E2M1CLK, CLK_GATE_ASPEED, "e2m1clk-gate", NULL, + SCU0_CLK_STOP, 19, CLK_IS_CRITICAL), + GATE_CLK(SCU0_CLK_GATE_CRT0CLK, CLK_GATE_ASPEED, "crt0clk-gate", NULL, + SCU0_CLK_STOP, 20, 0), + GATE_CLK(SCU0_CLK_GATE_CRT1CLK, CLK_GATE_ASPEED, "crt1clk-gate", NULL, + SCU0_CLK_STOP, 21, 0), + GATE_CLK(SCU0_CLK_GATE_ECDSACLK, CLK_GATE_ASPEED, "eccclk-gate", NULL, + SCU0_CLK_STOP, 23, 0), + GATE_CLK(SCU0_CLK_GATE_RSACLK, CLK_GATE_ASPEED, "rsaclk-gate", NULL, + SCU0_CLK_STOP, 24, 0), + GATE_CLK(SCU0_CLK_GATE_RVAS0CLK, CLK_GATE_ASPEED, "rvas0clk-gate", NULL, + SCU0_CLK_STOP, 25, 0), + GATE_CLK(SCU0_CLK_GATE_UFSCLK, CLK_GATE_ASPEED, "ufsclk-gate", NULL, + SCU0_CLK_STOP, 26, 0), + GATE_CLK(SCU0_CLK_GATE_EMMCCLK, CLK_GATE_ASPEED, "emmcclk-gate", emmcclk, + SCU0_CLK_STOP, 27, 0), + GATE_CLK(SCU0_CLK_GATE_RVAS1CLK, CLK_GATE_ASPEED, "rvas1clk-gate", NULL, + SCU0_CLK_STOP, 28, 0), +}; + +static const struct ast2700_clk_info ast2700_scu1_clk_info[] __initconst = { + FIXED_CLK(SCU1_CLKIN, "soc1-clkin", SCU_CLK_25MHZ), + PLL_CLK(SCU1_CLK_HPLL, CLK_PLL, "soc1-hpll", soc1_clkin, SCU1_HPLL_PARAM), + PLL_CLK(SCU1_CLK_APLL, CLK_PLL, "soc1-apll", soc1_clkin, SCU1_APLL_PARAM), + PLL_CLK(SCU1_CLK_DPLL, CLK_PLL, "soc1-dpll", soc1_clkin, SCU1_DPLL_PARAM), + PLL_CLK(SCU1_CLK_UARTX, CLK_UART_PLL, "uartxclk", uxclk, SCU1_UXCLK_CTRL), + PLL_CLK(SCU1_CLK_HUARTX, CLK_UART_PLL, "huartxclk", huxclk, SCU1_HUXCLK_CTRL), + FIXED_FACTOR_CLK(SCU1_CLK_APLL_DIV2, "soc1-apll_div2", soc1_apll, 1, 2), + FIXED_FACTOR_CLK(SCU1_CLK_APLL_DIV4, "soc1-apll_div4", soc1_apll, 1, 4), + FIXED_FACTOR_CLK(SCU1_CLK_UART13, "uart13clk", huartxclk, 1, 1), + FIXED_FACTOR_CLK(SCU1_CLK_UART14, "uart14clk", huartxclk, 1, 1), + FIXED_FACTOR_CLK(SCU1_CLK_CAN, "canclk", soc1_apll, 1, 10), + DIVIDER_CLK(SCU1_CLK_SDCLK, "sdclk", sdclk_mux, + SCU1_CLK_SEL1, 14, 3, ast2700_clk_div_table), + DIVIDER_CLK(SCU1_CLK_APB, "soc1-apb", soc1_hpll, + SCU1_CLK_SEL1, 18, 3, ast2700_clk_div_table2), + DIVIDER_CLK(SCU1_CLK_RMII, "rmii", soc1_hpll, + SCU1_CLK_SEL1, 21, 3, ast2700_rmii_div_table), + DIVIDER_CLK(SCU1_CLK_RGMII, "rgmii", soc1_hpll, + SCU1_CLK_SEL1, 25, 3, ast2700_rgmii_div_table), + DIVIDER_CLK(SCU1_CLK_MACHCLK, "machclk", soc1_hpll, + SCU1_CLK_SEL1, 29, 3, ast2700_clk_div_table), + DIVIDER_CLK(SCU1_CLK_APLL_DIVN, "soc1-apll_divn", soc1_apll, + SCU1_CLK_SEL2, 8, 3, ast2700_clk_div_table), + DIVIDER_CLK(SCU1_CLK_AHB, "soc1-ahb", soc1_hpll, + SCU1_CLK_SEL2, 20, 3, ast2700_clk_div_table), + DIVIDER_CLK(SCU1_CLK_I3C, "soc1-i3c", soc1_hpll, + SCU1_CLK_SEL2, 23, 3, ast2700_clk_div_table), + MUX_CLK(SCU1_CLK_UART0, "uart0clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 0, 1), + MUX_CLK(SCU1_CLK_UART1, "uart1clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 1, 1), + MUX_CLK(SCU1_CLK_UART2, "uart2clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 2, 1), + MUX_CLK(SCU1_CLK_UART3, "uart3clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 3, 1), + MUX_CLK(SCU1_CLK_UART5, "uart5clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 5, 1), + MUX_CLK(SCU1_CLK_UART6, "uart6clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 6, 1), + MUX_CLK(SCU1_CLK_UART7, "uart7clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 7, 1), + MUX_CLK(SCU1_CLK_UART8, "uart8clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 8, 1), + MUX_CLK(SCU1_CLK_UART9, "uart9clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 9, 1), + MUX_CLK(SCU1_CLK_UART10, "uart10clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 10, 1), + MUX_CLK(SCU1_CLK_UART11, "uart11clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 11, 1), + MUX_CLK(SCU1_CLK_UART12, "uart12clk", uartx_clk_sels, ARRAY_SIZE(uartx_clk_sels), + SCU1_CLK_SEL1, 12, 1), + MUX_CLK(SCU1_CLK_SDMUX, "sdclk-mux", sdio_clk_sels, ARRAY_SIZE(sdio_clk_sels), + SCU1_CLK_SEL1, 13, 1), + MUX_CLK(SCU1_CLK_UXCLK, "uxclk", ux_clk_sels, ARRAY_SIZE(ux_clk_sels), + SCU1_CLK_SEL2, 0, 2), + MUX_CLK(SCU1_CLK_HUXCLK, "huxclk", ux_clk_sels, ARRAY_SIZE(ux_clk_sels), + SCU1_CLK_SEL2, 3, 2), + GATE_CLK(SCU1_CLK_MAC0RCLK, CLK_GATE, "mac0rclk-gate", rmii, SCU1_MAC12_CLK_DLY, 29, 0), + GATE_CLK(SCU1_CLK_MAC1RCLK, CLK_GATE, "mac1rclk-gate", rmii, SCU1_MAC12_CLK_DLY, 30, 0), + GATE_CLK(SCU1_CLK_GATE_LCLK0, CLK_GATE_ASPEED, "lclk0-gate", NULL, + SCU1_CLK_STOP, 0, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_LCLK1, CLK_GATE_ASPEED, "lclk1-gate", NULL, + SCU1_CLK_STOP, 1, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_ESPI0CLK, CLK_GATE_ASPEED, "espi0clk-gate", NULL, + SCU1_CLK_STOP, 2, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_ESPI1CLK, CLK_GATE_ASPEED, "espi1clk-gate", NULL, + SCU1_CLK_STOP, 3, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_SDCLK, CLK_GATE_ASPEED, "sdclk-gate", sdclk, + SCU1_CLK_STOP, 4, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_IPEREFCLK, CLK_GATE_ASPEED, "soc1-iperefclk-gate", NULL, + SCU1_CLK_STOP, 5, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_REFCLK, CLK_GATE_ASPEED, "soc1-refclk-gate", NULL, + SCU1_CLK_STOP, 6, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_LPCHCLK, CLK_GATE_ASPEED, "lpchclk-gate", NULL, + SCU1_CLK_STOP, 7, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_MAC0CLK, CLK_GATE_ASPEED, "mac0clk-gate", NULL, + SCU1_CLK_STOP, 8, 0), + GATE_CLK(SCU1_CLK_GATE_MAC1CLK, CLK_GATE_ASPEED, "mac1clk-gate", NULL, + SCU1_CLK_STOP, 9, 0), + GATE_CLK(SCU1_CLK_GATE_MAC2CLK, CLK_GATE_ASPEED, "mac2clk-gate", NULL, + SCU1_CLK_STOP, 10, 0), + GATE_CLK(SCU1_CLK_GATE_UART0CLK, CLK_GATE_ASPEED, "uart0clk-gate", uart0clk, + SCU1_CLK_STOP, 11, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_UART1CLK, CLK_GATE_ASPEED, "uart1clk-gate", uart1clk, + SCU1_CLK_STOP, 12, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_UART2CLK, CLK_GATE_ASPEED, "uart2clk-gate", uart2clk, + SCU1_CLK_STOP, 13, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_UART3CLK, CLK_GATE_ASPEED, "uart3clk-gate", uart3clk, + SCU1_CLK_STOP, 14, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_I2CCLK, CLK_GATE_ASPEED, "i2cclk-gate", NULL, SCU1_CLK_STOP, 15, 0), + GATE_CLK(SCU1_CLK_GATE_I3C0CLK, CLK_GATE_ASPEED, "i3c0clk-gate", soc1_i3c, + SCU1_CLK_STOP, 16, 0), + GATE_CLK(SCU1_CLK_GATE_I3C1CLK, CLK_GATE_ASPEED, "i3c1clk-gate", soc1_i3c, + SCU1_CLK_STOP, 17, 0), + GATE_CLK(SCU1_CLK_GATE_I3C2CLK, CLK_GATE_ASPEED, "i3c2clk-gate", soc1_i3c, + SCU1_CLK_STOP, 18, 0), + GATE_CLK(SCU1_CLK_GATE_I3C3CLK, CLK_GATE_ASPEED, "i3c3clk-gate", soc1_i3c, + SCU1_CLK_STOP, 19, 0), + GATE_CLK(SCU1_CLK_GATE_I3C4CLK, CLK_GATE_ASPEED, "i3c4clk-gate", soc1_i3c, + SCU1_CLK_STOP, 20, 0), + GATE_CLK(SCU1_CLK_GATE_I3C5CLK, CLK_GATE_ASPEED, "i3c5clk-gate", soc1_i3c, + SCU1_CLK_STOP, 21, 0), + GATE_CLK(SCU1_CLK_GATE_I3C6CLK, CLK_GATE_ASPEED, "i3c6clk-gate", soc1_i3c, + SCU1_CLK_STOP, 22, 0), + GATE_CLK(SCU1_CLK_GATE_I3C7CLK, CLK_GATE_ASPEED, "i3c7clk-gate", soc1_i3c, + SCU1_CLK_STOP, 23, 0), + GATE_CLK(SCU1_CLK_GATE_I3C8CLK, CLK_GATE_ASPEED, "i3c8clk-gate", soc1_i3c, + SCU1_CLK_STOP, 24, 0), + GATE_CLK(SCU1_CLK_GATE_I3C9CLK, CLK_GATE_ASPEED, "i3c9clk-gate", soc1_i3c, + SCU1_CLK_STOP, 25, 0), + GATE_CLK(SCU1_CLK_GATE_I3C10CLK, CLK_GATE_ASPEED, "i3c10clk-gate", soc1_i3c, + SCU1_CLK_STOP, 26, 0), + GATE_CLK(SCU1_CLK_GATE_I3C11CLK, CLK_GATE_ASPEED, "i3c11clk-gate", soc1_i3c, + SCU1_CLK_STOP, 27, 0), + GATE_CLK(SCU1_CLK_GATE_I3C12CLK, CLK_GATE_ASPEED, "i3c12clk-gate", soc1_i3c, + SCU1_CLK_STOP, 28, 0), + GATE_CLK(SCU1_CLK_GATE_I3C13CLK, CLK_GATE_ASPEED, "i3c13clk-gate", soc1_i3c, + SCU1_CLK_STOP, 29, 0), + GATE_CLK(SCU1_CLK_GATE_I3C14CLK, CLK_GATE_ASPEED, "i3c14clk-gate", soc1_i3c, + SCU1_CLK_STOP, 30, 0), + GATE_CLK(SCU1_CLK_GATE_I3C15CLK, CLK_GATE_ASPEED, "i3c15clk-gate", soc1_i3c, + SCU1_CLK_STOP, 31, 0), + GATE_CLK(SCU1_CLK_GATE_UART5CLK, CLK_GATE_ASPEED, "uart5clk-gate", uart5clk, + SCU1_CLK_STOP2, 0, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_UART6CLK, CLK_GATE_ASPEED, "uart6clk-gate", uart6clk, + SCU1_CLK_STOP2, 1, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_UART7CLK, CLK_GATE_ASPEED, "uart7clk-gate", uart7clk, + SCU1_CLK_STOP2, 2, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_UART8CLK, CLK_GATE_ASPEED, "uart8clk-gate", uart8clk, + SCU1_CLK_STOP2, 3, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_UART9CLK, CLK_GATE_ASPEED, "uart9clk-gate", uart9clk, + SCU1_CLK_STOP2, 4, 0), + GATE_CLK(SCU1_CLK_GATE_UART10CLK, CLK_GATE_ASPEED, "uart10clk-gate", uart10clk, + SCU1_CLK_STOP2, 5, 0), + GATE_CLK(SCU1_CLK_GATE_UART11CLK, CLK_GATE_ASPEED, "uart11clk-gate", uart11clk, + SCU1_CLK_STOP2, 6, 0), + GATE_CLK(SCU1_CLK_GATE_UART12CLK, CLK_GATE_ASPEED, "uart12clk-gate", uart12clk, + SCU1_CLK_STOP2, 7, 0), + GATE_CLK(SCU1_CLK_GATE_FSICLK, CLK_GATE_ASPEED, "fsiclk-gate", NULL, SCU1_CLK_STOP2, 8, 0), + GATE_CLK(SCU1_CLK_GATE_LTPIPHYCLK, CLK_GATE_ASPEED, "ltpiphyclk-gate", NULL, + SCU1_CLK_STOP2, 9, 0), + GATE_CLK(SCU1_CLK_GATE_LTPICLK, CLK_GATE_ASPEED, "ltpiclk-gate", NULL, + SCU1_CLK_STOP2, 10, 0), + GATE_CLK(SCU1_CLK_GATE_VGALCLK, CLK_GATE_ASPEED, "vgalclk-gate", NULL, + SCU1_CLK_STOP2, 11, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_UHCICLK, CLK_GATE_ASPEED, "usbuartclk-gate", NULL, + SCU1_CLK_STOP2, 12, 0), + GATE_CLK(SCU1_CLK_GATE_CANCLK, CLK_GATE_ASPEED, "canclk-gate", canclk, + SCU1_CLK_STOP2, 13, 0), + GATE_CLK(SCU1_CLK_GATE_PCICLK, CLK_GATE_ASPEED, "pciclk-gate", NULL, + SCU1_CLK_STOP2, 14, 0), + GATE_CLK(SCU1_CLK_GATE_SLICLK, CLK_GATE_ASPEED, "soc1-sliclk-gate", NULL, + SCU1_CLK_STOP2, 15, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_E2MCLK, CLK_GATE_ASPEED, "soc1-e2m-gate", NULL, + SCU1_CLK_STOP2, 16, CLK_IS_CRITICAL), + GATE_CLK(SCU1_CLK_GATE_PORTCUSB2CLK, CLK_GATE_ASPEED, "portcusb2-gate", NULL, + SCU1_CLK_STOP2, 17, 0), + GATE_CLK(SCU1_CLK_GATE_PORTDUSB2CLK, CLK_GATE_ASPEED, "portdusb2-gate", NULL, + SCU1_CLK_STOP2, 18, 0), + GATE_CLK(SCU1_CLK_GATE_LTPI1TXCLK, CLK_GATE_ASPEED, "ltp1tx-gate", NULL, + SCU1_CLK_STOP2, 19, 0), +}; + +static struct clk_hw *ast2700_clk_hw_register_hpll(void __iomem *reg, + const char *name, const char *parent_name, + struct ast2700_clk_ctrl *clk_ctrl) +{ + unsigned int mult, div; + u32 val; + + val = readl(clk_ctrl->base + SCU0_HWSTRAP1); + if ((readl(clk_ctrl->base) & REVISION_ID) && (val & BIT(3))) { + switch ((val & GENMASK(4, 2)) >> 2) { + case 2: + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, NULL, + 0, 1800 * HZ_PER_MHZ); + case 3: + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, NULL, + 0, 1700 * HZ_PER_MHZ); + case 6: + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, NULL, + 0, 1200 * HZ_PER_MHZ); + case 7: + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, NULL, + 0, 800 * HZ_PER_MHZ); + default: + return ERR_PTR(-EINVAL); + } + } else if ((val & GENMASK(3, 2)) != 0) { + switch ((val & GENMASK(3, 2)) >> 2) { + case 1: + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, NULL, + 0, 1900 * HZ_PER_MHZ); + case 2: + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, NULL, + 0, 1800 * HZ_PER_MHZ); + case 3: + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, NULL, + 0, 1700 * HZ_PER_MHZ); + default: + return ERR_PTR(-EINVAL); + } + } else { + val = readl(reg); + + if (val & BIT(24)) { + /* Pass through mode */ + mult = 1; + div = 1; + } else { + u32 m = val & 0x1fff; + u32 n = (val >> 13) & 0x3f; + u32 p = (val >> 19) & 0xf; + + mult = (m + 1) / (2 * (n + 1)); + div = (p + 1); + } + } + + return devm_clk_hw_register_fixed_factor(clk_ctrl->dev, name, parent_name, 0, mult, div); +} + +static struct clk_hw *ast2700_clk_hw_register_pll(int clk_idx, void __iomem *reg, + const char *name, const char *parent_name, + struct ast2700_clk_ctrl *clk_ctrl) +{ + int scu = clk_ctrl->clk_data->scu; + unsigned int mult, div; + u32 val = readl(reg); + + if (val & BIT(24)) { + /* Pass through mode */ + mult = 1; + div = 1; + } else { + u32 m = val & 0x1fff; + u32 n = (val >> 13) & 0x3f; + u32 p = (val >> 19) & 0xf; + + if (scu) { + mult = (m + 1) / (n + 1); + div = (p + 1); + } else { + if (clk_idx == SCU0_CLK_MPLL) { + mult = m / (n + 1); + div = (p + 1); + } else { + mult = (m + 1) / (2 * (n + 1)); + div = (p + 1); + } + } + } + + return devm_clk_hw_register_fixed_factor(clk_ctrl->dev, name, parent_name, 0, mult, div); +} + +static struct clk_hw *ast2700_clk_hw_register_dclk(void __iomem *reg, const char *name, + struct ast2700_clk_ctrl *clk_ctrl) +{ + unsigned int mult, div, r, n; + u32 xdclk; + u32 val; + + val = readl(clk_ctrl->base + 0x284); + if (val & BIT(29)) + xdclk = 800 * HZ_PER_MHZ; + else + xdclk = 1000 * HZ_PER_MHZ; + + val = readl(reg); + r = val & GENMASK(15, 0); + n = (val >> 16) & GENMASK(15, 0); + mult = r; + div = 2 * n; + + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, NULL, 0, (xdclk * mult) / div); +} + +static struct clk_hw *ast2700_clk_hw_register_uartpll(void __iomem *reg, + const char *name, const char *parent_name, + struct ast2700_clk_ctrl *clk_ctrl) +{ + unsigned int mult, div; + u32 val = readl(reg); + u32 r = val & 0xff; + u32 n = (val >> 8) & 0x3ff; + + mult = r; + div = n * 2; + + return devm_clk_hw_register_fixed_factor(clk_ctrl->dev, name, + parent_name, 0, mult, div); +} + +static struct clk_hw *ast2700_clk_hw_register_misc(int clk_idx, void __iomem *reg, + const char *name, const char *parent_name, + struct ast2700_clk_ctrl *clk_ctrl) +{ + u32 div = 0; + + if (clk_idx == SCU0_CLK_MPHY) { + div = readl(reg) + 1; + } else if (clk_idx == SCU0_CLK_U2PHY_REFCLK) { + if (readl(clk_ctrl->base) & REVISION_ID) + div = (GET_USB_REFCLK_DIV(readl(reg)) + 1) << 4; + else + div = (GET_USB_REFCLK_DIV(readl(reg)) + 1) << 1; + } else { + return ERR_PTR(-EINVAL); + } + + return devm_clk_hw_register_fixed_factor(clk_ctrl->dev, name, + parent_name, 0, 1, div); +} + +static int ast2700_clk_is_enabled(struct clk_hw *hw) +{ + struct clk_gate *gate = to_clk_gate(hw); + u32 clk = BIT(gate->bit_idx); + u32 reg; + + reg = readl(gate->reg); + + return !(reg & clk); +} + +static int ast2700_clk_enable(struct clk_hw *hw) +{ + struct clk_gate *gate = to_clk_gate(hw); + u32 clk = BIT(gate->bit_idx); + + if (readl(gate->reg) & clk) + writel(clk, gate->reg + 0x04); + + return 0; +} + +static void ast2700_clk_disable(struct clk_hw *hw) +{ + struct clk_gate *gate = to_clk_gate(hw); + u32 clk = BIT(gate->bit_idx); + + /* Clock is set to enable, so use write to set register */ + writel(clk, gate->reg); +} + +static const struct clk_ops ast2700_clk_gate_ops = { + .enable = ast2700_clk_enable, + .disable = ast2700_clk_disable, + .is_enabled = ast2700_clk_is_enabled, +}; + +static struct clk_hw *ast2700_clk_hw_register_gate(struct device *dev, const char *name, + const struct clk_parent_data *parent, + void __iomem *reg, u8 clock_idx, + unsigned long clk_gate_flags, spinlock_t *lock) +{ + struct clk_gate *gate; + struct clk_hw *hw; + struct clk_init_data init; + int ret = -EINVAL; + + gate = kzalloc(sizeof(*gate), GFP_KERNEL); + if (!gate) + return ERR_PTR(-ENOMEM); + + init.name = name; + init.ops = &ast2700_clk_gate_ops; + init.flags = clk_gate_flags; + init.parent_names = parent ? &parent->name : NULL; + init.num_parents = parent ? 1 : 0; + + gate->reg = reg; + gate->bit_idx = clock_idx; + gate->flags = 0; + gate->lock = lock; + gate->hw.init = &init; + + hw = &gate->hw; + ret = clk_hw_register(dev, hw); + if (ret) { + kfree(gate); + hw = ERR_PTR(ret); + } + + return hw; +} + +static void ast2700_soc1_configure_i3c_clk(struct ast2700_clk_ctrl *clk_ctrl) +{ + if (readl(clk_ctrl->base + SCU1_REVISION_ID) & REVISION_ID) + /* I3C 250MHz = HPLL/4 */ + writel((readl(clk_ctrl->base + SCU1_CLK_SEL2) & + ~SCU1_CLK_I3C_DIV_MASK) | + FIELD_PREP(SCU1_CLK_I3C_DIV_MASK, + SCU1_CLK_I3C_DIV(4)), + clk_ctrl->base + SCU1_CLK_SEL2); +} + +static int ast2700_soc_clk_probe(struct platform_device *pdev) +{ + const struct ast2700_clk_data *clk_data; + struct clk_hw_onecell_data *clk_hw_data; + struct ast2700_clk_ctrl *clk_ctrl; + struct device *dev = &pdev->dev; + struct auxiliary_device *adev; + void __iomem *clk_base; + struct clk_hw **hws; + char *reset_name; + int ret; + int i; + + clk_ctrl = devm_kzalloc(dev, sizeof(*clk_ctrl), GFP_KERNEL); + if (!clk_ctrl) + return -ENOMEM; + clk_ctrl->dev = dev; + dev_set_drvdata(&pdev->dev, clk_ctrl); + + spin_lock_init(&clk_ctrl->lock); + + clk_base = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(clk_base)) + return PTR_ERR(clk_base); + + clk_ctrl->base = clk_base; + + clk_data = device_get_match_data(dev); + if (!clk_data) + return -ENODEV; + + clk_ctrl->clk_data = clk_data; + reset_name = devm_kasprintf(dev, GFP_KERNEL, "reset%d", clk_data->scu); + + clk_hw_data = devm_kzalloc(dev, struct_size(clk_hw_data, hws, clk_data->nr_clks), + GFP_KERNEL); + if (!clk_hw_data) + return -ENOMEM; + + clk_hw_data->num = clk_data->nr_clks; + hws = clk_hw_data->hws; + + if (clk_data->scu) + ast2700_soc1_configure_i3c_clk(clk_ctrl); + + for (i = 0; i < clk_data->nr_clks; i++) { + const struct ast2700_clk_info *clk = &clk_data->clk_info[i]; + void __iomem *reg; + + if (clk->type == CLK_FIXED) { + const struct ast2700_clk_fixed_rate_data *fixed_rate = &clk->data.rate; + + hws[i] = devm_clk_hw_register_fixed_rate(dev, clk->name, NULL, 0, + fixed_rate->fixed_rate); + } else if (clk->type == CLK_FIXED_FACTOR) { + const struct ast2700_clk_fixed_factor_data *factor = &clk->data.factor; + + hws[i] = devm_clk_hw_register_fixed_factor(dev, clk->name, + factor->parent->name, + 0, factor->mult, factor->div); + } else if (clk->type == DCLK_FIXED) { + const struct ast2700_clk_pll_data *pll = &clk->data.pll; + + reg = clk_ctrl->base + pll->reg; + hws[i] = ast2700_clk_hw_register_dclk(reg, clk->name, clk_ctrl); + } else if (clk->type == CLK_HPLL) { + const struct ast2700_clk_pll_data *pll = &clk->data.pll; + + reg = clk_ctrl->base + pll->reg; + hws[i] = ast2700_clk_hw_register_hpll(reg, clk->name, + pll->parent->name, clk_ctrl); + } else if (clk->type == CLK_PLL) { + const struct ast2700_clk_pll_data *pll = &clk->data.pll; + + reg = clk_ctrl->base + pll->reg; + hws[i] = ast2700_clk_hw_register_pll(i, reg, clk->name, + pll->parent->name, clk_ctrl); + } else if (clk->type == CLK_UART_PLL) { + const struct ast2700_clk_pll_data *pll = &clk->data.pll; + + reg = clk_ctrl->base + pll->reg; + hws[i] = ast2700_clk_hw_register_uartpll(reg, clk->name, + pll->parent->name, clk_ctrl); + } else if (clk->type == CLK_MUX) { + const struct ast2700_clk_mux_data *mux = &clk->data.mux; + + reg = clk_ctrl->base + mux->reg; + hws[i] = devm_clk_hw_register_mux_parent_data_table(dev, clk->name, + mux->parents, + mux->num_parents, 0, + reg, mux->bit_shift, + mux->bit_width, 0, + NULL, &clk_ctrl->lock); + } else if (clk->type == CLK_MISC) { + const struct ast2700_clk_pll_data *misc = &clk->data.pll; + + reg = clk_ctrl->base + misc->reg; + hws[i] = ast2700_clk_hw_register_misc(i, reg, clk->name, + misc->parent->name, clk_ctrl); + } else if (clk->type == CLK_DIVIDER) { + const struct ast2700_clk_div_data *div = &clk->data.div; + + reg = clk_ctrl->base + div->reg; + hws[i] = devm_clk_hw_register_divider_table(dev, clk->name, + div->parent->name, 0, + reg, div->bit_shift, + div->bit_width, 0, + div->div_table, + &clk_ctrl->lock); + } else if (clk->type == CLK_GATE_ASPEED) { + const struct ast2700_clk_gate_data *gate = &clk->data.gate; + + reg = clk_ctrl->base + gate->reg; + hws[i] = ast2700_clk_hw_register_gate(dev, clk->name, gate->parent, + reg, gate->bit, gate->flags, + &clk_ctrl->lock); + + } else { + const struct ast2700_clk_gate_data *gate = &clk->data.gate; + + reg = clk_ctrl->base + gate->reg; + hws[i] = devm_clk_hw_register_gate_parent_data(dev, clk->name, gate->parent, + 0, reg, clk->clk_idx, 0, + &clk_ctrl->lock); + } + + if (IS_ERR(hws[i])) + return PTR_ERR(hws[i]); + } + + ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, clk_hw_data); + if (ret) + return ret; + + adev = devm_auxiliary_device_create(dev, reset_name, (__force void *)clk_base); + if (!adev) + return -ENODEV; + + return 0; +} + +static const struct ast2700_clk_data ast2700_clk0_data = { + .scu = 0, + .nr_clks = ARRAY_SIZE(ast2700_scu0_clk_info), + .clk_info = ast2700_scu0_clk_info, +}; + +static const struct ast2700_clk_data ast2700_clk1_data = { + .scu = 1, + .nr_clks = ARRAY_SIZE(ast2700_scu1_clk_info), + .clk_info = ast2700_scu1_clk_info, +}; + +static const struct of_device_id ast2700_scu_match[] = { + { .compatible = "aspeed,ast2700-scu0", .data = &ast2700_clk0_data }, + { .compatible = "aspeed,ast2700-scu1", .data = &ast2700_clk1_data }, + { /* sentinel */ } +}; + +MODULE_DEVICE_TABLE(of, ast2700_scu_match); + +static struct platform_driver ast2700_scu_driver = { + .probe = ast2700_soc_clk_probe, + .driver = { + .name = "clk-ast2700", + .of_match_table = ast2700_scu_match, + }, +}; + +static int __init clk_ast2700_init(void) +{ + return platform_driver_register(&ast2700_scu_driver); +} +arch_initcall(clk_ast2700_init); -- 2.34.1 From krzk at kernel.org Tue Jul 8 17:50:00 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Tue, 8 Jul 2025 09:50:00 +0200 Subject: [net-next v3 1/4] dt-bindings: net: ftgmac100: Add resets property In-Reply-To: <20250708065544.201896-2-jacky_chou@aspeedtech.com> References: <20250708065544.201896-1-jacky_chou@aspeedtech.com> <20250708065544.201896-2-jacky_chou@aspeedtech.com> Message-ID: <20250708-termite-of-legal-imagination-826a9d@krzk-bin> On Tue, Jul 08, 2025 at 02:55:41PM +0800, Jacky Chou wrote: > Add optional resets property for Aspeed SoCs to reset the MAC and s/Aspeed SoCs/Aspeed AST2600 SoCs/ > RGMII/RMII. ... because ? It was missing? Incomplete? You changed hardware? Make the commits useful, explain WHY you are doing, not repeating WHAT you are doing. What is obvious from the diff. You already got this feedback with other patches. > > Signed-off-by: Jacky Chou > --- > .../bindings/net/faraday,ftgmac100.yaml | 23 ++++++++++++++++--- > 1 file changed, 20 insertions(+), 3 deletions(-) > > diff --git a/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml b/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml > index 55d6a8379025..a2e7d439074a 100644 > --- a/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml > +++ b/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml > @@ -6,9 +6,6 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# > > title: Faraday Technology FTGMAC100 gigabit ethernet controller > > -allOf: > - - $ref: ethernet-controller.yaml# > - > maintainers: > - Po-Yu Chuang > > @@ -35,6 +32,11 @@ properties: > - description: MAC IP clock > - description: RMII RCLK gate for AST2500/2600 > > + resets: > + maxItems: 1 > + description: > + Optional reset control for the MAC controller Drop description, redundant and obvious form the schema. It cannot be a reset for anything else than MAC controller, because this is the MAC controller. It cannot be "non optional" because schema says it is optional. Write concise and USEFUL descriptions/commit messages, not just something to satisfy line/patch count. Best regards, Krzysztof From robh at kernel.org Tue Jul 8 22:25:22 2025 From: robh at kernel.org (Rob Herring (Arm)) Date: Tue, 8 Jul 2025 07:25:22 -0500 Subject: [PATCH v6 1/2] dt-bindings: arm: aspeed: add Meta Clemente board In-Reply-To: <20250708-add-support-for-meta-clemente-bmc-v6-1-7f3e57bd0336@fii-foxconn.com> References: <20250708-add-support-for-meta-clemente-bmc-v6-0-7f3e57bd0336@fii-foxconn.com> <20250708-add-support-for-meta-clemente-bmc-v6-1-7f3e57bd0336@fii-foxconn.com> Message-ID: <175197750014.297501.9917698963252838372.robh@kernel.org> On Tue, 08 Jul 2025 18:18:00 +0800, Leo Wang wrote: > From: Leo Wang > > Document the new compatibles used on Meta Clemente. > > Signed-off-by: Leo Wang > --- > Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + > 1 file changed, 1 insertion(+) > Please add Acked-by/Reviewed-by tags when posting new versions. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for acks received on the version they apply. If a tag was not added on purpose, please state why and what changed. Missing tags: Acked-by: Conor Dooley From robh at kernel.org Tue Jul 8 23:23:36 2025 From: robh at kernel.org (Rob Herring (Arm)) Date: Tue, 08 Jul 2025 08:23:36 -0500 Subject: [PATCH v6 0/2] ARM: dts: Add support for Meta Clemente BMC In-Reply-To: <20250708-add-support-for-meta-clemente-bmc-v6-0-7f3e57bd0336@fii-foxconn.com> References: <20250708-add-support-for-meta-clemente-bmc-v6-0-7f3e57bd0336@fii-foxconn.com> Message-ID: <175198090815.436996.783632066057009711.robh@kernel.org> On Tue, 08 Jul 2025 18:17:59 +0800, Leo Wang wrote: > This series adds initial support for the Meta Clemente BMC based on the > ASPEED AST2600 SoC. > > Patch 1 documents the compatible string. > Patch 2 adds the device tree for the board. > > Signed-off-by: Leo Wang > --- > Changes in v6: > - Correct Author email to match Signed-off-by email address. > - Link to v5: https://lore.kernel.org/r/20250627-add-support-for-meta-clemente-bmc-v5-0-038ed6f1cb9f at fii-foxconn.com > > Changes in v5: > - Remove accidentally pasted texts. > - Link to v4: https://lore.kernel.org/r/20250627-add-support-for-meta-clemente-bmc-v4-0-ce7ff23460c4 at fii-foxconn.com > > Changes in v4: > - Move properties of nodes defined in the same file from label ref back to where they belong. > - Move pinctrl default configs for ncsi3 and ncsi4 to aspeed-g6-pinctrl.dtsi. > - Add properties to i2c10 and i2c15 to enable MCTP. > - Link to v3: https://lore.kernel.org/r/20250623-add-support-for-meta-clemente-bmc-v3-0-c223ffcf46cf at fii-foxconn.com > > Changes in v3: > - Modify leakage sensor to reflect current design. > - Link to v2: https://lore.kernel.org/r/20250621-add-support-for-meta-clemente-bmc-v2-0-6c5ef059149c at fii-foxconn.com > > Changes in v2: > - Fix patch 1/2 subject line to match dt-bindings convention. > - Reorder device tree nodes in patch 2/2 to follow upstream DTS style. > - Link to v1: https://lore.kernel.org/r/20250618-add-support-for-meta-clemente-bmc-v1-0-e5ca669ee47b at fii-foxconn.com > > --- > Leo Wang (2): > dt-bindings: arm: aspeed: add Meta Clemente board > ARM: dts: aspeed: clemente: add Meta Clemente BMC > > .../devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + > arch/arm/boot/dts/aspeed/Makefile | 1 + > .../dts/aspeed/aspeed-bmc-facebook-clemente.dts | 1291 ++++++++++++++++++++ > arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi | 11 + > 4 files changed, 1304 insertions(+) > --- > base-commit: 52da431bf03b5506203bca27fe14a97895c80faf > change-id: 20250618-add-support-for-meta-clemente-bmc-941a469bc523 > > Best regards, > -- > Leo Wang > > > My bot found new DTB warnings on the .dts files added or changed in this series. Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments. If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date: pip3 install dtschema --upgrade This patch series was applied (using b4) to base: Base: using specified base-commit 52da431bf03b5506203bca27fe14a97895c80faf If this is not the correct base, please add 'base-commit' tag (or use b4 which does this automatically) New warnings running 'make CHECK_DTBS=y for arch/arm/boot/dts/aspeed/' for 20250708-add-support-for-meta-clemente-bmc-v6-0-7f3e57bd0336 at fii-foxconn.com: arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: timer (arm,armv7-timer): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/timer/arm,arch_timer.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /sdram at 1e6e0000: failed to match any schema with compatible: ['aspeed,ast2600-sdram-edac', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: bus at 1e600000 (aspeed,ast2600-ahbc): compatible: ['aspeed,ast2600-ahbc', 'syscon'] is too long from schema $id: http://devicetree.org/schemas/bus/aspeed,ast2600-ahbc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: syscon at 1e6e2000 (aspeed,ast2600-scu): 'smp-memram at 180' does not match any of the regexes: '^interrupt-controller@[0-9a-f]+$', '^p2a-control@[0-9a-f]+$', '^pinctrl(@[0-9a-f]+)?$', '^pinctrl-[0-9]+$', '^silicon-id@[0-9a-f]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed,ast2x00-scu.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/syscon at 1e6e2000/smp-memram at 180: failed to match any schema with compatible: ['aspeed,ast2600-smpmem'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/display at 1e6e6000: failed to match any schema with compatible: ['aspeed,ast2600-gfx', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: adc at 1e6e9000 (aspeed,ast2600-adc0): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: adc at 1e6e9100 (aspeed,ast2600-adc1): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: crypto at 1e6fa000 (aspeed,ast2600-acry): 'aspeed,ahbc' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/crypto/aspeed,ast2600-acry.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/timer at 1e782000: failed to match any schema with compatible: ['aspeed,ast2600-timer'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): reg-io-width: 4 is not of type 'object' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): lpc-snoop at 80: 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: kcs at 24 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: kcs at 28 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: kcs at 2c (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: kcs at 114 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/lpc at 1e789000/lhc at a0: failed to match any schema with compatible: ['aspeed,ast2600-lhc'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/lpc at 1e789000/ibt at 140: failed to match any schema with compatible: ['aspeed,ast2600-ibt-bmc'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740100:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740200:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740100: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740200: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: adc at 34 (maxim,max1363): '#address-cells', '#size-cells', 'channel at 0', 'channel at 1', 'channel at 2', 'channel at 3' do not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/maxim,max1363.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: adc at 35 (maxim,max1363): '#address-cells', '#size-cells', 'channel at 0', 'channel at 1', 'channel at 2', 'channel at 3' do not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/maxim,max1363.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: fsi at 1e79b000 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/fsi at 1e79b000: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: fsi at 1e79b100 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/fsi at 1e79b100: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/dma-controller at 1e79e000: failed to match any schema with compatible: ['aspeed,ast2600-udma'] From ryan_chen at aspeedtech.com Wed Jul 9 16:41:21 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Wed, 9 Jul 2025 06:41:21 +0000 Subject: [PATCH v12 3/3] clk: aspeed: add AST2700 clock driver In-Reply-To: <20250708052909.4145983-4-ryan_chen@aspeedtech.com> References: <20250708052909.4145983-1-ryan_chen@aspeedtech.com> <20250708052909.4145983-4-ryan_chen@aspeedtech.com> Message-ID: Hello Stephen, sorry to bother you, do you have time to review this patch? Ryan > -----Original Message----- > From: Ryan Chen > Sent: Tuesday, July 8, 2025 1:29 PM > To: Ryan Chen ; Michael Turquette > ; Stephen Boyd ; Philipp Zabel > ; Joel Stanley ; Andrew Jeffery > ; Rob Herring ; Krzysztof > Kozlowski ; Conor Dooley ; > linux-clk at vger.kernel.org; linux-arm-kernel at lists.infradead.org; > linux-aspeed at lists.ozlabs.org; devicetree at vger.kernel.org; > linux-kernel at vger.kernel.org; Mo Elbadry ; Rom > Lemarchand ; William Kennington ; > Yuxiao Zhang ; wthai at nvidia.com; > leohu at nvidia.com; dkodihalli at nvidia.com; spuranik at nvidia.com > Subject: [PATCH v12 3/3] clk: aspeed: add AST2700 clock driver > > Add AST2700 clock controller driver and also use axiliary device framework > register the reset controller driver. > Due to clock and reset using the same register region. > > Signed-off-by: Ryan Chen > --- > drivers/clk/Kconfig | 8 + > drivers/clk/Makefile | 1 + > drivers/clk/clk-ast2700.c | 1138 > +++++++++++++++++++++++++++++++++++++ > 3 files changed, 1147 insertions(+) > create mode 100644 drivers/clk/clk-ast2700.c > > diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index > 19c1ed280fd7..10b67370f65d 100644 > --- a/drivers/clk/Kconfig > +++ b/drivers/clk/Kconfig > @@ -288,6 +288,14 @@ config COMMON_CLK_ASPEED > The G4 and G5 series, including the ast2400 and ast2500, are > supported > by this driver. > > +config COMMON_CLK_AST2700 > + bool "Clock driver for AST2700 SoC" > + depends on ARCH_ASPEED || COMPILE_TEST > + help > + This driver provides support for clock on AST2700 SoC. > + The driver is responsible for managing the various clocks required > + by the peripherals and cores within the AST2700. > + > config COMMON_CLK_S2MPS11 > tristate "Clock driver for S2MPS1X/S5M8767 MFD" > depends on MFD_SEC_CORE || COMPILE_TEST diff --git > a/drivers/clk/Makefile b/drivers/clk/Makefile index > 42867cd37c33..3d911b81149c 100644 > --- a/drivers/clk/Makefile > +++ b/drivers/clk/Makefile > @@ -63,6 +63,7 @@ obj-$(CONFIG_COMMON_CLK_FSL_SAI) += clk-fsl-sai.o > obj-$(CONFIG_COMMON_CLK_GEMINI) += clk-gemini.o > obj-$(CONFIG_COMMON_CLK_ASPEED) += clk-aspeed.o > obj-$(CONFIG_MACH_ASPEED_G6) += clk-ast2600.o > +obj-$(CONFIG_COMMON_CLK_AST2700) += clk-ast2700.o > obj-$(CONFIG_ARCH_HIGHBANK) += clk-highbank.o > obj-$(CONFIG_CLK_HSDK) += clk-hsdk-pll.o > obj-$(CONFIG_COMMON_CLK_K210) += clk-k210.o > diff --git a/drivers/clk/clk-ast2700.c b/drivers/clk/clk-ast2700.c new file mode > 100644 index 000000000000..c6d77e3f4ace > --- /dev/null > +++ b/drivers/clk/clk-ast2700.c > @@ -0,0 +1,1138 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Copyright (c) 2024 ASPEED Technology Inc. > + * Author: Ryan Chen */ #include > + #include #include > + #include #include > + #include #include > + #include #include > + > + > +#include > + > +#define SCU_CLK_12MHZ (12 * HZ_PER_MHZ) > +#define SCU_CLK_24MHZ (24 * HZ_PER_MHZ) > +#define SCU_CLK_25MHZ (25 * HZ_PER_MHZ) > +#define SCU_CLK_192MHZ (192 * HZ_PER_MHZ) > + > +/* SOC0 */ > +#define SCU0_HWSTRAP1 0x010 > +#define SCU0_CLK_STOP 0x240 > +#define SCU0_CLK_SEL1 0x280 > +#define SCU0_CLK_SEL2 0x284 > +#define GET_USB_REFCLK_DIV(x) ((GENMASK(23, 20) & (x)) >> 20) > +#define UART_DIV13_EN BIT(30) > +#define SCU0_HPLL_PARAM 0x300 > +#define SCU0_DPLL_PARAM 0x308 > +#define SCU0_MPLL_PARAM 0x310 > +#define SCU0_D0CLK_PARAM 0x320 > +#define SCU0_D1CLK_PARAM 0x330 > +#define SCU0_CRT0CLK_PARAM 0x340 > +#define SCU0_CRT1CLK_PARAM 0x350 > +#define SCU0_MPHYCLK_PARAM 0x360 > + > +/* SOC1 */ > +#define SCU1_REVISION_ID 0x0 > +#define REVISION_ID GENMASK(23, 16) > +#define SCU1_CLK_STOP 0x240 > +#define SCU1_CLK_STOP2 0x260 > +#define SCU1_CLK_SEL1 0x280 > +#define SCU1_CLK_SEL2 0x284 > +#define SCU1_CLK_I3C_DIV_MASK GENMASK(25, 23) > +#define SCU1_CLK_I3C_DIV(n) ((n) - 1) > +#define UXCLK_MASK GENMASK(1, 0) > +#define HUXCLK_MASK GENMASK(4, 3) > +#define SCU1_HPLL_PARAM 0x300 > +#define SCU1_APLL_PARAM 0x310 > +#define SCU1_DPLL_PARAM 0x320 > +#define SCU1_UXCLK_CTRL 0x330 > +#define SCU1_HUXCLK_CTRL 0x334 > +#define SCU1_MAC12_CLK_DLY 0x390 > +#define SCU1_MAC12_CLK_DLY_100M 0x394 > +#define SCU1_MAC12_CLK_DLY_10M 0x398 > + > +enum ast2700_clk_type { > + CLK_MUX, > + CLK_PLL, > + CLK_HPLL, > + CLK_GATE, > + CLK_MISC, > + CLK_FIXED, > + DCLK_FIXED, > + CLK_DIVIDER, > + CLK_UART_PLL, > + CLK_FIXED_FACTOR, > + CLK_GATE_ASPEED, > +}; > + > +struct ast2700_clk_fixed_factor_data { > + const struct clk_parent_data *parent; > + unsigned int mult; > + unsigned int div; > +}; > + > +struct ast2700_clk_gate_data { > + const struct clk_parent_data *parent; > + u32 flags; > + u32 reg; > + u8 bit; > +}; > + > +struct ast2700_clk_mux_data { > + const struct clk_parent_data *parents; > + unsigned int num_parents; > + u8 bit_shift; > + u8 bit_width; > + u32 reg; > +}; > + > +struct ast2700_clk_div_data { > + const struct clk_div_table *div_table; > + const struct clk_parent_data *parent; > + u8 bit_shift; > + u8 bit_width; > + u32 reg; > +}; > + > +struct ast2700_clk_pll_data { > + const struct clk_parent_data *parent; > + u32 reg; > +}; > + > +struct ast2700_clk_fixed_rate_data { > + unsigned long fixed_rate; > +}; > + > +struct ast2700_clk_info { > + const char *name; > + u8 clk_idx; > + u32 reg; > + u32 type; > + union { > + struct ast2700_clk_fixed_factor_data factor; > + struct ast2700_clk_fixed_rate_data rate; > + struct ast2700_clk_gate_data gate; > + struct ast2700_clk_div_data div; > + struct ast2700_clk_pll_data pll; > + struct ast2700_clk_mux_data mux; > + } data; > +}; > + > +struct ast2700_clk_data { > + struct ast2700_clk_info const *clk_info; > + unsigned int nr_clks; > + const int scu; > +}; > + > +struct ast2700_clk_ctrl { > + const struct ast2700_clk_data *clk_data; > + struct device *dev; > + void __iomem *base; > + spinlock_t lock; /* clk lock */ > +}; > + > +static const struct clk_div_table ast2700_rgmii_div_table[] = { > + { 0x0, 4 }, > + { 0x1, 4 }, > + { 0x2, 6 }, > + { 0x3, 8 }, > + { 0x4, 10 }, > + { 0x5, 12 }, > + { 0x6, 14 }, > + { 0x7, 16 }, > + { 0 } > +}; > + > +static const struct clk_div_table ast2700_rmii_div_table[] = { > + { 0x0, 8 }, > + { 0x1, 8 }, > + { 0x2, 12 }, > + { 0x3, 16 }, > + { 0x4, 20 }, > + { 0x5, 24 }, > + { 0x6, 28 }, > + { 0x7, 32 }, > + { 0 } > +}; > + > +static const struct clk_div_table ast2700_clk_div_table[] = { > + { 0x0, 2 }, > + { 0x1, 2 }, > + { 0x2, 3 }, > + { 0x3, 4 }, > + { 0x4, 5 }, > + { 0x5, 6 }, > + { 0x6, 7 }, > + { 0x7, 8 }, > + { 0 } > +}; > + > +static const struct clk_div_table ast2700_clk_div_table2[] = { > + { 0x0, 2 }, > + { 0x1, 4 }, > + { 0x2, 6 }, > + { 0x3, 8 }, > + { 0x4, 10 }, > + { 0x5, 12 }, > + { 0x6, 14 }, > + { 0x7, 16 }, > + { 0 } > +}; > + > +static const struct clk_div_table ast2700_hclk_div_table[] = { > + { 0x0, 6 }, > + { 0x1, 5 }, > + { 0x2, 4 }, > + { 0x3, 7 }, > + { 0 } > +}; > + > +static const struct clk_div_table ast2700_clk_uart_div_table[] = { > + { 0x0, 1 }, > + { 0x1, 13 }, > + { 0 } > +}; > + > +static const struct clk_parent_data soc0_clkin[] = { > + { .fw_name = "soc0-clkin", .name = "soc0-clkin" }, }; > + > +static const struct clk_parent_data pspclk[] = { > + { .fw_name = "pspclk", .name = "pspclk" }, }; > + > +static const struct clk_parent_data mphysrc[] = { > + { .fw_name = "mphysrc", .name = "mphysrc" }, }; > + > +static const struct clk_parent_data u2phy_refclksrc[] = { > + { .fw_name = "u2phy_refclksrc", .name = "u2phy_refclksrc" }, }; > + > +static const struct clk_parent_data soc0_hpll[] = { > + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, }; > + > +static const struct clk_parent_data soc0_mpll[] = { > + { .fw_name = "soc0-mpll", .name = "soc0-mpll" }, }; > + > +static const struct clk_parent_data axi0clk[] = { > + { .fw_name = "axi0clk", .name = "axi0clk" }, }; > + > +static const struct clk_parent_data soc0_ahbmux[] = { > + { .fw_name = "soc0-ahbmux", .name = "soc0-ahbmux" }, }; > + > +static const struct clk_parent_data soc0_uartclk[] = { > + { .fw_name = "soc0-uartclk", .name = "soc0-uartclk" }, }; > + > +static const struct clk_parent_data emmcclk[] = { > + { .fw_name = "emmcclk", .name = "emmcclk" }, }; > + > +static const struct clk_parent_data emmcsrc_mux[] = { > + { .fw_name = "emmcsrc-mux", .name = "emmcsrc-mux" }, }; > + > +static const struct clk_parent_data soc1_clkin[] = { > + { .fw_name = "soc1-clkin", .name = "soc1-clkin" }, }; > + > +static const struct clk_parent_data soc1_hpll[] = { > + { .fw_name = "soc1-hpll", .name = "soc1-hpll" }, }; > + > +static const struct clk_parent_data soc1_apll[] = { > + { .fw_name = "soc1-apll", .name = "soc1-apll" }, }; > + > +static const struct clk_parent_data sdclk[] = { > + { .fw_name = "sdclk", .name = "sdclk" }, }; > + > +static const struct clk_parent_data sdclk_mux[] = { > + { .fw_name = "sdclk-mux", .name = "sdclk-mux" }, }; > + > +static const struct clk_parent_data huartxclk[] = { > + { .fw_name = "huartxclk", .name = "huartxclk" }, }; > + > +static const struct clk_parent_data uxclk[] = { > + { .fw_name = "uxclk", .name = "uxclk" }, }; > + > +static const struct clk_parent_data huxclk[] = { > + { .fw_name = "huxclk", .name = "huxclk" }, }; > + > +static const struct clk_parent_data uart0clk[] = { > + { .fw_name = "uart0clk", .name = "uart0clk" }, }; > + > +static const struct clk_parent_data uart1clk[] = { > + { .fw_name = "uart1clk", .name = "uart1clk" }, }; > + > +static const struct clk_parent_data uart2clk[] = { > + { .fw_name = "uart2clk", .name = "uart2clk" }, }; > + > +static const struct clk_parent_data uart3clk[] = { > + { .fw_name = "uart3clk", .name = "uart3clk" }, }; > + > +static const struct clk_parent_data uart5clk[] = { > + { .fw_name = "uart5clk", .name = "uart5clk" }, }; > + > +static const struct clk_parent_data uart4clk[] = { > + { .fw_name = "uart4clk", .name = "uart4clk" }, }; > + > +static const struct clk_parent_data uart6clk[] = { > + { .fw_name = "uart6clk", .name = "uart6clk" }, }; > + > +static const struct clk_parent_data uart7clk[] = { > + { .fw_name = "uart7clk", .name = "uart7clk" }, }; > + > +static const struct clk_parent_data uart8clk[] = { > + { .fw_name = "uart8clk", .name = "uart8clk" }, }; > + > +static const struct clk_parent_data uart9clk[] = { > + { .fw_name = "uart9clk", .name = "uart9clk" }, }; > + > +static const struct clk_parent_data uart10clk[] = { > + { .fw_name = "uart10clk", .name = "uart10clk" }, }; > + > +static const struct clk_parent_data uart11clk[] = { > + { .fw_name = "uart11clk", .name = "uart11clk" }, }; > + > +static const struct clk_parent_data uart12clk[] = { > + { .fw_name = "uart12clk", .name = "uart12clk" }, }; > + > +static const struct clk_parent_data uart13clk[] = { > + { .fw_name = "uart13clk", .name = "uart13clk" }, }; > + > +static const struct clk_parent_data uart14clk[] = { > + { .fw_name = "uart14clk", .name = "uart14clk" }, }; > + > +static const struct clk_parent_data soc1_i3c[] = { > + { .fw_name = "soc1-i3c", .name = "soc1-i3c" }, }; > + > +static const struct clk_parent_data canclk[] = { > + { .fw_name = "canclk", .name = "canclk" }, }; > + > +static const struct clk_parent_data rmii[] = { > + { .fw_name = "rmii", .name = "rmii" }, }; > + > +static const struct clk_parent_data hclk_clk_sels[] = { > + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, > + { .fw_name = "soc0-mpll", .name = "soc0-mpll" }, }; > + > +static const struct clk_parent_data mhpll_clk_sels[] = { > + { .fw_name = "soc0-mpll", .name = "soc0-mpll" }, > + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, }; > + > +static const struct clk_parent_data mphy_clk_sels[] = { > + { .fw_name = "soc0-mpll", .name = "soc0-mpll" }, > + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, > + { .fw_name = "soc0-dpll", .name = "soc0-dpll" }, > + { .fw_name = "soc0-clk192Mhz", .name = "soc0-clk192Mhz" }, }; > + > +static const struct clk_parent_data psp_clk_sels[] = { > + { .fw_name = "soc0-mpll", .name = "soc0-mpll" }, > + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, > + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, > + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, > + { .fw_name = "soc0-mpll_div2", .name = "soc0-mpll_div2" }, > + { .fw_name = "soc0-hpll_div2", .name = "soc0-hpll_div2" }, > + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, > + { .fw_name = "soc0-hpll", .name = "soc0-hpll" }, }; > + > +static const struct clk_parent_data uart_clk_sels[] = { > + { .fw_name = "soc0-clk24Mhz", .name = "soc0-clk24Mhz" }, > + { .fw_name = "soc0-clk192Mhz", .name = "soc0-clk192Mhz" }, }; > + > +static const struct clk_parent_data emmc_clk_sels[] = { > + { .fw_name = "soc0-mpll_div4", .name = "soc0-mpll_div4" }, > + { .fw_name = "soc0-hpll_div4", .name = "soc0-hpll_div4" }, }; > + > +static const struct clk_parent_data sdio_clk_sels[] = { > + { .fw_name = "soc1-hpll", .name = "soc1-hpll" }, > + { .fw_name = "soc1-apll", .name = "soc1-apll" }, }; > + > +static const struct clk_parent_data ux_clk_sels[] = { > + { .fw_name = "soc1-apll_div4", .name = "soc1-apll_div4" }, > + { .fw_name = "soc1-apll_div2", .name = "soc1-apll_div2" }, > + { .fw_name = "soc1-apll", .name = "soc1-apll" }, > + { .fw_name = "soc1-hpll", .name = "soc1-hpll" }, }; > + > +static const struct clk_parent_data uartx_clk_sels[] = { > + { .fw_name = "uartxclk", .name = "uartxclk" }, > + { .fw_name = "huartxclk", .name = "huartxclk" }, }; > + > +#define FIXED_CLK(_id, _name, _rate) \ > + [_id] = { \ > + .type = CLK_FIXED, \ > + .name = _name, \ > + .data = { .rate = { .fixed_rate = _rate, } }, \ > + } > + > +#define PLL_CLK(_id, _type, _name, _parent, _reg) \ > + [_id] = { \ > + .type = _type, \ > + .name = _name, \ > + .data = { .pll = { .parent = _parent, .reg = _reg, } }, \ > + } > + > +#define MUX_CLK(_id, _name, _parents, _num_parents, _reg, _shift, _width) > \ > + [_id] = { \ > + .type = CLK_MUX, \ > + .name = _name, \ > + .data = { \ > + .mux = { \ > + .parents = _parents, \ > + .num_parents = _num_parents, \ > + .reg = _reg, \ > + .bit_shift = _shift, \ > + .bit_width = _width, \ > + }, \ > + }, \ > + } > + > +#define DIVIDER_CLK(_id, _name, _parent, _reg, _shift, _width, _div_table) \ > + [_id] = { \ > + .type = CLK_DIVIDER, \ > + .name = _name, \ > + .data = { \ > + .div = { \ > + .parent = _parent, \ > + .reg = _reg, \ > + .bit_shift = _shift, \ > + .bit_width = _width, \ > + .div_table = _div_table, \ > + }, \ > + }, \ > + } > + > +#define FIXED_FACTOR_CLK(_id, _name, _parent, _mult, _div) \ > + [_id] = { \ > + .type = CLK_FIXED_FACTOR, \ > + .name = _name, \ > + .data = { .factor = { .parent = _parent, .mult = _mult, .div = _div, } }, \ > + } > + > +#define GATE_CLK(_id, _type, _name, _parent, _reg, _bit, _flags) \ > + [_id] = { \ > + .type = _type, \ > + .name = _name, \ > + .data = { \ > + .gate = { \ > + .parent = _parent, \ > + .reg = _reg, \ > + .bit = _bit, \ > + .flags = _flags, \ > + }, \ > + }, \ > + } > + > +static const struct ast2700_clk_info ast2700_scu0_clk_info[] __initconst = { > + FIXED_CLK(SCU0_CLKIN, "soc0-clkin", SCU_CLK_25MHZ), > + FIXED_CLK(SCU0_CLK_24M, "soc0-clk24Mhz", SCU_CLK_24MHZ), > + FIXED_CLK(SCU0_CLK_192M, "soc0-clk192Mhz", SCU_CLK_192MHZ), > + FIXED_CLK(SCU0_CLK_U2PHY_CLK12M, "u2phy_clk12m", > SCU_CLK_12MHZ), > + PLL_CLK(SCU0_CLK_HPLL, CLK_HPLL, "soc0-hpll", soc0_clkin, > SCU0_HPLL_PARAM), > + PLL_CLK(SCU0_CLK_DPLL, CLK_PLL, "soc0-dpll", soc0_clkin, > SCU0_DPLL_PARAM), > + PLL_CLK(SCU0_CLK_MPLL, CLK_PLL, "soc0-mpll", soc0_clkin, > SCU0_MPLL_PARAM), > + PLL_CLK(SCU0_CLK_D0, DCLK_FIXED, "d0clk", NULL, > SCU0_D0CLK_PARAM), > + PLL_CLK(SCU0_CLK_D1, DCLK_FIXED, "d1clk", NULL, > SCU0_D1CLK_PARAM), > + PLL_CLK(SCU0_CLK_CRT0, DCLK_FIXED, "crt0clk", NULL, > SCU0_CRT0CLK_PARAM), > + PLL_CLK(SCU0_CLK_CRT1, DCLK_FIXED, "crt1clk", NULL, > SCU0_CRT1CLK_PARAM), > + PLL_CLK(SCU0_CLK_MPHY, CLK_MISC, "mphyclk", mphysrc, > SCU0_MPHYCLK_PARAM), > + PLL_CLK(SCU0_CLK_U2PHY_REFCLK, CLK_MISC, "u2phy_refclk", > u2phy_refclksrc, SCU0_CLK_SEL2), > + FIXED_FACTOR_CLK(SCU0_CLK_HPLL_DIV2, "soc0-hpll_div2", soc0_hpll, 1, > 2), > + FIXED_FACTOR_CLK(SCU0_CLK_HPLL_DIV4, "soc0-hpll_div4", soc0_hpll, 1, > 4), > + FIXED_FACTOR_CLK(SCU0_CLK_MPLL_DIV2, "soc0-mpll_div2", soc0_mpll, > 1, 2), > + FIXED_FACTOR_CLK(SCU0_CLK_MPLL_DIV4, "soc0-mpll_div4", soc0_mpll, > 1, 4), > + FIXED_FACTOR_CLK(SCU0_CLK_MPLL_DIV8, "soc0-mpll_div8", soc0_mpll, > 1, 8), > + FIXED_FACTOR_CLK(SCU0_CLK_AXI0, "axi0clk", pspclk, 1, 2), > + FIXED_FACTOR_CLK(SCU0_CLK_AXI1, "axi1clk", soc0_mpll, 1, 4), > + DIVIDER_CLK(SCU0_CLK_AHB, "soc0-ahb", soc0_ahbmux, > + SCU0_HWSTRAP1, 5, 2, ast2700_hclk_div_table), > + DIVIDER_CLK(SCU0_CLK_EMMC, "emmcclk", emmcsrc_mux, > + SCU0_CLK_SEL1, 12, 3, ast2700_clk_div_table2), > + DIVIDER_CLK(SCU0_CLK_APB, "soc0-apb", axi0clk, > + SCU0_CLK_SEL1, 23, 3, ast2700_clk_div_table2), > + DIVIDER_CLK(SCU0_CLK_UART4, "uart4clk", soc0_uartclk, > + SCU0_CLK_SEL2, 30, 1, ast2700_clk_uart_div_table), > + DIVIDER_CLK(SCU0_CLK_HPLL_DIV_AHB, "soc0-hpll-ahb", soc0_hpll, > + SCU0_HWSTRAP1, 5, 2, ast2700_hclk_div_table), > + DIVIDER_CLK(SCU0_CLK_MPLL_DIV_AHB, "soc0-mpll-ahb", soc0_mpll, > + SCU0_HWSTRAP1, 5, 2, ast2700_hclk_div_table), > + MUX_CLK(SCU0_CLK_PSP, "pspclk", psp_clk_sels, > ARRAY_SIZE(psp_clk_sels), > + SCU0_HWSTRAP1, 2, 3), > + MUX_CLK(SCU0_CLK_AHBMUX, "soc0-ahbmux", hclk_clk_sels, > ARRAY_SIZE(hclk_clk_sels), > + SCU0_HWSTRAP1, 7, 1), > + MUX_CLK(SCU0_CLK_EMMCMUX, "emmcsrc-mux", emmc_clk_sels, > ARRAY_SIZE(emmc_clk_sels), > + SCU0_CLK_SEL1, 11, 1), > + MUX_CLK(SCU0_CLK_MPHYSRC, "mphysrc", mphy_clk_sels, > ARRAY_SIZE(mphy_clk_sels), > + SCU0_CLK_SEL2, 18, 2), > + MUX_CLK(SCU0_CLK_U2PHY_REFCLKSRC, "u2phy_refclksrc", > mhpll_clk_sels, > + ARRAY_SIZE(mhpll_clk_sels), SCU0_CLK_SEL2, 23, 1), > + MUX_CLK(SCU0_CLK_UART, "soc0-uartclk", uart_clk_sels, > ARRAY_SIZE(uart_clk_sels), > + SCU0_CLK_SEL2, 14, 1), > + GATE_CLK(SCU0_CLK_GATE_MCLK, CLK_GATE_ASPEED, "mclk-gate", > soc0_mpll, > + SCU0_CLK_STOP, 0, CLK_IS_CRITICAL), > + GATE_CLK(SCU0_CLK_GATE_ECLK, CLK_GATE_ASPEED, "eclk-gate", NULL, > SCU0_CLK_STOP, 1, 0), > + GATE_CLK(SCU0_CLK_GATE_2DCLK, CLK_GATE_ASPEED, "gclk-gate", NULL, > SCU0_CLK_STOP, 2, 0), > + GATE_CLK(SCU0_CLK_GATE_VCLK, CLK_GATE_ASPEED, "vclk-gate", NULL, > SCU0_CLK_STOP, 3, 0), > + GATE_CLK(SCU0_CLK_GATE_BCLK, CLK_GATE_ASPEED, "bclk-gate", NULL, > + SCU0_CLK_STOP, 4, CLK_IS_CRITICAL), > + GATE_CLK(SCU0_CLK_GATE_VGA0CLK, CLK_GATE_ASPEED, > "vga0clk-gate", NULL, > + SCU0_CLK_STOP, 5, CLK_IS_CRITICAL), > + GATE_CLK(SCU0_CLK_GATE_REFCLK, CLK_GATE_ASPEED, > "soc0-refclk-gate", soc0_clkin, > + SCU0_CLK_STOP, 6, CLK_IS_CRITICAL), > + GATE_CLK(SCU0_CLK_GATE_PORTBUSB2CLK, CLK_GATE_ASPEED, > "portb-usb2clk-gate", NULL, > + SCU0_CLK_STOP, 7, 0), > + GATE_CLK(SCU0_CLK_GATE_UHCICLK, CLK_GATE_ASPEED, "uhciclk-gate", > NULL, SCU0_CLK_STOP, 9, 0), > + GATE_CLK(SCU0_CLK_GATE_VGA1CLK, CLK_GATE_ASPEED, "vga1clk-gate", > NULL, > + SCU0_CLK_STOP, 10, CLK_IS_CRITICAL), > + GATE_CLK(SCU0_CLK_GATE_DDRPHYCLK, CLK_GATE_ASPEED, > "ddrphy-gate", NULL, > + SCU0_CLK_STOP, 11, CLK_IS_CRITICAL), > + GATE_CLK(SCU0_CLK_GATE_E2M0CLK, CLK_GATE_ASPEED, > "e2m0clk-gate", NULL, > + SCU0_CLK_STOP, 12, CLK_IS_CRITICAL), > + GATE_CLK(SCU0_CLK_GATE_HACCLK, CLK_GATE_ASPEED, "hacclk-gate", > NULL, SCU0_CLK_STOP, 13, 0), > + GATE_CLK(SCU0_CLK_GATE_PORTAUSB2CLK, CLK_GATE_ASPEED, > "porta-usb2clk-gate", NULL, > + SCU0_CLK_STOP, 14, 0), > + GATE_CLK(SCU0_CLK_GATE_UART4CLK, CLK_GATE_ASPEED, > "uart4clk-gate", uart4clk, > + SCU0_CLK_STOP, 15, CLK_IS_CRITICAL), > + GATE_CLK(SCU0_CLK_GATE_SLICLK, CLK_GATE_ASPEED, "soc0-sliclk-gate", > NULL, > + SCU0_CLK_STOP, 16, CLK_IS_CRITICAL), > + GATE_CLK(SCU0_CLK_GATE_DACCLK, CLK_GATE_ASPEED, "dacclk-gate", > NULL, > + SCU0_CLK_STOP, 17, CLK_IS_CRITICAL), > + GATE_CLK(SCU0_CLK_GATE_DP, CLK_GATE_ASPEED, "dpclk-gate", NULL, > + SCU0_CLK_STOP, 18, CLK_IS_CRITICAL), > + GATE_CLK(SCU0_CLK_GATE_E2M1CLK, CLK_GATE_ASPEED, > "e2m1clk-gate", NULL, > + SCU0_CLK_STOP, 19, CLK_IS_CRITICAL), > + GATE_CLK(SCU0_CLK_GATE_CRT0CLK, CLK_GATE_ASPEED, "crt0clk-gate", > NULL, > + SCU0_CLK_STOP, 20, 0), > + GATE_CLK(SCU0_CLK_GATE_CRT1CLK, CLK_GATE_ASPEED, "crt1clk-gate", > NULL, > + SCU0_CLK_STOP, 21, 0), > + GATE_CLK(SCU0_CLK_GATE_ECDSACLK, CLK_GATE_ASPEED, "eccclk-gate", > NULL, > + SCU0_CLK_STOP, 23, 0), > + GATE_CLK(SCU0_CLK_GATE_RSACLK, CLK_GATE_ASPEED, "rsaclk-gate", > NULL, > + SCU0_CLK_STOP, 24, 0), > + GATE_CLK(SCU0_CLK_GATE_RVAS0CLK, CLK_GATE_ASPEED, > "rvas0clk-gate", NULL, > + SCU0_CLK_STOP, 25, 0), > + GATE_CLK(SCU0_CLK_GATE_UFSCLK, CLK_GATE_ASPEED, "ufsclk-gate", > NULL, > + SCU0_CLK_STOP, 26, 0), > + GATE_CLK(SCU0_CLK_GATE_EMMCCLK, CLK_GATE_ASPEED, > "emmcclk-gate", emmcclk, > + SCU0_CLK_STOP, 27, 0), > + GATE_CLK(SCU0_CLK_GATE_RVAS1CLK, CLK_GATE_ASPEED, > "rvas1clk-gate", NULL, > + SCU0_CLK_STOP, 28, 0), > +}; > + > +static const struct ast2700_clk_info ast2700_scu1_clk_info[] __initconst = { > + FIXED_CLK(SCU1_CLKIN, "soc1-clkin", SCU_CLK_25MHZ), > + PLL_CLK(SCU1_CLK_HPLL, CLK_PLL, "soc1-hpll", soc1_clkin, > SCU1_HPLL_PARAM), > + PLL_CLK(SCU1_CLK_APLL, CLK_PLL, "soc1-apll", soc1_clkin, > SCU1_APLL_PARAM), > + PLL_CLK(SCU1_CLK_DPLL, CLK_PLL, "soc1-dpll", soc1_clkin, > SCU1_DPLL_PARAM), > + PLL_CLK(SCU1_CLK_UARTX, CLK_UART_PLL, "uartxclk", uxclk, > SCU1_UXCLK_CTRL), > + PLL_CLK(SCU1_CLK_HUARTX, CLK_UART_PLL, "huartxclk", huxclk, > SCU1_HUXCLK_CTRL), > + FIXED_FACTOR_CLK(SCU1_CLK_APLL_DIV2, "soc1-apll_div2", soc1_apll, 1, > 2), > + FIXED_FACTOR_CLK(SCU1_CLK_APLL_DIV4, "soc1-apll_div4", soc1_apll, 1, > 4), > + FIXED_FACTOR_CLK(SCU1_CLK_UART13, "uart13clk", huartxclk, 1, 1), > + FIXED_FACTOR_CLK(SCU1_CLK_UART14, "uart14clk", huartxclk, 1, 1), > + FIXED_FACTOR_CLK(SCU1_CLK_CAN, "canclk", soc1_apll, 1, 10), > + DIVIDER_CLK(SCU1_CLK_SDCLK, "sdclk", sdclk_mux, > + SCU1_CLK_SEL1, 14, 3, ast2700_clk_div_table), > + DIVIDER_CLK(SCU1_CLK_APB, "soc1-apb", soc1_hpll, > + SCU1_CLK_SEL1, 18, 3, ast2700_clk_div_table2), > + DIVIDER_CLK(SCU1_CLK_RMII, "rmii", soc1_hpll, > + SCU1_CLK_SEL1, 21, 3, ast2700_rmii_div_table), > + DIVIDER_CLK(SCU1_CLK_RGMII, "rgmii", soc1_hpll, > + SCU1_CLK_SEL1, 25, 3, ast2700_rgmii_div_table), > + DIVIDER_CLK(SCU1_CLK_MACHCLK, "machclk", soc1_hpll, > + SCU1_CLK_SEL1, 29, 3, ast2700_clk_div_table), > + DIVIDER_CLK(SCU1_CLK_APLL_DIVN, "soc1-apll_divn", soc1_apll, > + SCU1_CLK_SEL2, 8, 3, ast2700_clk_div_table), > + DIVIDER_CLK(SCU1_CLK_AHB, "soc1-ahb", soc1_hpll, > + SCU1_CLK_SEL2, 20, 3, ast2700_clk_div_table), > + DIVIDER_CLK(SCU1_CLK_I3C, "soc1-i3c", soc1_hpll, > + SCU1_CLK_SEL2, 23, 3, ast2700_clk_div_table), > + MUX_CLK(SCU1_CLK_UART0, "uart0clk", uartx_clk_sels, > ARRAY_SIZE(uartx_clk_sels), > + SCU1_CLK_SEL1, 0, 1), > + MUX_CLK(SCU1_CLK_UART1, "uart1clk", uartx_clk_sels, > ARRAY_SIZE(uartx_clk_sels), > + SCU1_CLK_SEL1, 1, 1), > + MUX_CLK(SCU1_CLK_UART2, "uart2clk", uartx_clk_sels, > ARRAY_SIZE(uartx_clk_sels), > + SCU1_CLK_SEL1, 2, 1), > + MUX_CLK(SCU1_CLK_UART3, "uart3clk", uartx_clk_sels, > ARRAY_SIZE(uartx_clk_sels), > + SCU1_CLK_SEL1, 3, 1), > + MUX_CLK(SCU1_CLK_UART5, "uart5clk", uartx_clk_sels, > ARRAY_SIZE(uartx_clk_sels), > + SCU1_CLK_SEL1, 5, 1), > + MUX_CLK(SCU1_CLK_UART6, "uart6clk", uartx_clk_sels, > ARRAY_SIZE(uartx_clk_sels), > + SCU1_CLK_SEL1, 6, 1), > + MUX_CLK(SCU1_CLK_UART7, "uart7clk", uartx_clk_sels, > ARRAY_SIZE(uartx_clk_sels), > + SCU1_CLK_SEL1, 7, 1), > + MUX_CLK(SCU1_CLK_UART8, "uart8clk", uartx_clk_sels, > ARRAY_SIZE(uartx_clk_sels), > + SCU1_CLK_SEL1, 8, 1), > + MUX_CLK(SCU1_CLK_UART9, "uart9clk", uartx_clk_sels, > ARRAY_SIZE(uartx_clk_sels), > + SCU1_CLK_SEL1, 9, 1), > + MUX_CLK(SCU1_CLK_UART10, "uart10clk", uartx_clk_sels, > ARRAY_SIZE(uartx_clk_sels), > + SCU1_CLK_SEL1, 10, 1), > + MUX_CLK(SCU1_CLK_UART11, "uart11clk", uartx_clk_sels, > ARRAY_SIZE(uartx_clk_sels), > + SCU1_CLK_SEL1, 11, 1), > + MUX_CLK(SCU1_CLK_UART12, "uart12clk", uartx_clk_sels, > ARRAY_SIZE(uartx_clk_sels), > + SCU1_CLK_SEL1, 12, 1), > + MUX_CLK(SCU1_CLK_SDMUX, "sdclk-mux", sdio_clk_sels, > ARRAY_SIZE(sdio_clk_sels), > + SCU1_CLK_SEL1, 13, 1), > + MUX_CLK(SCU1_CLK_UXCLK, "uxclk", ux_clk_sels, > ARRAY_SIZE(ux_clk_sels), > + SCU1_CLK_SEL2, 0, 2), > + MUX_CLK(SCU1_CLK_HUXCLK, "huxclk", ux_clk_sels, > ARRAY_SIZE(ux_clk_sels), > + SCU1_CLK_SEL2, 3, 2), > + GATE_CLK(SCU1_CLK_MAC0RCLK, CLK_GATE, "mac0rclk-gate", rmii, > SCU1_MAC12_CLK_DLY, 29, 0), > + GATE_CLK(SCU1_CLK_MAC1RCLK, CLK_GATE, "mac1rclk-gate", rmii, > SCU1_MAC12_CLK_DLY, 30, 0), > + GATE_CLK(SCU1_CLK_GATE_LCLK0, CLK_GATE_ASPEED, "lclk0-gate", > NULL, > + SCU1_CLK_STOP, 0, CLK_IS_CRITICAL), > + GATE_CLK(SCU1_CLK_GATE_LCLK1, CLK_GATE_ASPEED, "lclk1-gate", > NULL, > + SCU1_CLK_STOP, 1, CLK_IS_CRITICAL), > + GATE_CLK(SCU1_CLK_GATE_ESPI0CLK, CLK_GATE_ASPEED, > "espi0clk-gate", NULL, > + SCU1_CLK_STOP, 2, CLK_IS_CRITICAL), > + GATE_CLK(SCU1_CLK_GATE_ESPI1CLK, CLK_GATE_ASPEED, > "espi1clk-gate", NULL, > + SCU1_CLK_STOP, 3, CLK_IS_CRITICAL), > + GATE_CLK(SCU1_CLK_GATE_SDCLK, CLK_GATE_ASPEED, "sdclk-gate", > sdclk, > + SCU1_CLK_STOP, 4, CLK_IS_CRITICAL), > + GATE_CLK(SCU1_CLK_GATE_IPEREFCLK, CLK_GATE_ASPEED, > "soc1-iperefclk-gate", NULL, > + SCU1_CLK_STOP, 5, CLK_IS_CRITICAL), > + GATE_CLK(SCU1_CLK_GATE_REFCLK, CLK_GATE_ASPEED, > "soc1-refclk-gate", NULL, > + SCU1_CLK_STOP, 6, CLK_IS_CRITICAL), > + GATE_CLK(SCU1_CLK_GATE_LPCHCLK, CLK_GATE_ASPEED, "lpchclk-gate", > NULL, > + SCU1_CLK_STOP, 7, CLK_IS_CRITICAL), > + GATE_CLK(SCU1_CLK_GATE_MAC0CLK, CLK_GATE_ASPEED, > "mac0clk-gate", NULL, > + SCU1_CLK_STOP, 8, 0), > + GATE_CLK(SCU1_CLK_GATE_MAC1CLK, CLK_GATE_ASPEED, > "mac1clk-gate", NULL, > + SCU1_CLK_STOP, 9, 0), > + GATE_CLK(SCU1_CLK_GATE_MAC2CLK, CLK_GATE_ASPEED, > "mac2clk-gate", NULL, > + SCU1_CLK_STOP, 10, 0), > + GATE_CLK(SCU1_CLK_GATE_UART0CLK, CLK_GATE_ASPEED, > "uart0clk-gate", uart0clk, > + SCU1_CLK_STOP, 11, CLK_IS_CRITICAL), > + GATE_CLK(SCU1_CLK_GATE_UART1CLK, CLK_GATE_ASPEED, > "uart1clk-gate", uart1clk, > + SCU1_CLK_STOP, 12, CLK_IS_CRITICAL), > + GATE_CLK(SCU1_CLK_GATE_UART2CLK, CLK_GATE_ASPEED, > "uart2clk-gate", uart2clk, > + SCU1_CLK_STOP, 13, CLK_IS_CRITICAL), > + GATE_CLK(SCU1_CLK_GATE_UART3CLK, CLK_GATE_ASPEED, > "uart3clk-gate", uart3clk, > + SCU1_CLK_STOP, 14, CLK_IS_CRITICAL), > + GATE_CLK(SCU1_CLK_GATE_I2CCLK, CLK_GATE_ASPEED, "i2cclk-gate", > NULL, SCU1_CLK_STOP, 15, 0), > + GATE_CLK(SCU1_CLK_GATE_I3C0CLK, CLK_GATE_ASPEED, "i3c0clk-gate", > soc1_i3c, > + SCU1_CLK_STOP, 16, 0), > + GATE_CLK(SCU1_CLK_GATE_I3C1CLK, CLK_GATE_ASPEED, "i3c1clk-gate", > soc1_i3c, > + SCU1_CLK_STOP, 17, 0), > + GATE_CLK(SCU1_CLK_GATE_I3C2CLK, CLK_GATE_ASPEED, "i3c2clk-gate", > soc1_i3c, > + SCU1_CLK_STOP, 18, 0), > + GATE_CLK(SCU1_CLK_GATE_I3C3CLK, CLK_GATE_ASPEED, "i3c3clk-gate", > soc1_i3c, > + SCU1_CLK_STOP, 19, 0), > + GATE_CLK(SCU1_CLK_GATE_I3C4CLK, CLK_GATE_ASPEED, "i3c4clk-gate", > soc1_i3c, > + SCU1_CLK_STOP, 20, 0), > + GATE_CLK(SCU1_CLK_GATE_I3C5CLK, CLK_GATE_ASPEED, "i3c5clk-gate", > soc1_i3c, > + SCU1_CLK_STOP, 21, 0), > + GATE_CLK(SCU1_CLK_GATE_I3C6CLK, CLK_GATE_ASPEED, "i3c6clk-gate", > soc1_i3c, > + SCU1_CLK_STOP, 22, 0), > + GATE_CLK(SCU1_CLK_GATE_I3C7CLK, CLK_GATE_ASPEED, "i3c7clk-gate", > soc1_i3c, > + SCU1_CLK_STOP, 23, 0), > + GATE_CLK(SCU1_CLK_GATE_I3C8CLK, CLK_GATE_ASPEED, "i3c8clk-gate", > soc1_i3c, > + SCU1_CLK_STOP, 24, 0), > + GATE_CLK(SCU1_CLK_GATE_I3C9CLK, CLK_GATE_ASPEED, "i3c9clk-gate", > soc1_i3c, > + SCU1_CLK_STOP, 25, 0), > + GATE_CLK(SCU1_CLK_GATE_I3C10CLK, CLK_GATE_ASPEED, > "i3c10clk-gate", soc1_i3c, > + SCU1_CLK_STOP, 26, 0), > + GATE_CLK(SCU1_CLK_GATE_I3C11CLK, CLK_GATE_ASPEED, > "i3c11clk-gate", soc1_i3c, > + SCU1_CLK_STOP, 27, 0), > + GATE_CLK(SCU1_CLK_GATE_I3C12CLK, CLK_GATE_ASPEED, > "i3c12clk-gate", soc1_i3c, > + SCU1_CLK_STOP, 28, 0), > + GATE_CLK(SCU1_CLK_GATE_I3C13CLK, CLK_GATE_ASPEED, > "i3c13clk-gate", soc1_i3c, > + SCU1_CLK_STOP, 29, 0), > + GATE_CLK(SCU1_CLK_GATE_I3C14CLK, CLK_GATE_ASPEED, > "i3c14clk-gate", soc1_i3c, > + SCU1_CLK_STOP, 30, 0), > + GATE_CLK(SCU1_CLK_GATE_I3C15CLK, CLK_GATE_ASPEED, > "i3c15clk-gate", soc1_i3c, > + SCU1_CLK_STOP, 31, 0), > + GATE_CLK(SCU1_CLK_GATE_UART5CLK, CLK_GATE_ASPEED, > "uart5clk-gate", uart5clk, > + SCU1_CLK_STOP2, 0, CLK_IS_CRITICAL), > + GATE_CLK(SCU1_CLK_GATE_UART6CLK, CLK_GATE_ASPEED, > "uart6clk-gate", uart6clk, > + SCU1_CLK_STOP2, 1, CLK_IS_CRITICAL), > + GATE_CLK(SCU1_CLK_GATE_UART7CLK, CLK_GATE_ASPEED, > "uart7clk-gate", uart7clk, > + SCU1_CLK_STOP2, 2, CLK_IS_CRITICAL), > + GATE_CLK(SCU1_CLK_GATE_UART8CLK, CLK_GATE_ASPEED, > "uart8clk-gate", uart8clk, > + SCU1_CLK_STOP2, 3, CLK_IS_CRITICAL), > + GATE_CLK(SCU1_CLK_GATE_UART9CLK, CLK_GATE_ASPEED, > "uart9clk-gate", uart9clk, > + SCU1_CLK_STOP2, 4, 0), > + GATE_CLK(SCU1_CLK_GATE_UART10CLK, CLK_GATE_ASPEED, > "uart10clk-gate", uart10clk, > + SCU1_CLK_STOP2, 5, 0), > + GATE_CLK(SCU1_CLK_GATE_UART11CLK, CLK_GATE_ASPEED, > "uart11clk-gate", uart11clk, > + SCU1_CLK_STOP2, 6, 0), > + GATE_CLK(SCU1_CLK_GATE_UART12CLK, CLK_GATE_ASPEED, > "uart12clk-gate", uart12clk, > + SCU1_CLK_STOP2, 7, 0), > + GATE_CLK(SCU1_CLK_GATE_FSICLK, CLK_GATE_ASPEED, "fsiclk-gate", > NULL, SCU1_CLK_STOP2, 8, 0), > + GATE_CLK(SCU1_CLK_GATE_LTPIPHYCLK, CLK_GATE_ASPEED, > "ltpiphyclk-gate", NULL, > + SCU1_CLK_STOP2, 9, 0), > + GATE_CLK(SCU1_CLK_GATE_LTPICLK, CLK_GATE_ASPEED, "ltpiclk-gate", > NULL, > + SCU1_CLK_STOP2, 10, 0), > + GATE_CLK(SCU1_CLK_GATE_VGALCLK, CLK_GATE_ASPEED, "vgalclk-gate", > NULL, > + SCU1_CLK_STOP2, 11, CLK_IS_CRITICAL), > + GATE_CLK(SCU1_CLK_GATE_UHCICLK, CLK_GATE_ASPEED, > "usbuartclk-gate", NULL, > + SCU1_CLK_STOP2, 12, 0), > + GATE_CLK(SCU1_CLK_GATE_CANCLK, CLK_GATE_ASPEED, "canclk-gate", > canclk, > + SCU1_CLK_STOP2, 13, 0), > + GATE_CLK(SCU1_CLK_GATE_PCICLK, CLK_GATE_ASPEED, "pciclk-gate", > NULL, > + SCU1_CLK_STOP2, 14, 0), > + GATE_CLK(SCU1_CLK_GATE_SLICLK, CLK_GATE_ASPEED, "soc1-sliclk-gate", > NULL, > + SCU1_CLK_STOP2, 15, CLK_IS_CRITICAL), > + GATE_CLK(SCU1_CLK_GATE_E2MCLK, CLK_GATE_ASPEED, > "soc1-e2m-gate", NULL, > + SCU1_CLK_STOP2, 16, CLK_IS_CRITICAL), > + GATE_CLK(SCU1_CLK_GATE_PORTCUSB2CLK, CLK_GATE_ASPEED, > "portcusb2-gate", NULL, > + SCU1_CLK_STOP2, 17, 0), > + GATE_CLK(SCU1_CLK_GATE_PORTDUSB2CLK, CLK_GATE_ASPEED, > "portdusb2-gate", NULL, > + SCU1_CLK_STOP2, 18, 0), > + GATE_CLK(SCU1_CLK_GATE_LTPI1TXCLK, CLK_GATE_ASPEED, > "ltp1tx-gate", NULL, > + SCU1_CLK_STOP2, 19, 0), > +}; > + > +static struct clk_hw *ast2700_clk_hw_register_hpll(void __iomem *reg, > + const char *name, const char *parent_name, > + struct ast2700_clk_ctrl *clk_ctrl) { > + unsigned int mult, div; > + u32 val; > + > + val = readl(clk_ctrl->base + SCU0_HWSTRAP1); > + if ((readl(clk_ctrl->base) & REVISION_ID) && (val & BIT(3))) { > + switch ((val & GENMASK(4, 2)) >> 2) { > + case 2: > + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, > NULL, > + 0, 1800 * HZ_PER_MHZ); > + case 3: > + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, > NULL, > + 0, 1700 * HZ_PER_MHZ); > + case 6: > + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, > NULL, > + 0, 1200 * HZ_PER_MHZ); > + case 7: > + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, > NULL, > + 0, 800 * HZ_PER_MHZ); > + default: > + return ERR_PTR(-EINVAL); > + } > + } else if ((val & GENMASK(3, 2)) != 0) { > + switch ((val & GENMASK(3, 2)) >> 2) { > + case 1: > + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, > NULL, > + 0, 1900 * HZ_PER_MHZ); > + case 2: > + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, > NULL, > + 0, 1800 * HZ_PER_MHZ); > + case 3: > + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, > NULL, > + 0, 1700 * HZ_PER_MHZ); > + default: > + return ERR_PTR(-EINVAL); > + } > + } else { > + val = readl(reg); > + > + if (val & BIT(24)) { > + /* Pass through mode */ > + mult = 1; > + div = 1; > + } else { > + u32 m = val & 0x1fff; > + u32 n = (val >> 13) & 0x3f; > + u32 p = (val >> 19) & 0xf; > + > + mult = (m + 1) / (2 * (n + 1)); > + div = (p + 1); > + } > + } > + > + return devm_clk_hw_register_fixed_factor(clk_ctrl->dev, name, > +parent_name, 0, mult, div); } > + > +static struct clk_hw *ast2700_clk_hw_register_pll(int clk_idx, void __iomem > *reg, > + const char *name, const char *parent_name, > + struct ast2700_clk_ctrl *clk_ctrl) { > + int scu = clk_ctrl->clk_data->scu; > + unsigned int mult, div; > + u32 val = readl(reg); > + > + if (val & BIT(24)) { > + /* Pass through mode */ > + mult = 1; > + div = 1; > + } else { > + u32 m = val & 0x1fff; > + u32 n = (val >> 13) & 0x3f; > + u32 p = (val >> 19) & 0xf; > + > + if (scu) { > + mult = (m + 1) / (n + 1); > + div = (p + 1); > + } else { > + if (clk_idx == SCU0_CLK_MPLL) { > + mult = m / (n + 1); > + div = (p + 1); > + } else { > + mult = (m + 1) / (2 * (n + 1)); > + div = (p + 1); > + } > + } > + } > + > + return devm_clk_hw_register_fixed_factor(clk_ctrl->dev, name, > +parent_name, 0, mult, div); } > + > +static struct clk_hw *ast2700_clk_hw_register_dclk(void __iomem *reg, > const char *name, > + struct ast2700_clk_ctrl *clk_ctrl) { > + unsigned int mult, div, r, n; > + u32 xdclk; > + u32 val; > + > + val = readl(clk_ctrl->base + 0x284); > + if (val & BIT(29)) > + xdclk = 800 * HZ_PER_MHZ; > + else > + xdclk = 1000 * HZ_PER_MHZ; > + > + val = readl(reg); > + r = val & GENMASK(15, 0); > + n = (val >> 16) & GENMASK(15, 0); > + mult = r; > + div = 2 * n; > + > + return devm_clk_hw_register_fixed_rate(clk_ctrl->dev, name, NULL, 0, > +(xdclk * mult) / div); } > + > +static struct clk_hw *ast2700_clk_hw_register_uartpll(void __iomem *reg, > + const char *name, const char > *parent_name, > + struct ast2700_clk_ctrl *clk_ctrl) { > + unsigned int mult, div; > + u32 val = readl(reg); > + u32 r = val & 0xff; > + u32 n = (val >> 8) & 0x3ff; > + > + mult = r; > + div = n * 2; > + > + return devm_clk_hw_register_fixed_factor(clk_ctrl->dev, name, > + parent_name, 0, mult, div); > +} > + > +static struct clk_hw *ast2700_clk_hw_register_misc(int clk_idx, void > __iomem *reg, > + const char *name, const char *parent_name, > + struct ast2700_clk_ctrl *clk_ctrl) { > + u32 div = 0; > + > + if (clk_idx == SCU0_CLK_MPHY) { > + div = readl(reg) + 1; > + } else if (clk_idx == SCU0_CLK_U2PHY_REFCLK) { > + if (readl(clk_ctrl->base) & REVISION_ID) > + div = (GET_USB_REFCLK_DIV(readl(reg)) + 1) << 4; > + else > + div = (GET_USB_REFCLK_DIV(readl(reg)) + 1) << 1; > + } else { > + return ERR_PTR(-EINVAL); > + } > + > + return devm_clk_hw_register_fixed_factor(clk_ctrl->dev, name, > + parent_name, 0, 1, div); > +} > + > +static int ast2700_clk_is_enabled(struct clk_hw *hw) { > + struct clk_gate *gate = to_clk_gate(hw); > + u32 clk = BIT(gate->bit_idx); > + u32 reg; > + > + reg = readl(gate->reg); > + > + return !(reg & clk); > +} > + > +static int ast2700_clk_enable(struct clk_hw *hw) { > + struct clk_gate *gate = to_clk_gate(hw); > + u32 clk = BIT(gate->bit_idx); > + > + if (readl(gate->reg) & clk) > + writel(clk, gate->reg + 0x04); > + > + return 0; > +} > + > +static void ast2700_clk_disable(struct clk_hw *hw) { > + struct clk_gate *gate = to_clk_gate(hw); > + u32 clk = BIT(gate->bit_idx); > + > + /* Clock is set to enable, so use write to set register */ > + writel(clk, gate->reg); > +} > + > +static const struct clk_ops ast2700_clk_gate_ops = { > + .enable = ast2700_clk_enable, > + .disable = ast2700_clk_disable, > + .is_enabled = ast2700_clk_is_enabled, > +}; > + > +static struct clk_hw *ast2700_clk_hw_register_gate(struct device *dev, const > char *name, > + const struct clk_parent_data *parent, > + void __iomem *reg, u8 clock_idx, > + unsigned long clk_gate_flags, spinlock_t > *lock) { > + struct clk_gate *gate; > + struct clk_hw *hw; > + struct clk_init_data init; > + int ret = -EINVAL; > + > + gate = kzalloc(sizeof(*gate), GFP_KERNEL); > + if (!gate) > + return ERR_PTR(-ENOMEM); > + > + init.name = name; > + init.ops = &ast2700_clk_gate_ops; > + init.flags = clk_gate_flags; > + init.parent_names = parent ? &parent->name : NULL; > + init.num_parents = parent ? 1 : 0; > + > + gate->reg = reg; > + gate->bit_idx = clock_idx; > + gate->flags = 0; > + gate->lock = lock; > + gate->hw.init = &init; > + > + hw = &gate->hw; > + ret = clk_hw_register(dev, hw); > + if (ret) { > + kfree(gate); > + hw = ERR_PTR(ret); > + } > + > + return hw; > +} > + > +static void ast2700_soc1_configure_i3c_clk(struct ast2700_clk_ctrl > +*clk_ctrl) { > + if (readl(clk_ctrl->base + SCU1_REVISION_ID) & REVISION_ID) > + /* I3C 250MHz = HPLL/4 */ > + writel((readl(clk_ctrl->base + SCU1_CLK_SEL2) & > + ~SCU1_CLK_I3C_DIV_MASK) | > + FIELD_PREP(SCU1_CLK_I3C_DIV_MASK, > + SCU1_CLK_I3C_DIV(4)), > + clk_ctrl->base + SCU1_CLK_SEL2); } > + > +static int ast2700_soc_clk_probe(struct platform_device *pdev) { > + const struct ast2700_clk_data *clk_data; > + struct clk_hw_onecell_data *clk_hw_data; > + struct ast2700_clk_ctrl *clk_ctrl; > + struct device *dev = &pdev->dev; > + struct auxiliary_device *adev; > + void __iomem *clk_base; > + struct clk_hw **hws; > + char *reset_name; > + int ret; > + int i; > + > + clk_ctrl = devm_kzalloc(dev, sizeof(*clk_ctrl), GFP_KERNEL); > + if (!clk_ctrl) > + return -ENOMEM; > + clk_ctrl->dev = dev; > + dev_set_drvdata(&pdev->dev, clk_ctrl); > + > + spin_lock_init(&clk_ctrl->lock); > + > + clk_base = devm_platform_ioremap_resource(pdev, 0); > + if (IS_ERR(clk_base)) > + return PTR_ERR(clk_base); > + > + clk_ctrl->base = clk_base; > + > + clk_data = device_get_match_data(dev); > + if (!clk_data) > + return -ENODEV; > + > + clk_ctrl->clk_data = clk_data; > + reset_name = devm_kasprintf(dev, GFP_KERNEL, "reset%d", > +clk_data->scu); > + > + clk_hw_data = devm_kzalloc(dev, struct_size(clk_hw_data, hws, > clk_data->nr_clks), > + GFP_KERNEL); > + if (!clk_hw_data) > + return -ENOMEM; > + > + clk_hw_data->num = clk_data->nr_clks; > + hws = clk_hw_data->hws; > + > + if (clk_data->scu) > + ast2700_soc1_configure_i3c_clk(clk_ctrl); > + > + for (i = 0; i < clk_data->nr_clks; i++) { > + const struct ast2700_clk_info *clk = &clk_data->clk_info[i]; > + void __iomem *reg; > + > + if (clk->type == CLK_FIXED) { > + const struct ast2700_clk_fixed_rate_data *fixed_rate = > +&clk->data.rate; > + > + hws[i] = devm_clk_hw_register_fixed_rate(dev, clk->name, > NULL, 0, > + fixed_rate->fixed_rate); > + } else if (clk->type == CLK_FIXED_FACTOR) { > + const struct ast2700_clk_fixed_factor_data *factor = > +&clk->data.factor; > + > + hws[i] = devm_clk_hw_register_fixed_factor(dev, clk->name, > + factor->parent->name, > + 0, factor->mult, factor->div); > + } else if (clk->type == DCLK_FIXED) { > + const struct ast2700_clk_pll_data *pll = &clk->data.pll; > + > + reg = clk_ctrl->base + pll->reg; > + hws[i] = ast2700_clk_hw_register_dclk(reg, clk->name, > clk_ctrl); > + } else if (clk->type == CLK_HPLL) { > + const struct ast2700_clk_pll_data *pll = &clk->data.pll; > + > + reg = clk_ctrl->base + pll->reg; > + hws[i] = ast2700_clk_hw_register_hpll(reg, clk->name, > + pll->parent->name, clk_ctrl); > + } else if (clk->type == CLK_PLL) { > + const struct ast2700_clk_pll_data *pll = &clk->data.pll; > + > + reg = clk_ctrl->base + pll->reg; > + hws[i] = ast2700_clk_hw_register_pll(i, reg, clk->name, > + pll->parent->name, clk_ctrl); > + } else if (clk->type == CLK_UART_PLL) { > + const struct ast2700_clk_pll_data *pll = &clk->data.pll; > + > + reg = clk_ctrl->base + pll->reg; > + hws[i] = ast2700_clk_hw_register_uartpll(reg, clk->name, > + pll->parent->name, clk_ctrl); > + } else if (clk->type == CLK_MUX) { > + const struct ast2700_clk_mux_data *mux = &clk->data.mux; > + > + reg = clk_ctrl->base + mux->reg; > + hws[i] = devm_clk_hw_register_mux_parent_data_table(dev, > clk->name, > + mux->parents, > + mux->num_parents, 0, > + reg, mux->bit_shift, > + mux->bit_width, 0, > + NULL, &clk_ctrl->lock); > + } else if (clk->type == CLK_MISC) { > + const struct ast2700_clk_pll_data *misc = &clk->data.pll; > + > + reg = clk_ctrl->base + misc->reg; > + hws[i] = ast2700_clk_hw_register_misc(i, reg, clk->name, > + misc->parent->name, clk_ctrl); > + } else if (clk->type == CLK_DIVIDER) { > + const struct ast2700_clk_div_data *div = &clk->data.div; > + > + reg = clk_ctrl->base + div->reg; > + hws[i] = devm_clk_hw_register_divider_table(dev, clk->name, > + div->parent->name, 0, > + reg, div->bit_shift, > + div->bit_width, 0, > + div->div_table, > + &clk_ctrl->lock); > + } else if (clk->type == CLK_GATE_ASPEED) { > + const struct ast2700_clk_gate_data *gate = &clk->data.gate; > + > + reg = clk_ctrl->base + gate->reg; > + hws[i] = ast2700_clk_hw_register_gate(dev, clk->name, > gate->parent, > + reg, gate->bit, gate->flags, > + &clk_ctrl->lock); > + > + } else { > + const struct ast2700_clk_gate_data *gate = &clk->data.gate; > + > + reg = clk_ctrl->base + gate->reg; > + hws[i] = devm_clk_hw_register_gate_parent_data(dev, > clk->name, gate->parent, > + 0, reg, clk->clk_idx, 0, > + &clk_ctrl->lock); > + } > + > + if (IS_ERR(hws[i])) > + return PTR_ERR(hws[i]); > + } > + > + ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get, > clk_hw_data); > + if (ret) > + return ret; > + > + adev = devm_auxiliary_device_create(dev, reset_name, (__force void > *)clk_base); > + if (!adev) > + return -ENODEV; > + > + return 0; > +} > + > +static const struct ast2700_clk_data ast2700_clk0_data = { > + .scu = 0, > + .nr_clks = ARRAY_SIZE(ast2700_scu0_clk_info), > + .clk_info = ast2700_scu0_clk_info, > +}; > + > +static const struct ast2700_clk_data ast2700_clk1_data = { > + .scu = 1, > + .nr_clks = ARRAY_SIZE(ast2700_scu1_clk_info), > + .clk_info = ast2700_scu1_clk_info, > +}; > + > +static const struct of_device_id ast2700_scu_match[] = { > + { .compatible = "aspeed,ast2700-scu0", .data = &ast2700_clk0_data }, > + { .compatible = "aspeed,ast2700-scu1", .data = &ast2700_clk1_data }, > + { /* sentinel */ } > +}; > + > +MODULE_DEVICE_TABLE(of, ast2700_scu_match); > + > +static struct platform_driver ast2700_scu_driver = { > + .probe = ast2700_soc_clk_probe, > + .driver = { > + .name = "clk-ast2700", > + .of_match_table = ast2700_scu_match, > + }, > +}; > + > +static int __init clk_ast2700_init(void) { > + return platform_driver_register(&ast2700_scu_driver); > +} > +arch_initcall(clk_ast2700_init); > -- > 2.34.1 From krzk at kernel.org Wed Jul 9 17:46:15 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Wed, 9 Jul 2025 09:46:15 +0200 Subject: [net-next v4 1/4] dt-bindings: net: ftgmac100: Add resets property In-Reply-To: <20250709070809.2560688-2-jacky_chou@aspeedtech.com> References: <20250709070809.2560688-1-jacky_chou@aspeedtech.com> <20250709070809.2560688-2-jacky_chou@aspeedtech.com> Message-ID: <20250709-simple-blue-chinchilla-164051@krzk-bin> On Wed, Jul 09, 2025 at 03:08:06PM +0800, Jacky Chou wrote: > In Aspeed AST2600 design, the MAC internal delay on MAC register cannot > fully reset the RMII interfaces, it may cause the RMII incompletely. > Therefore, we need to add resets property to do SoC-level reset line to > reset the whole MAC function that includes ftgmac, RGMII and RMII. > > Signed-off-by: Jacky Chou > --- > .../bindings/net/faraday,ftgmac100.yaml | 21 ++++++++++++++++--- Reviewed-by: Krzysztof Kozlowski Best regards, Krzysztof From andrew at lunn.ch Wed Jul 9 23:23:59 2025 From: andrew at lunn.ch (Andrew Lunn) Date: Wed, 9 Jul 2025 15:23:59 +0200 Subject: [net-next v4 4/4] net: ftgmac100: Add optional reset control for RMII mode on Aspeed SoCs In-Reply-To: <20250709070809.2560688-5-jacky_chou@aspeedtech.com> References: <20250709070809.2560688-1-jacky_chou@aspeedtech.com> <20250709070809.2560688-5-jacky_chou@aspeedtech.com> Message-ID: <3dee14d4-c8bd-4c27-b9b1-28b449510b84@lunn.ch> On Wed, Jul 09, 2025 at 03:08:09PM +0800, Jacky Chou wrote: > On Aspeed SoCs, the internal MAC reset is insufficient to fully reset the > RMII interface; only the SoC-level reset line can properly reset the RMII > logic. This patch adds support for an optional "resets" property in the > device tree, allowing the driver to assert and deassert the SoC reset line > when operating in RMII mode. This ensures the MAC and RMII interface are > correctly reset and initialized. > > Signed-off-by: Jacky Chou Reviewed-by: Andrew Lunn Andrew From andrew at codeconstruct.com.au Thu Jul 10 12:24:13 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Thu, 10 Jul 2025 11:54:13 +0930 Subject: [GIT PULL] aspeed: drivers: changes for 6.16-rc6 Message-ID: Hello SoC maintainers, Here are two fixes to the ASPEED LPC snoop driver for the 6.16 release cycle. Cheers, Andrew The following changes since commit 19272b37aa4f83ca52bdf9c16d5d81bdd1354494: Linux 6.16-rc1 (2025-06-08 13:44:43 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/bmc/linux.git tags/aspeed-6.16-fixes-0 for you to fetch changes up to 56448e78a6bb4e1a8528a0e2efe94eff0400c247: soc: aspeed: lpc-snoop: Don't disable channels that aren't enabled (2025-07-02 11:05:20 +0930) ---------------------------------------------------------------- ASPEED SoC driver fixes for 6.16 Address concerns in the ASPEED LPC snoop driver identified in the first two patches of the cleanup series at [1]. [1]: https://lore.kernel.org/all/20250616-aspeed-lpc-snoop-fixes-v2-0-3cdd59c934d3 at codeconstruct.com.au/ ---------------------------------------------------------------- Andrew Jeffery (2): soc: aspeed: lpc-snoop: Cleanup resources in stack-order soc: aspeed: lpc-snoop: Don't disable channels that aren't enabled drivers/soc/aspeed/aspeed-lpc-snoop.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) From andrew at codeconstruct.com.au Thu Jul 10 12:39:04 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Thu, 10 Jul 2025 12:09:04 +0930 Subject: [GIT PULL] aspeed: devicetree changes for 6.17 Message-ID: <36d50489cac1fbae01ec699b742f6c6c459a01cb.camel@codeconstruct.com.au> Hello SoC maintainers, The following changes since commit 19272b37aa4f83ca52bdf9c16d5d81bdd1354494: Linux 6.16-rc1 (2025-06-08 13:44:43 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/bmc/linux.git tags/aspeed-6.17-devicetree-1 for you to fetch changes up to 1c15e359ba53b297ba5fd72bbf626ede72c3de3e: ARM: dts: aspeed: yosemite4: add gpio name for uart mux sel (2025-07-04 13:28:25 +0930) ---------------------------------------------------------------- ASPEED devicetree updates for 6.17 Removed platforms: - IBM's Swift BMC New platforms: - Meta's Santabarbara Santabarbara is a compute node with an accelerator module - NVIDIA's GB200NVL BMC NVIDIA GB200 NVL72 connects 36 Grace CPUs and 72 Blackwell GPUs in an NVIDIA NVLink-connected, liquid-cooled, rack-scale design. Updated BMC platforms: - Bletchley (Meta): GPIO hog names, remove ethernet-phy node, USB PD negotiation - Catalina (Meta): Various sensors added, MCTP support for NIC management - Harma (Meta): Various sensors added - System1 (IBM): IPMB and various GPIO-related updates - Yosemite4 (Meta): GPIO names for UART mux select lines The System1 series includes a devicetree binding patch for IPMI IPMB devices. ---------------------------------------------------------------- Ankit Chauhan (1): ARM: dts: aspeed: lanyang: Fix 'lable' typo in LED nodes Cosmo Chou (1): ARM: dts: aspeed: bletchley: enable USB PD negotiation Fred Chen (2): dt-bindings: arm: aspeed: add Meta Santabarbara board ARM: dts: aspeed: santabarbara: Add Meta Santabarbara BMC Joel Stanley (1): ARM: dts: aspeed: Remove swift machine Krzysztof Kozlowski (1): ARM: dts: aspeed: Align GPIO hog name with bindings Marshall Zhan (1): ARM: dts: aspeed: yosemite4: add gpio name for uart mux sel Ninad Palsule (8): dt-bindings: ipmi: Add binding for IPMB device ARM: dts: aspeed: system1: Add IPMB device ARM: dts: aspeed: system1: Add GPIO line name ARM: dts: aspeed: system1: Reduce sgpio speed ARM: dts: aspeed: system1: Update LED gpio name ARM: dts: aspeed: system1: Remove VRs max8952 ARM: dts: aspeed: system1: Mark GPIO line high/low ARM: dts: aspeed: system1: Disable gpio pull down Peter Yin (5): ARM: dts: aspeed: harma: add E1.S power monitor ARM: dts: aspeed: harma: add fan board I/O expander ARM: dts: aspeed: harma: add ADC128D818 for voltage monitoring ARM: dts: aspeed: Harma: revise gpio bride pin for battery ARM: dts: aspeed: harma: add mmc health Potin Lai (12): ARM: dts: aspeed: bletchley: remove unused ethernet-phy node ARM: dts: aspeed: catalina: Add IO Mezz board thermal sensor nodes ARM: dts: aspeed: catalina: Add Front IO board remote thermal sensor ARM: dts: aspeed: catalina: Add MP5990 power sensor node ARM: dts: aspeed: catalina: Add fan controller support ARM: dts: aspeed: catalina: Add second source fan controller support ARM: dts: aspeed: catalina: Add second source HSC node support ARM: dts: aspeed: catalina: Remove INA238 and INA230 nodes ARM: dts: aspeed: catalina: Enable multi-master on additional I2C buses ARM: dts: aspeed: catalina: Update CBC FRU EEPROM I2C bus and address ARM: dts: aspeed: catalina: Enable MCTP support for NIC management ARM: dts: aspeed: catalina: Enable MCTP for frontend NIC management Willie Thai (2): dt-bindings: arm: aspeed: add Nvidia's GB200NVL BMC ARM: dts: aspeed: Add device tree for Nvidia's GB200NVL BMC Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 2 + Documentation/devicetree/bindings/ipmi/ipmb-dev.yaml | 56 +++++ arch/arm/boot/dts/aspeed/Makefile | 3 +- arch/arm/boot/dts/aspeed/aspeed-bmc-ampere-mtjade.dts | 2 +- arch/arm/boot/dts/aspeed/aspeed-bmc-arm-stardragon4800-rep2.dts | 4 +- arch/arm/boot/dts/aspeed/aspeed-bmc-asrock-e3c246d4i.dts | 2 +- arch/arm/boot/dts/aspeed/aspeed-bmc-bytedance-g220a.dts | 4 +- arch/arm/boot/dts/aspeed/aspeed-bmc-delta-ahe50dc.dts | 2 +- arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-bletchley.dts | 71 +++--- arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-catalina.dts | 209 ++++++++++++---- arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-harma.dts | 85 ++++++- arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-santabarbara.dts | 982 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-yosemite4.dts | 40 ++++ arch/arm/boot/dts/aspeed/aspeed-bmc-ibm-bonnell.dts | 2 +- arch/arm/boot/dts/aspeed/aspeed-bmc-ibm-everest.dts | 2 +- arch/arm/boot/dts/aspeed/aspeed-bmc-ibm-rainier.dts | 4 +- arch/arm/boot/dts/aspeed/aspeed-bmc-ibm-system1.dts | 139 ++++++----- arch/arm/boot/dts/aspeed/aspeed-bmc-lenovo-hr630.dts | 46 ++-- arch/arm/boot/dts/aspeed/aspeed-bmc-lenovo-hr855xg2.dts | 68 +++--- arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts | 1128 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ arch/arm/boot/dts/aspeed/aspeed-bmc-opp-lanyang.dts | 18 +- arch/arm/boot/dts/aspeed/aspeed-bmc-opp-nicole.dts | 10 +- arch/arm/boot/dts/aspeed/aspeed-bmc-opp-palmetto.dts | 40 ++-- arch/arm/boot/dts/aspeed/aspeed-bmc-opp-romulus.dts | 6 +- arch/arm/boot/dts/aspeed/aspeed-bmc-opp-swift.dts | 974 -------------------------------------------------------------------------- arch/arm/boot/dts/aspeed/aspeed-bmc-opp-zaius.dts | 8 +- 26 files changed, 2685 insertions(+), 1222 deletions(-) create mode 100644 Documentation/devicetree/bindings/ipmi/ipmb-dev.yaml create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-santabarbara.dts create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts delete mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-opp-swift.dts From andrew at codeconstruct.com.au Thu Jul 10 12:53:59 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Thu, 10 Jul 2025 12:23:59 +0930 Subject: [GIT PULL] aspeed: drivers changes for 6.17 Message-ID: <9123f151280e52c63dcb645cb07d4eee3462c067.camel@codeconstruct.com.au> Hello SoC maintainers, I've done further rework to the ASPEED LPC snoop driver in addition to the immediate fixes found in the PR at [1]. The commits in the tag for this PR build directly on top, so those from [1] are also listed in the shortlog relative to v6.16-rc1. [1]: https://lore.kernel.org/all/d119a7b44b25a1e55a710adec7fce3e9a9fc898e.camel at codeconstruct.com.au/ Let me know if I should arrange the changes (or the PR description) in some other way. Cheers, Andrew The following changes since commit 19272b37aa4f83ca52bdf9c16d5d81bdd1354494: Linux 6.16-rc1 (2025-06-08 13:44:43 -0700) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/bmc/linux.git tags/aspeed-6.17-drivers-1 for you to fetch changes up to fdf003f30b99e232cd3e61cc42d836ed14d08ccb: soc: aspeed: lpc-snoop: Lift channel config to const structs (2025-07-08 11:35:07 +0930) ---------------------------------------------------------------- ASPEED SoC driver updates for 6.17 The ASPEED LPC snoop driver was recently the cause of some concern. In addition to the initial fixes, the channel configuration paths are refactored to improve robustness against errors. ---------------------------------------------------------------- Andrew Jeffery (10): soc: aspeed: lpc-snoop: Cleanup resources in stack-order soc: aspeed: lpc-snoop: Don't disable channels that aren't enabled soc: aspeed: lpc-snoop: Ensure model_data is valid soc: aspeed: lpc-snoop: Constrain parameters in channel paths soc: aspeed: lpc-snoop: Rename 'channel' to 'index' in channel paths soc: aspeed: lpc-snoop: Rearrange channel paths soc: aspeed: lpc-snoop: Switch to devm_clk_get_enabled() soc: aspeed: lpc-snoop: Use dev_err_probe() where possible soc: aspeed: lpc-snoop: Consolidate channel initialisation soc: aspeed: lpc-snoop: Lift channel config to const structs drivers/soc/aspeed/aspeed-lpc-snoop.c | 224 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------- 1 file changed, 110 insertions(+), 114 deletions(-) From patchwork-bot+netdevbpf at kernel.org Fri Jul 11 11:20:33 2025 From: patchwork-bot+netdevbpf at kernel.org (patchwork-bot+netdevbpf at kernel.org) Date: Fri, 11 Jul 2025 01:20:33 +0000 Subject: [net-next v4 0/4] net: ftgmac100: Add SoC reset support for RMII mode In-Reply-To: <20250709070809.2560688-1-jacky_chou@aspeedtech.com> References: <20250709070809.2560688-1-jacky_chou@aspeedtech.com> Message-ID: <175219683324.1724831.15355320324094175037.git-patchwork-notify@kernel.org> Hello: This series was applied to netdev/net-next.git (main) by Jakub Kicinski : On Wed, 9 Jul 2025 15:08:05 +0800 you wrote: > This patch series adds support for an optional reset line to the > ftgmac100 ethernet controller, as used on Aspeed SoCs. On these SoCs, > the internal MAC reset is not sufficient to reset the RMII interface. > By providing a SoC-level reset via the device tree "resets" property, > the driver can properly reset both the MAC and RMII logic, ensuring > correct operation in RMII mode. > > [...] Here is the summary with links: - [net-next,v4,1/4] dt-bindings: net: ftgmac100: Add resets property https://git.kernel.org/netdev/net-next/c/fc6c8af6d784 - [net-next,v4,2/4] dt-bindings: clock: ast2600: Add reset definitions for MAC1 and MAC2 https://git.kernel.org/netdev/net-next/c/4dc5f7b2c0cc - [net-next,v4,3/4] ARM: dts: aspeed-g6: Add resets property for MAC controllers (no matching commit) - [net-next,v4,4/4] net: ftgmac100: Add optional reset control for RMII mode on Aspeed SoCs https://git.kernel.org/netdev/net-next/c/af350ee72e9d You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html From jacky_chou at aspeedtech.com Wed Jul 9 17:08:09 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Wed, 9 Jul 2025 15:08:09 +0800 Subject: [net-next v4 4/4] net: ftgmac100: Add optional reset control for RMII mode on Aspeed SoCs In-Reply-To: <20250709070809.2560688-1-jacky_chou@aspeedtech.com> References: <20250709070809.2560688-1-jacky_chou@aspeedtech.com> Message-ID: <20250709070809.2560688-5-jacky_chou@aspeedtech.com> On Aspeed SoCs, the internal MAC reset is insufficient to fully reset the RMII interface; only the SoC-level reset line can properly reset the RMII logic. This patch adds support for an optional "resets" property in the device tree, allowing the driver to assert and deassert the SoC reset line when operating in RMII mode. This ensures the MAC and RMII interface are correctly reset and initialized. Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index a98d5af3f9e3..05b8e3743a79 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -9,6 +9,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include +#include #include #include #include @@ -101,6 +102,8 @@ struct ftgmac100 { /* AST2500/AST2600 RMII ref clock gate */ struct clk *rclk; + /* Aspeed reset control */ + struct reset_control *rst; /* Link management */ int cur_speed; @@ -148,6 +151,23 @@ static int ftgmac100_reset_and_config_mac(struct ftgmac100 *priv) { u32 maccr = 0; + /* Aspeed RMII needs SCU reset to clear status */ + if (priv->is_aspeed && priv->netdev->phydev->interface == PHY_INTERFACE_MODE_RMII) { + int err; + + err = reset_control_assert(priv->rst); + if (err) { + dev_err(priv->dev, "Failed to reset mac (%d)\n", err); + return err; + } + usleep_range(10000, 20000); + err = reset_control_deassert(priv->rst); + if (err) { + dev_err(priv->dev, "Failed to deassert mac reset (%d)\n", err); + return err; + } + } + switch (priv->cur_speed) { case SPEED_10: case 0: /* no link */ @@ -1968,6 +1988,12 @@ static int ftgmac100_probe(struct platform_device *pdev) } + priv->rst = devm_reset_control_get_optional_exclusive(priv->dev, NULL); + if (IS_ERR(priv->rst)) { + err = PTR_ERR(priv->rst); + goto err_phy_connect; + } + if (priv->is_aspeed) { err = ftgmac100_setup_clk(priv); if (err) -- 2.34.1 From jacky_chou at aspeedtech.com Wed Jul 9 17:08:05 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Wed, 9 Jul 2025 15:08:05 +0800 Subject: [net-next v4 0/4] net: ftgmac100: Add SoC reset support for RMII mode Message-ID: <20250709070809.2560688-1-jacky_chou@aspeedtech.com> This patch series adds support for an optional reset line to the ftgmac100 ethernet controller, as used on Aspeed SoCs. On these SoCs, the internal MAC reset is not sufficient to reset the RMII interface. By providing a SoC-level reset via the device tree "resets" property, the driver can properly reset both the MAC and RMII logic, ensuring correct operation in RMII mode. The series includes: - Device tree binding update to document the new "resets" property. - Addition of MAC1/2/3/4 reset definitions for AST2600. - Device tree changes for AST2600 to use the new reset properties. - Driver changes to assert/deassert the reset line as needed. This improves reliability and initialization of the MAC in RMII mode on Aspeed platforms. Jacky Chou (4): dt-bindings: net: ftgmac100: Add resets property dt-bindings: clock: ast2600: Add reset definitions for MAC1 and MAC2 ARM: dts: aspeed-g6: Add resets property for MAC controllers net: ftgmac100: Add optional reset control for RMII mode on Aspeed SoCs .../bindings/net/faraday,ftgmac100.yaml | 21 ++++++++++++--- arch/arm/boot/dts/aspeed/aspeed-g6.dtsi | 4 +++ drivers/net/ethernet/faraday/ftgmac100.c | 26 +++++++++++++++++++ include/dt-bindings/clock/ast2600-clock.h | 2 ++ 4 files changed, 50 insertions(+), 3 deletions(-) --- v4: - Added more useful commit messages to faraday,ftgmac100.yaml. v3: - Fixed allOf in faraday,ftgmac100.yaml. v2: - Added restriction on resets property in faraday,ftgmac100.yaml. --- -- 2.34.1 From jacky_chou at aspeedtech.com Wed Jul 9 17:08:06 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Wed, 9 Jul 2025 15:08:06 +0800 Subject: [net-next v4 1/4] dt-bindings: net: ftgmac100: Add resets property In-Reply-To: <20250709070809.2560688-1-jacky_chou@aspeedtech.com> References: <20250709070809.2560688-1-jacky_chou@aspeedtech.com> Message-ID: <20250709070809.2560688-2-jacky_chou@aspeedtech.com> In Aspeed AST2600 design, the MAC internal delay on MAC register cannot fully reset the RMII interfaces, it may cause the RMII incompletely. Therefore, we need to add resets property to do SoC-level reset line to reset the whole MAC function that includes ftgmac, RGMII and RMII. Signed-off-by: Jacky Chou --- .../bindings/net/faraday,ftgmac100.yaml | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml b/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml index 55d6a8379025..d14410018bcf 100644 --- a/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml +++ b/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml @@ -6,9 +6,6 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Faraday Technology FTGMAC100 gigabit ethernet controller -allOf: - - $ref: ethernet-controller.yaml# - maintainers: - Po-Yu Chuang @@ -35,6 +32,9 @@ properties: - description: MAC IP clock - description: RMII RCLK gate for AST2500/2600 + resets: + maxItems: 1 + clock-names: minItems: 1 items: @@ -74,6 +74,21 @@ required: - reg - interrupts +allOf: + - $ref: ethernet-controller.yaml# + - if: + properties: + compatible: + contains: + enum: + - aspeed,ast2600-mac + then: + properties: + resets: true + else: + properties: + resets: false + unevaluatedProperties: false examples: -- 2.34.1 From jacky_chou at aspeedtech.com Wed Jul 9 17:08:08 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Wed, 9 Jul 2025 15:08:08 +0800 Subject: [net-next v4 3/4] ARM: dts: aspeed-g6: Add resets property for MAC controllers In-Reply-To: <20250709070809.2560688-1-jacky_chou@aspeedtech.com> References: <20250709070809.2560688-1-jacky_chou@aspeedtech.com> Message-ID: <20250709070809.2560688-4-jacky_chou@aspeedtech.com> Add the "resets" property to the MAC nodes in the AST2600 device tree, using the appropriate ASPEED_RESET_MACx definitions. Signed-off-by: Jacky Chou --- arch/arm/boot/dts/aspeed/aspeed-g6.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi b/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi index 8ed715bd53aa..f9fe89665e49 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi +++ b/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi @@ -236,6 +236,7 @@ mac0: ethernet at 1e660000 { reg = <0x1e660000 0x180>; interrupts = ; clocks = <&syscon ASPEED_CLK_GATE_MAC1CLK>; + resets = <&syscon ASPEED_RESET_MAC1>; status = "disabled"; }; @@ -244,6 +245,7 @@ mac1: ethernet at 1e680000 { reg = <0x1e680000 0x180>; interrupts = ; clocks = <&syscon ASPEED_CLK_GATE_MAC2CLK>; + resets = <&syscon ASPEED_RESET_MAC2>; status = "disabled"; }; @@ -252,6 +254,7 @@ mac2: ethernet at 1e670000 { reg = <0x1e670000 0x180>; interrupts = ; clocks = <&syscon ASPEED_CLK_GATE_MAC3CLK>; + resets = <&syscon ASPEED_RESET_MAC3>; status = "disabled"; }; @@ -260,6 +263,7 @@ mac3: ethernet at 1e690000 { reg = <0x1e690000 0x180>; interrupts = ; clocks = <&syscon ASPEED_CLK_GATE_MAC4CLK>; + resets = <&syscon ASPEED_RESET_MAC4>; status = "disabled"; }; -- 2.34.1 From jacky_chou at aspeedtech.com Wed Jul 9 17:08:07 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Wed, 9 Jul 2025 15:08:07 +0800 Subject: [net-next v4 2/4] dt-bindings: clock: ast2600: Add reset definitions for MAC1 and MAC2 In-Reply-To: <20250709070809.2560688-1-jacky_chou@aspeedtech.com> References: <20250709070809.2560688-1-jacky_chou@aspeedtech.com> Message-ID: <20250709070809.2560688-3-jacky_chou@aspeedtech.com> Add ASPEED_RESET_MAC1 and ASPEED_RESET_MAC2 reset definitions to the ast2600-clock binding header. These are required for proper reset control of the MAC1 and MAC2 ethernet controllers on the AST2600 SoC. Signed-off-by: Jacky Chou Acked-by: Conor Dooley Acked-by: Stephen Boyd --- include/dt-bindings/clock/ast2600-clock.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/dt-bindings/clock/ast2600-clock.h b/include/dt-bindings/clock/ast2600-clock.h index 7ae96c7bd72f..f60fff261130 100644 --- a/include/dt-bindings/clock/ast2600-clock.h +++ b/include/dt-bindings/clock/ast2600-clock.h @@ -122,6 +122,8 @@ #define ASPEED_RESET_PCIE_DEV_OEN 20 #define ASPEED_RESET_PCIE_RC_O 19 #define ASPEED_RESET_PCIE_RC_OEN 18 +#define ASPEED_RESET_MAC2 12 +#define ASPEED_RESET_MAC1 11 #define ASPEED_RESET_PCI_DP 5 #define ASPEED_RESET_HACE 4 #define ASPEED_RESET_AHB 1 -- 2.34.1 From jacky_chou at aspeedtech.com Wed Jul 9 15:52:12 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Wed, 9 Jul 2025 05:52:12 +0000 Subject: =?utf-8?B?5Zue6KaGOiBbbmV0LW5leHQgdjMgMS80XSBkdC1iaW5kaW5nczogbmV0OiBm?= =?utf-8?Q?tgmac100:_Add_resets_property?= In-Reply-To: <20250708-termite-of-legal-imagination-826a9d@krzk-bin> References: <20250708065544.201896-1-jacky_chou@aspeedtech.com> <20250708065544.201896-2-jacky_chou@aspeedtech.com> <20250708-termite-of-legal-imagination-826a9d@krzk-bin> Message-ID: Hi Krzysztof Thank you for your reply. > > Add optional resets property for Aspeed SoCs to reset the MAC and > > s/Aspeed SoCs/Aspeed AST2600 SoCs/ > > > RGMII/RMII. > > ... because ? It was missing? Incomplete? You changed hardware? > > Make the commits useful, explain WHY you are doing, not repeating WHAT > you are doing. What is obvious from the diff. You already got this feedback with > other patches. > Agreed. Got it. I will add more commit message to describe why we do that and what we do. > > > > Signed-off-by: Jacky Chou > > --- > > .../bindings/net/faraday,ftgmac100.yaml | 23 > ++++++++++++++++--- > > 1 file changed, 20 insertions(+), 3 deletions(-) > > > > diff --git > > a/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml > > b/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml > > index 55d6a8379025..a2e7d439074a 100644 > > --- a/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml > > +++ b/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml > > @@ -6,9 +6,6 @@ $schema: > http://devicetree.org/meta-schemas/core.yaml# > > > > title: Faraday Technology FTGMAC100 gigabit ethernet controller > > > > -allOf: > > - - $ref: ethernet-controller.yaml# > > - > > maintainers: > > - Po-Yu Chuang > > > > @@ -35,6 +32,11 @@ properties: > > - description: MAC IP clock > > - description: RMII RCLK gate for AST2500/2600 > > > > + resets: > > + maxItems: 1 > > + description: > > + Optional reset control for the MAC controller > > Drop description, redundant and obvious form the schema. It cannot be a reset > for anything else than MAC controller, because this is the MAC controller. It > cannot be "non optional" because schema says it is optional. > > Write concise and USEFUL descriptions/commit messages, not just something > to satisfy line/patch count. Agreed. I will adjust this part to meet schema. Thanks, Jacky From leo.jt.wang at gmail.com Tue Jul 8 20:18:00 2025 From: leo.jt.wang at gmail.com (Leo Wang) Date: Tue, 08 Jul 2025 18:18:00 +0800 Subject: [PATCH v6 1/2] dt-bindings: arm: aspeed: add Meta Clemente board In-Reply-To: <20250708-add-support-for-meta-clemente-bmc-v6-0-7f3e57bd0336@fii-foxconn.com> References: <20250708-add-support-for-meta-clemente-bmc-v6-0-7f3e57bd0336@fii-foxconn.com> Message-ID: <20250708-add-support-for-meta-clemente-bmc-v6-1-7f3e57bd0336@fii-foxconn.com> From: Leo Wang Document the new compatibles used on Meta Clemente. Signed-off-by: Leo Wang --- Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml index 01333ac111fbb076582a6c0e801903c3500b459f..ff3fea63cecd99ec2dc56d3cf71403f897681a98 100644 --- a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml +++ b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml @@ -81,6 +81,7 @@ properties: - asus,x4tf-bmc - facebook,bletchley-bmc - facebook,catalina-bmc + - facebook,clemente-bmc - facebook,cloudripper-bmc - facebook,elbert-bmc - facebook,fuji-bmc -- 2.43.0 From jacky_chou at aspeedtech.com Tue Jul 8 16:55:43 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Tue, 8 Jul 2025 14:55:43 +0800 Subject: [net-next v3 3/4] ARM: dts: aspeed-g6: Add resets property for MAC controllers In-Reply-To: <20250708065544.201896-1-jacky_chou@aspeedtech.com> References: <20250708065544.201896-1-jacky_chou@aspeedtech.com> Message-ID: <20250708065544.201896-4-jacky_chou@aspeedtech.com> Add the "resets" property to the MAC nodes in the AST2600 device tree, using the appropriate ASPEED_RESET_MACx definitions. Signed-off-by: Jacky Chou --- arch/arm/boot/dts/aspeed/aspeed-g6.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi b/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi index 8ed715bd53aa..f9fe89665e49 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi +++ b/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi @@ -236,6 +236,7 @@ mac0: ethernet at 1e660000 { reg = <0x1e660000 0x180>; interrupts = ; clocks = <&syscon ASPEED_CLK_GATE_MAC1CLK>; + resets = <&syscon ASPEED_RESET_MAC1>; status = "disabled"; }; @@ -244,6 +245,7 @@ mac1: ethernet at 1e680000 { reg = <0x1e680000 0x180>; interrupts = ; clocks = <&syscon ASPEED_CLK_GATE_MAC2CLK>; + resets = <&syscon ASPEED_RESET_MAC2>; status = "disabled"; }; @@ -252,6 +254,7 @@ mac2: ethernet at 1e670000 { reg = <0x1e670000 0x180>; interrupts = ; clocks = <&syscon ASPEED_CLK_GATE_MAC3CLK>; + resets = <&syscon ASPEED_RESET_MAC3>; status = "disabled"; }; @@ -260,6 +263,7 @@ mac3: ethernet at 1e690000 { reg = <0x1e690000 0x180>; interrupts = ; clocks = <&syscon ASPEED_CLK_GATE_MAC4CLK>; + resets = <&syscon ASPEED_RESET_MAC4>; status = "disabled"; }; -- 2.34.1 From leo.jt.wang at gmail.com Tue Jul 8 20:17:59 2025 From: leo.jt.wang at gmail.com (Leo Wang) Date: Tue, 08 Jul 2025 18:17:59 +0800 Subject: [PATCH v6 0/2] ARM: dts: Add support for Meta Clemente BMC Message-ID: <20250708-add-support-for-meta-clemente-bmc-v6-0-7f3e57bd0336@fii-foxconn.com> This series adds initial support for the Meta Clemente BMC based on the ASPEED AST2600 SoC. Patch 1 documents the compatible string. Patch 2 adds the device tree for the board. Signed-off-by: Leo Wang --- Changes in v6: - Correct Author email to match Signed-off-by email address. - Link to v5: https://lore.kernel.org/r/20250627-add-support-for-meta-clemente-bmc-v5-0-038ed6f1cb9f at fii-foxconn.com Changes in v5: - Remove accidentally pasted texts. - Link to v4: https://lore.kernel.org/r/20250627-add-support-for-meta-clemente-bmc-v4-0-ce7ff23460c4 at fii-foxconn.com Changes in v4: - Move properties of nodes defined in the same file from label ref back to where they belong. - Move pinctrl default configs for ncsi3 and ncsi4 to aspeed-g6-pinctrl.dtsi. - Add properties to i2c10 and i2c15 to enable MCTP. - Link to v3: https://lore.kernel.org/r/20250623-add-support-for-meta-clemente-bmc-v3-0-c223ffcf46cf at fii-foxconn.com Changes in v3: - Modify leakage sensor to reflect current design. - Link to v2: https://lore.kernel.org/r/20250621-add-support-for-meta-clemente-bmc-v2-0-6c5ef059149c at fii-foxconn.com Changes in v2: - Fix patch 1/2 subject line to match dt-bindings convention. - Reorder device tree nodes in patch 2/2 to follow upstream DTS style. - Link to v1: https://lore.kernel.org/r/20250618-add-support-for-meta-clemente-bmc-v1-0-e5ca669ee47b at fii-foxconn.com --- Leo Wang (2): dt-bindings: arm: aspeed: add Meta Clemente board ARM: dts: aspeed: clemente: add Meta Clemente BMC .../devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + arch/arm/boot/dts/aspeed/Makefile | 1 + .../dts/aspeed/aspeed-bmc-facebook-clemente.dts | 1291 ++++++++++++++++++++ arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi | 11 + 4 files changed, 1304 insertions(+) --- base-commit: 52da431bf03b5506203bca27fe14a97895c80faf change-id: 20250618-add-support-for-meta-clemente-bmc-941a469bc523 Best regards, -- Leo Wang From jacky_chou at aspeedtech.com Tue Jul 8 16:55:44 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Tue, 8 Jul 2025 14:55:44 +0800 Subject: [net-next v3 4/4] net: ftgmac100: Add optional reset control for RMII mode on Aspeed SoCs In-Reply-To: <20250708065544.201896-1-jacky_chou@aspeedtech.com> References: <20250708065544.201896-1-jacky_chou@aspeedtech.com> Message-ID: <20250708065544.201896-5-jacky_chou@aspeedtech.com> On Aspeed SoCs, the internal MAC reset is insufficient to fully reset the RMII interface; only the SoC-level reset line can properly reset the RMII logic. This patch adds support for an optional "resets" property in the device tree, allowing the driver to assert and deassert the SoC reset line when operating in RMII mode. This ensures the MAC and RMII interface are correctly reset and initialized. Signed-off-by: Jacky Chou --- drivers/net/ethernet/faraday/ftgmac100.c | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c index a98d5af3f9e3..05b8e3743a79 100644 --- a/drivers/net/ethernet/faraday/ftgmac100.c +++ b/drivers/net/ethernet/faraday/ftgmac100.c @@ -9,6 +9,7 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include +#include #include #include #include @@ -101,6 +102,8 @@ struct ftgmac100 { /* AST2500/AST2600 RMII ref clock gate */ struct clk *rclk; + /* Aspeed reset control */ + struct reset_control *rst; /* Link management */ int cur_speed; @@ -148,6 +151,23 @@ static int ftgmac100_reset_and_config_mac(struct ftgmac100 *priv) { u32 maccr = 0; + /* Aspeed RMII needs SCU reset to clear status */ + if (priv->is_aspeed && priv->netdev->phydev->interface == PHY_INTERFACE_MODE_RMII) { + int err; + + err = reset_control_assert(priv->rst); + if (err) { + dev_err(priv->dev, "Failed to reset mac (%d)\n", err); + return err; + } + usleep_range(10000, 20000); + err = reset_control_deassert(priv->rst); + if (err) { + dev_err(priv->dev, "Failed to deassert mac reset (%d)\n", err); + return err; + } + } + switch (priv->cur_speed) { case SPEED_10: case 0: /* no link */ @@ -1968,6 +1988,12 @@ static int ftgmac100_probe(struct platform_device *pdev) } + priv->rst = devm_reset_control_get_optional_exclusive(priv->dev, NULL); + if (IS_ERR(priv->rst)) { + err = PTR_ERR(priv->rst); + goto err_phy_connect; + } + if (priv->is_aspeed) { err = ftgmac100_setup_clk(priv); if (err) -- 2.34.1 From leo.jt.wang at gmail.com Tue Jul 8 20:18:01 2025 From: leo.jt.wang at gmail.com (Leo Wang) Date: Tue, 08 Jul 2025 18:18:01 +0800 Subject: [PATCH v6 2/2] ARM: dts: aspeed: clemente: add Meta Clemente BMC In-Reply-To: <20250708-add-support-for-meta-clemente-bmc-v6-0-7f3e57bd0336@fii-foxconn.com> References: <20250708-add-support-for-meta-clemente-bmc-v6-0-7f3e57bd0336@fii-foxconn.com> Message-ID: <20250708-add-support-for-meta-clemente-bmc-v6-2-7f3e57bd0336@fii-foxconn.com> From: Leo Wang Add linux device tree entry for Meta Clemente compute-tray BMC using AST2600 SoC. Signed-off-by: Leo Wang --- arch/arm/boot/dts/aspeed/Makefile | 1 + .../dts/aspeed/aspeed-bmc-facebook-clemente.dts | 1291 ++++++++++++++++++++ arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi | 11 + 3 files changed, 1303 insertions(+) diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile index 2e5f4833a073b6c25190fd4b6e89a11f9636fc84..904503f78f960d7bc14cad7cb455bb8bb3138ccd 100644 --- a/arch/arm/boot/dts/aspeed/Makefile +++ b/arch/arm/boot/dts/aspeed/Makefile @@ -19,6 +19,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ aspeed-bmc-delta-ahe50dc.dtb \ aspeed-bmc-facebook-bletchley.dtb \ aspeed-bmc-facebook-catalina.dtb \ + aspeed-bmc-facebook-clemente.dtb \ aspeed-bmc-facebook-cmm.dtb \ aspeed-bmc-facebook-elbert.dtb \ aspeed-bmc-facebook-fuji.dtb \ diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dts new file mode 100644 index 0000000000000000000000000000000000000000..aa67f118b94ee8bc3ec82b2c52af7864223c9f23 --- /dev/null +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dts @@ -0,0 +1,1291 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Copyright (c) 2021 Facebook Inc. +/dts-v1/; + +#include "aspeed-g6.dtsi" +#include +#include +#include +#include +#include + +/ { + model = "Facebook Clemente BMC"; + compatible = "facebook,clemente-bmc", "aspeed,ast2600"; + + aliases { + serial0 = &uart1; + serial2 = &uart3; + serial3 = &uart4; + serial4 = &uart5; + i2c16 = &i2c1mux0ch0; + i2c17 = &i2c1mux0ch1; + i2c18 = &i2c1mux0ch2; + i2c19 = &i2c1mux0ch3; + i2c20 = &i2c1mux0ch4; + i2c21 = &i2c1mux0ch5; + i2c22 = &i2c1mux0ch6; + i2c23 = &i2c1mux0ch7; + i2c24 = &i2c0mux0ch0; + i2c25 = &i2c0mux0ch1; + i2c26 = &i2c0mux0ch2; + i2c27 = &i2c0mux0ch3; + i2c28 = &i2c0mux1ch0; + i2c29 = &i2c0mux1ch1; + i2c30 = &i2c0mux1ch2; + i2c31 = &i2c0mux1ch3; + i2c32 = &i2c0mux2ch0; + i2c33 = &i2c0mux2ch1; + i2c34 = &i2c0mux2ch2; + i2c35 = &i2c0mux2ch3; + i2c36 = &i2c0mux3ch0; + i2c37 = &i2c0mux3ch1; + i2c38 = &i2c0mux3ch2; + i2c39 = &i2c0mux3ch3; + i2c40 = &i2c0mux4ch0; + i2c41 = &i2c0mux4ch1; + i2c42 = &i2c0mux4ch2; + i2c43 = &i2c0mux4ch3; + i2c44 = &i2c0mux5ch0; + i2c45 = &i2c0mux5ch1; + i2c46 = &i2c0mux5ch2; + i2c47 = &i2c0mux5ch3; + i2c48 = &i2c0mux0ch1mux0ch0; + i2c49 = &i2c0mux0ch1mux0ch1; + i2c50 = &i2c0mux0ch1mux0ch2; + i2c51 = &i2c0mux0ch1mux0ch3; + i2c52 = &i2c0mux3ch1mux0ch0; + i2c53 = &i2c0mux3ch1mux0ch1; + i2c54 = &i2c0mux3ch1mux0ch2; + i2c55 = &i2c0mux3ch1mux0ch3; + }; + + chosen { + stdout-path = "serial4:57600n8"; + }; + + memory at 80000000 { + device_type = "memory"; + reg = <0x80000000 0x80000000>; + }; + + iio-hwmon { + compatible = "iio-hwmon"; + io-channels = <&adc0 0>, <&adc0 1>, <&adc0 2>, <&adc0 3>, + <&adc0 4>, <&adc0 5>, <&adc0 6>, <&adc0 7>, + <&adc1 2>; + }; + + spi1_gpio: spi { + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + sck-gpios = <&gpio0 ASPEED_GPIO(Z, 3) GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio0 ASPEED_GPIO(Z, 4) GPIO_ACTIVE_HIGH>; + miso-gpios = <&gpio0 ASPEED_GPIO(Z, 5) GPIO_ACTIVE_HIGH>; + cs-gpios = <&gpio0 ASPEED_GPIO(Z, 0) GPIO_ACTIVE_LOW>; + num-chipselects = <1>; + + tpm at 0 { + compatible = "infineon,slb9670", "tcg,tpm_tis-spi"; + spi-max-frequency = <33000000>; + reg = <0>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + label = "bmc_heartbeat_amber"; + gpios = <&gpio0 ASPEED_GPIO(P, 7) GPIO_ACTIVE_LOW>; + linux,default-trigger = "heartbeat"; + }; + + led-1 { + label = "fp_id_amber"; + default-state = "off"; + gpios = <&gpio0 ASPEED_GPIO(B, 5) GPIO_ACTIVE_HIGH>; + }; + + led-2 { + label = "bmc_ready_noled"; + gpios = <&gpio0 ASPEED_GPIO(B, 3) (GPIO_ACTIVE_HIGH|GPIO_TRANSITORY)>; + }; + + led-3 { + label = "bmc_ready_cpld_noled"; + gpios = <&gpio0 ASPEED_GPIO(P, 5) (GPIO_ACTIVE_HIGH|GPIO_TRANSITORY)>; + }; + }; + + p1v8_bmc_aux: regulator-p1v8-bmc-aux { + compatible = "regulator-fixed"; + regulator-name = "p1v8_bmc_aux"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + + p2v5_bmc_aux: regulator-p2v5-bmc-aux { + compatible = "regulator-fixed"; + regulator-name = "p2v5_bmc_aux"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + regulator-always-on; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + ramoops at b3e00000 { + compatible = "ramoops"; + reg = <0xbb000000 0x200000>; /* 16 * (4 * 0x8000) */ + record-size = <0x8000>; + console-size = <0x8000>; + ftrace-size = <0x8000>; + pmsg-size = <0x8000>; + max-reason = <3>; + }; + }; + +}; + +&adc0 { + vref-supply = <&p1v8_bmc_aux>; + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_adc0_default &pinctrl_adc1_default + &pinctrl_adc2_default &pinctrl_adc3_default + &pinctrl_adc4_default &pinctrl_adc5_default + &pinctrl_adc6_default &pinctrl_adc7_default>; +}; + +&adc1 { + vref-supply = <&p2v5_bmc_aux>; + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_adc10_default>; +}; + +&ehci0 { + status = "okay"; +}; + +&fmc { + status = "okay"; + flash at 0 { + status = "okay"; + m25p,fast-read; + label = "bmc"; + spi-max-frequency = <50000000>; +#include "openbmc-flash-layout-128.dtsi" + }; + flash at 1 { + status = "okay"; + m25p,fast-read; + label = "alt-bmc"; + spi-max-frequency = <50000000>; + }; +}; + +&gpio0 { + gpio-line-names = + /*A0-A7*/ "","","","","","","","", + /*B0-B7*/ "BATTERY_DETECT","PRSNT1_HPM_SCM_N", + "BMC_I2C1_FPGA_ALERT_L","BMC_READY", + "IOEXP_INT_L","FM_ID_LED", + "","", + /*C0-C7*/ "BMC_GPIOC0","","","", + "PMBUS_REQ_N","PSU_FW_UPDATE_REQ_N", + "","BMC_I2C_SSIF_ALERT_L", + /*D0-D7*/ "","","","","BMC_GPIOD4","","","", + /*E0-E7*/ "BMC_GPIOE0","BMC_GPIOE1","","","","","","", + /*F0-F7*/ "","","","","","","","", + /*G0-G7*/ "","","","","","", + "FM_DEBUG_PORT_PRSNT_N","FM_BMC_DBP_PRESENT_N", + /*H0-H7*/ "PWR_BRAKE_L","RUN_POWER_EN", + "SHDN_FORCE_L","SHDN_REQ_L", + "","","","", + /*I0-I7*/ "","","","", + "","FLASH_WP_STATUS", + "FM_PDB_HEALTH_N","RUN_POWER_PG", + /*J0-J7*/ "","","","","","","","", + /*K0-K7*/ "","","","","","","","", + /*L0-L7*/ "","","","","","","","", + /*M0-M7*/ "PCIE_EP_RST_EN","BMC_FRU_WP", + "SCM_HPM_STBY_RST_N","SCM_HPM_STBY_EN", + "STBY_POWER_PG_3V3","TH500_SHDN_OK_L","","", + /*N0-N7*/ "LED_POSTCODE_0","LED_POSTCODE_1", + "LED_POSTCODE_2","LED_POSTCODE_3", + "LED_POSTCODE_4","LED_POSTCODE_5", + "LED_POSTCODE_6","LED_POSTCODE_7", + /*O0-O7*/ "HMC_I2C3_FPGA_ALERT_L","FPGA_READY_HMC", + "CHASSIS_AC_LOSS_L","BSM_PRSNT_R_N", + "PSU_SMB_ALERT_L","FM_TPM_PRSNT_0_N", + "","USBDBG_IPMI_EN_L", + /*P0-P7*/ "PWR_BTN_BMC_N","IPEX_CABLE_PRSNT_L", + "ID_RST_BTN_BMC_N","RST_BMC_RSTBTN_OUT_N", + "host0-ready","BMC_READY_CPLD","BMC_GPIOP6","BMC_HEARTBEAT_N", + /*Q0-Q7*/ "IRQ_PCH_TPM_SPI_N","USB_OC0_REAR_R_N", + "UART_MUX_SEL","I2C_MUX_RESET_L", + "RSVD_NV_PLT_DETECT","SPI_TPM_INT_L", + "CPU_JTAG_MUX_SELECT","THERM_BB_OVERT_L", + /*R0-R7*/ "THERM_BB_WARN_L","SPI_BMC_FPGA_INT_L", + "CPU_BOOT_DONE","PMBUS_GNT_L", + "CHASSIS_PWR_BRK_L","PCIE_WAKE_L", + "PDB_THERM_OVERT_L","HMC_I2C2_FPGA_ALERT_L", + /*S0-S7*/ "","","SYS_BMC_PWRBTN_R_N","FM_TPM_PRSNT_1_N", + "FM_BMC_DEBUG_SW_N","UID_LED_N", + "SYS_FAULT_LED_N","RUN_POWER_FAULT_L", + /*T0-T7*/ "","","","","","","","", + /*U0-U7*/ "","","","","","","","", + /*V0-V7*/ "L2_RST_REQ_OUT_L","L0L1_RST_REQ_OUT_L", + "BMC_ID_BEEP_SEL","BMC_I2C0_FPGA_ALERT_L", + "SMB_BMC_TMP_ALERT","PWR_LED_N", + "SYS_RST_OUT_L","IRQ_TPM_SPI_N", + /*W0-W7*/ "","","","","","","","", + /*X0-X7*/ "","","","","","","","", + /*Y0-Y7*/ "","RST_BMC_SELF_HW", + "FM_FLASH_LATCH_N","BMC_EMMC_RST_N", + "BMC_GPIOY4","BMC_GPIOY5","","", + /*Z0-Z7*/ "","","","","","","BMC_GPIOZ6","BMC_GPIOZ7"; +}; + +&gpio1 { + gpio-line-names = + /*18A0-18A7*/ "","","","","","","","", + /*18B0-18B3*/ "","","","", + /*18B4-18B7*/ "FM_BOARD_BMC_REV_ID0","FM_BOARD_BMC_REV_ID1","FM_BOARD_BMC_REV_ID2","", + /*18C0-18C7*/ "","","PI_BMC_BIOS_ROM_IRQ0_N","","","","","", + /*18D0-18D7*/ "","","","","","","","", + /*18E0-18E3*/ "","","","AC_PWR_BMC_BTN_N","","","",""; +}; + +&i2c0 { + status = "okay"; + + i2c-mux at 71 { + compatible = "nxp,pca9546"; + reg = <0x71>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + // IOB0 NIC0 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + }; + i2c0mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + // HDD FRU EEPROM + eeprom at 56 { + compatible = "atmel,24c128"; + reg = <0x56>; + }; + + // E1.S Backplane + i2c0mux0ch1mux0: i2c-mux at 74 { + compatible = "nxp,pca9546"; + reg = <0x74>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux0ch1mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux0ch1mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + i2c0mux0ch1mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux0ch1mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + }; + i2c0mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + + // IOB0 NIC1 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + }; + i2c0mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 72 { + compatible = "nxp,pca9546"; + reg = <0x72>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux1ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux1ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + // IO Mezz 0 IOEXP + io_expander7: gpio at 20 { + compatible = "nxp,pca9535"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "RST_CX7_0", + "RST_CX7_1", + "CX0_SSD0_PRSNT_L", + "CX1_SSD1_PRSNT_L", + "CX_BOOT_CMPLT_CX0", + "CX_BOOT_CMPLT_CX1", + "CX_TWARN_CX0_L", + "CX_TWARN_CX1_L", + "CX_OVT_SHDN_CX0", + "CX_OVT_SHDN_CX1", + "FNP_L_CX0", + "FNP_L_CX1", + "", + "MCU_GPIO", + "MCU_RST_N", + "MCU_RECOVERY_N"; + }; + + // IO Mezz 0 FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + + // OSFP 0 FRU EEPROM + eeprom at 52 { + compatible = "atmel,24c128"; + reg = <0x52>; + }; + }; + i2c0mux1ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux1ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 73 { + compatible = "nxp,pca9546"; + reg = <0x73>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux2ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux2ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + i2c0mux2ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux2ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 75 { + compatible = "nxp,pca9546"; + reg = <0x75>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux3ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + // IOB1 NIC0 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + }; + i2c0mux3ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + // E1.S Backplane HDD FRU EEPROM + eeprom at 56 { + compatible = "atmel,24c128"; + reg = <0x56>; + }; + + // E1.S Backplane MUX + i2c0mux3ch1mux0: i2c-mux at 74 { + compatible = "nxp,pca9546"; + reg = <0x74>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux3ch1mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux3ch1mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + i2c0mux3ch1mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux3ch1mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + }; + i2c0mux3ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + + // IOB1 NIC1 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + }; + i2c0mux3ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 76 { + compatible = "nxp,pca9546"; + reg = <0x76>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux4ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux4ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + // IO Mezz 1 IOEXP + io_expander8: gpio at 21 { + compatible = "nxp,pca9535"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "SEC_RST_CX7_0", + "SEC_RST_CX7_1", + "SEC_CX0_SSD0_PRSNT_L", + "SEC_CX1_SSD1_PRSNT_L", + "SEC_CX_BOOT_CMPLT_CX0", + "SEC_CX_BOOT_CMPLT_CX1", + "SEC_CX_TWARN_CX0_L", + "SEC_CX_TWARN_CX1_L", + "SEC_CX_OVT_SHDN_CX0", + "SEC_CX_OVT_SHDN_CX1", + "SEC_FNP_L_CX0", + "SEC_FNP_L_CX1", + "", + "SEC_MCU_GPIO", + "SEC_MCU_RST_N", + "SEC_MCU_RECOVERY_N"; + }; + + // IO Mezz 1 FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + + // OSFP 1 FRU EEPROM + eeprom at 52 { + compatible = "atmel,24c128"; + reg = <0x52>; + }; + }; + i2c0mux4ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux4ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 77 { + compatible = "nxp,pca9546"; + reg = <0x77>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux5ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux5ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + i2c0mux5ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux5ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; +}; + +&i2c1 { + status = "okay"; + + // PDB + power-monitor at 12 { + compatible = "ti,lm5066i"; + reg = <0x12>; + }; + + // PDB + power-monitor at 14 { + compatible = "ti,lm5066i"; + reg = <0x14>; + }; + + // Module 0 + fanctl0: fan-controller at 20{ + compatible = "maxim,max31790"; + reg = <0x20>; + }; + + // Module 0 + fanctl1: fan-controller at 23{ + compatible = "maxim,max31790"; + reg = <0x23>; + }; + + // Module 1 + fanctl2: fan-controller at 2c{ + compatible = "maxim,max31790"; + reg = <0x2c>; + }; + + // Module 1 + fanctl3: fan-controller at 2f{ + compatible = "maxim,max31790"; + reg = <0x2f>; + }; + + // Module 0 Leak Sensor + adc at 34 { + compatible = "maxim,max1363"; + reg = <0x34>; + #address-cells = <1>; + #size-cells = <0>; + + channel at 0 { + reg = <0>; + ti,gain = <2>; + }; + + channel at 1 { + reg = <1>; + ti,gain = <2>; + }; + + channel at 2 { + reg = <2>; + ti,gain = <2>; + }; + + channel at 3 { + reg = <3>; + ti,gain = <2>; + }; + }; + + // Module 1 Leak Sensor + adc at 35 { + compatible = "maxim,max1363"; + reg = <0x35>; + #address-cells = <1>; + #size-cells = <0>; + + channel at 0 { + reg = <0>; + ti,gain = <2>; + }; + + channel at 1 { + reg = <1>; + ti,gain = <2>; + }; + + channel at 2 { + reg = <2>; + ti,gain = <2>; + }; + + channel at 3 { + reg = <3>; + ti,gain = <2>; + }; + }; + +// PDB TEMP SENSOR + temperature-sensor at 4e { + compatible = "ti,tmp1075"; + reg = <0x4e>; + }; + + // PDB FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c02"; + reg = <0x50>; + }; + + // PDB + vrm at 60 { + compatible = "renesas,raa228004"; + reg = <0x60>; + }; + + // PDB + vrm at 61 { + compatible = "renesas,raa228004"; + reg = <0x61>; + }; + + // Interposer + i2c-mux at 70 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x70>; + i2c-mux-idle-disconnect; + + i2c1mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0>; + }; + i2c1mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x1>; + }; + i2c1mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x2>; + }; + i2c1mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x3>; + }; + i2c1mux0ch4: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x4>; + }; + i2c1mux0ch5: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x5>; + + // Interposer TEMP SENSOR + temperature-sensor at 4f { + compatible = "ti,tmp75"; + reg = <0x4f>; + }; + + // Interposer FRU EEPROM + eeprom at 54 { + compatible = "atmel,24c64"; + reg = <0x54>; + }; + }; + i2c1mux0ch6: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x6>; + + // Interposer IOEXP + io_expander5: gpio at 27 { + compatible = "nxp,pca9554"; + reg = <0x27>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "JTAG_MUX_SEL", + "IOX_BMC_RESET", + "RTC_CLR_L", + "RTC_U77_ALRT_N", + "", + "PSU_ALERT_N", + "", + "RST_P12V_STBY_N"; + }; + }; + i2c1mux0ch7: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x7>; + + // FIO TEMP SENSOR + temperature-sensor at 4b { + compatible = "ti,tmp75"; + reg = <0x4b>; + }; + + // FIO FRU EEPROM + eeprom at 51 { + compatible = "atmel,24c64"; + reg = <0x51>; + }; + }; + }; +}; + +&i2c2 { + status = "okay"; + // Module 0, Expander @0x20 + io_expander0: gpio at 20 { + compatible = "nxp,pca9555"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "FPGA_THERM_OVERT_L-I", + "FPGA_READY_BMC-I", + "HMC_BMC_DETECT-O", + "HMC_PGOOD-O", + "", + "BMC_STBY_CYCLE-O", + "FPGA_EROT_FATAL_ERROR_L-I", + "WP_HW_EXT_CTRL_L-O", + "EROT_FPGA_RST_L-O", + "FPGA_EROT_RECOVERY_L-O", + "BMC_EROT_FPGA_SPI_MUX_SEL-O", + "USB2_HUB_RST_L-O", + "", + "SGPIO_EN_L-O", + "B2B_IOEXP_INT_L-I", + "I2C_BUS_MUX_RESET_L-O"; + }; + + // Module 1, Expander @0x21 + io_expander1: gpio at 21 { + compatible = "nxp,pca9555"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "SEC_FPGA_THERM_OVERT_L", + "SEC_FPGA_READY_BMC", + "SEC_HMC_BMC_DETECT", + "SEC_HMC_PGOOD", + "", + "SEC_BMC_SELF_POWER_CYCLE", + "SEC_SEC_FPGA_EROT_FATAL_ERROR_L", + "SEC_WP_HW_EXT_CTRL_L", + "SEC_EROT_FPGA_RST_L", + "SEC_FPGA_EROT_RECOVERY_L", + "SEC_BMC_EROT_FPGA_SPI_MUX_SEL", + "SEC_USB2_HUB_RST_L", + "", + "SEC_SGPIO_EN_L", + "SEC_IOB_IOEXP_INT_L", + "SEC_I2C_BUS_MUX_RESET_L"; + }; + + // HMC Expander @0x27 + io_expander2: gpio at 27 { + compatible = "nxp,pca9555"; + reg = <0x27>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "HMC_PRSNT_L-I", + "HMC_READY-I", + "HMC_EROT_FATAL_ERROR_L-I", + "I2C_MUX_SEL-O", + "HMC_EROT_SPI_MUX_SEL-O", + "HMC_EROT_RECOVERY_L-O", + "HMC_EROT_RST_L-O", + "GLOBAL_WP_HMC-O", + "FPGA_RST_L-O", + "USB2_HUB_RST-O", + "CPU_UART_MUX_SEL-O", + "", + "", + "", + "", + ""; + }; + + // Module 0 Aux EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + + // Module 1 Aux EEPROM + eeprom at 51 { + compatible = "atmel,24c64"; + reg = <0x51>; + }; +}; + +&i2c3 { + status = "okay"; +}; + +&i2c4 { + status = "okay"; +}; + +&i2c5 { + status = "okay"; +}; + +&i2c6 { + status = "okay"; + io_expander3: gpio at 21 { + compatible = "nxp,pca9555"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "RTC_MUX_SEL", + "PCI_MUX_SEL", + "TPM_MUX_SEL", + "FAN_MUX-SEL", + "SGMII_MUX_SEL", + "DP_MUX_SEL", + "UPHY3_USB_SEL", + "NCSI_MUX_SEL", + "BMC_PHY_RST", + "RTC_CLR_L", + "BMC_12V_CTRL", + "PS_RUN_IO0_PG", + "", + "", + "", + ""; + }; + + rtc at 6f { + compatible = "nuvoton,nct3018y"; + reg = <0x6f>; + }; +}; + +&i2c7 { + status = "okay"; +}; + +&i2c8 { + status = "okay"; +}; + +&i2c9 { + status = "okay"; + // SCM TEMP SENSOR BOARD + temperature-sensor at 4b { + compatible = "national,lm75b"; + reg = <0x4b>; + }; + + // SCM CPLD IOEXP + io_expander4: gpio at 4f { + compatible = "nxp,pca9555"; + reg = <0x4f>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "stby_power_en_cpld", + "stby_power_gd_cpld", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + ""; + }; + + // SCM FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + + // BSM FRU EEPROM + eeprom at 56 { + compatible = "atmel,24c64"; + reg = <0x56>; + }; +}; + +&i2c10 { + status = "okay"; + multi-master; + mctp-controller; + mctp at 10 { + compatible = "mctp-i2c-controller"; + reg = <(0x10 | I2C_OWN_SLAVE_ADDRESS)>; + }; + + // OCP NIC0 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + + // OCP NIC0 FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; +}; + +&i2c11 { + status = "okay"; + ssif-bmc at 10 { + compatible = "ssif-bmc"; + reg = <0x10>; + }; +}; + +&i2c12 { + status = "okay"; + multi-master; +}; + +&i2c13 { + status = "okay"; + multi-master; + + // HPM FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + // CBC 0 FRU + eeprom at 54 { + compatible = "atmel,24c02"; + reg = <0x54>; + }; + // CBC 1 FRU + eeprom at 55 { + compatible = "atmel,24c02"; + reg = <0x55>; + }; + // CBC 2 FRU + eeprom at 56 { + compatible = "atmel,24c02"; + reg = <0x56>; + }; + // HMC FRU EEPROM + eeprom at 57 { + compatible = "atmel,24c02"; + reg = <0x57>; + }; + // CBC 3 FRU + eeprom at 58 { + compatible = "atmel,24c02"; + reg = <0x58>; + }; +}; + +&i2c14 { + status = "okay"; + + // PDB CPLD IOEXP 0x10 + io_expander9: gpio at 10 { + compatible = "nxp,pca9555"; + interrupt-parent = <&gpio0>; + interrupts = ; + reg = <0x10>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "wSequence_Latch_State_N", + "wP12V_N1N2_RUNTIME_FLT_N", + "wP12V_FAN_RUNTIME_FLT_N", + "wP12V_AUX_RUNTIME_FLT_N", + "wHost_PERST_SEQPWR_FLT_N", + "wP12V_N1N2_SEQPWR_FLT_N", + "wP12V_FAN_SEQPWR_FLT_N", + "wP12V_AUX_SEQPWR_FLT_N", + "wP12V_RUNTIME_FLT_NIC1_N", + "wAUX_RUNTIME_FLT_NIC1_N", + "wP12V_SEQPWR_FLT_NIC1_N", + "wAUX_SEQPWR_FLT_NIC1_N", + "wP12V_RUNTIME_FLT_NIC0_N", + "wAUX_RUNTIME_FLT_NIC0_N", + "wP12V_SEQPWR_FLT_NIC0_N", + "wAUX_SEQPWR_FLT_NIC0_N"; + }; + + // PDB CPLD IOEXP 0x11 + io_expander10: gpio at 11 { + compatible = "nxp,pca9555"; + interrupt-parent = <&gpio0>; + interrupts = ; + reg = <0x11>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "FM_P12V_NIC1_FLTB_R_N", + "FM_P3V3_NIC1_FAULT_R_N", + "FM_P12V_NIC0_FLTB_R_N", + "FM_P3V3_NIC0_FAULT_R_N", + "P48V_HS2_FAULT_N_PLD", + "P48V_HS1_FAULT_N_PLD", + "P12V_AUX_FAN_OC_PLD_N", + "P12V_AUX_FAN_FAULT_PLD_N", + "", + "", + "", + "", + "", + "FM_SYS_THROTTLE_N", + "OCP_V3_2_PWRBRK_FROM_HOST_ISO_PLD_N", + "OCP_SFF_PWRBRK_FROM_HOST_ISO_PLD_N"; + }; + + // PDB CPLD IOEXP 0x12 + io_expander11: gpio at 12 { + compatible = "nxp,pca9555"; + interrupt-parent = <&gpio0>; + interrupts = ; + reg = <0x12>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "P12V_AUX_PSU_SMB_ALERT_R_L", + "P12V_SCM_SENSE_ALERT_R_N", + "P12V_AUX_NIC1_SENSE_ALERT_R_N", + "P12V_AUX_NIC0_SENSE_ALERT_R_N", + "NODEB_PSU_SMB_ALERT_R_L", + "NODEA_PSU_SMB_ALERT_R_L", + "P12V_AUX_FAN_ALERT_PLD_N", + "P52V_SENSE_ALERT_PLD_N", + "PRSNT_RJ45_FIO_N_R", + "FM_MAIN_PWREN_RMC_EN_ISO_R", + "CHASSIS3_LEAK_Q_N_PLD", + "CHASSIS2_LEAK_Q_N_PLD", + "CHASSIS1_LEAK_Q_N_PLD", + "CHASSIS0_LEAK_Q_N_PLD", + "", + "SMB_RJ45_FIO_TMP_ALERT"; + }; + + // PDB CPLD IOEXP 0x13 + io_expander12: gpio at 13 { + compatible = "nxp,pca9555"; + interrupt-parent = <&gpio0>; + interrupts = ; + reg = <0x13>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "FAN_7_PRESENT_N", + "FAN_6_PRESENT_N", + "FAN_5_PRESENT_N", + "FAN_4_PRESENT_N", + "FAN_3_PRESENT_N", + "FAN_2_PRESENT_N", + "FAN_1_PRESENT_N", + "FAN_0_PRESENT_N", + "HP_LVC3_OCP_V3_2_PRSNT2_PLD_N", + "HP_LVC3_OCP_V3_1_PRSNT2_PLD_N", + "PRSNT_HDDBD_POWER_CABLE_N", + "PRSNT_OSFP0_POWER_CABLE_N", + "PRSNT_CHASSIS3_LEAK_CABLE_R_N", + "PRSNT_CHASSIS2_LEAK_CABLE_R_N", + "PRSNT_CHASSIS1_LEAK_CABLE_R_N", + "PRSNT_CHASSIS0_LEAK_CABLE_R_N"; + }; + + // PDB CPLD IOEXP 0x14 + io_expander13: gpio at 14 { + compatible = "nxp,pca9555"; + reg = <0x14>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "rmc_en_dc_pwr_on", + "", + "", + "", + "", + "", + "", + "", + "leak_config_0", + "leak_config_1", + "leak_config_2", + "leak_config_3", + "mfg_led_test_mode_l", + "small_leak_err_inj", + "large_leak_err_inj", + ""; + }; +}; + +&i2c15 { + status = "okay"; + multi-master; + mctp-controller; + mctp at 10 { + compatible = "mctp-i2c-controller"; + reg = <(0x10 | I2C_OWN_SLAVE_ADDRESS)>; + }; + + // OCP NIC1 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + + // OCP NIC1 FRU EEPROM + eeprom at 52 { + compatible = "atmel,24c64"; + reg = <0x52>; + }; +}; + +&mac2 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ncsi3_default>; + use-ncsi; +}; + +&mac3 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ncsi4_default>; + use-ncsi; +}; + +&udma { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; + +&uart3 { + status = "okay"; +}; + +&uart4 { + status = "okay"; +}; + +&uart5 { + status = "okay"; +}; + +&wdt1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_wdtrst1_default>; + aspeed,reset-type = "soc"; + aspeed,external-signal; + aspeed,ext-push-pull; + aspeed,ext-active-high; + aspeed,ext-pulse-duration = <256>; +}; + diff --git a/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi b/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi index 289668f051eb4271ac48ae3ce9b82587911548ee..61b1d1c5040c820f8c995132739becde80e069bb 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi +++ b/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi @@ -412,6 +412,16 @@ pinctrl_mdio4_default: mdio4_default { groups = "MDIO4"; }; + pinctrl_ncsi3_default: ncsi3_default { + function = "RMII3"; + groups = "NCSI3"; + }; + + pinctrl_ncsi4_default: ncsi4_default { + function = "RMII4"; + groups = "NCSI4"; + }; + pinctrl_ncts1_default: ncts1_default { function = "NCTS1"; groups = "NCTS1"; @@ -1192,3 +1202,4 @@ pinctrl_wdtrst4_default: wdtrst4_default { groups = "WDTRST4"; }; }; + -- 2.43.0 From jacky_chou at aspeedtech.com Tue Jul 8 16:55:40 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Tue, 8 Jul 2025 14:55:40 +0800 Subject: [net-next v3 0/4] net: ftgmac100: Add SoC reset support for RMII mode Message-ID: <20250708065544.201896-1-jacky_chou@aspeedtech.com> This patch series adds support for an optional reset line to the ftgmac100 ethernet controller, as used on Aspeed SoCs. On these SoCs, the internal MAC reset is not sufficient to reset the RMII interface. By providing a SoC-level reset via the device tree "resets" property, the driver can properly reset both the MAC and RMII logic, ensuring correct operation in RMII mode. The series includes: - Device tree binding update to document the new "resets" property. - Addition of MAC1 and MAC2 reset definitions for AST2600. - Device tree changes for AST2600 to use the new reset properties. - Driver changes to assert/deassert the reset line as needed. This improves reliability and initialization of the MAC in RMII mode on Aspeed platforms. Jacky Chou (4): dt-bindings: net: ftgmac100: Add resets property dt-bindings: clock: ast2600: Add reset definitions for MAC1 and MAC2 ARM: dts: aspeed-g6: Add resets property for MAC controllers net: ftgmac100: Add optional reset control for RMII mode on Aspeed SoCs .../bindings/net/faraday,ftgmac100.yaml | 23 +++++++++++++--- arch/arm/boot/dts/aspeed/aspeed-g6.dtsi | 4 +++ drivers/net/ethernet/faraday/ftgmac100.c | 26 +++++++++++++++++++ include/dt-bindings/clock/ast2600-clock.h | 2 ++ 4 files changed, 52 insertions(+), 3 deletions(-) --- v3: - Fixed allOf in faraday,ftgmac100.yaml. v2: - Added restriction on resets property in faraday,ftgmac100.yaml. --- -- 2.34.1 From jacky_chou at aspeedtech.com Tue Jul 8 16:55:41 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Tue, 8 Jul 2025 14:55:41 +0800 Subject: [net-next v3 1/4] dt-bindings: net: ftgmac100: Add resets property In-Reply-To: <20250708065544.201896-1-jacky_chou@aspeedtech.com> References: <20250708065544.201896-1-jacky_chou@aspeedtech.com> Message-ID: <20250708065544.201896-2-jacky_chou@aspeedtech.com> Add optional resets property for Aspeed SoCs to reset the MAC and RGMII/RMII. Signed-off-by: Jacky Chou --- .../bindings/net/faraday,ftgmac100.yaml | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml b/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml index 55d6a8379025..a2e7d439074a 100644 --- a/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml +++ b/Documentation/devicetree/bindings/net/faraday,ftgmac100.yaml @@ -6,9 +6,6 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Faraday Technology FTGMAC100 gigabit ethernet controller -allOf: - - $ref: ethernet-controller.yaml# - maintainers: - Po-Yu Chuang @@ -35,6 +32,11 @@ properties: - description: MAC IP clock - description: RMII RCLK gate for AST2500/2600 + resets: + maxItems: 1 + description: + Optional reset control for the MAC controller + clock-names: minItems: 1 items: @@ -74,6 +76,21 @@ required: - reg - interrupts +allOf: + - $ref: ethernet-controller.yaml# + - if: + properties: + compatible: + contains: + enum: + - aspeed,ast2600-mac + then: + properties: + resets: true + else: + properties: + resets: false + unevaluatedProperties: false examples: -- 2.34.1 From jacky_chou at aspeedtech.com Tue Jul 8 16:55:42 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Tue, 8 Jul 2025 14:55:42 +0800 Subject: [net-next v3 2/4] dt-bindings: clock: ast2600: Add reset definitions for MAC1 and MAC2 In-Reply-To: <20250708065544.201896-1-jacky_chou@aspeedtech.com> References: <20250708065544.201896-1-jacky_chou@aspeedtech.com> Message-ID: <20250708065544.201896-3-jacky_chou@aspeedtech.com> Add ASPEED_RESET_MAC1 and ASPEED_RESET_MAC2 reset definitions to the ast2600-clock binding header. These are required for proper reset control of the MAC1 and MAC2 ethernet controllers on the AST2600 SoC. Signed-off-by: Jacky Chou Acked-by: Conor Dooley Acked-by: Stephen Boyd --- include/dt-bindings/clock/ast2600-clock.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/dt-bindings/clock/ast2600-clock.h b/include/dt-bindings/clock/ast2600-clock.h index 7ae96c7bd72f..f60fff261130 100644 --- a/include/dt-bindings/clock/ast2600-clock.h +++ b/include/dt-bindings/clock/ast2600-clock.h @@ -122,6 +122,8 @@ #define ASPEED_RESET_PCIE_DEV_OEN 20 #define ASPEED_RESET_PCIE_RC_O 19 #define ASPEED_RESET_PCIE_RC_OEN 18 +#define ASPEED_RESET_MAC2 12 +#define ASPEED_RESET_MAC1 11 #define ASPEED_RESET_PCI_DP 5 #define ASPEED_RESET_HACE 4 #define ASPEED_RESET_AHB 1 -- 2.34.1 From ryan_chen at aspeedtech.com Mon Jul 14 17:17:53 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Mon, 14 Jul 2025 15:17:53 +0800 Subject: [PATCH] dt-bindings: interrupt-controller: aspeed: Refine AST2700 binding description and example Message-ID: <20250714071753.2653620-1-ryan_chen@aspeedtech.com> - Update block diagram for better readability and accuracy. - Clarify the relationship and function of INTC0, INTC1, and the GIC. - Documentation and example refine. This enhances the documentation quality and helps developers understand the interrupt controller hierarchy and usage. Signed-off-by: Ryan Chen --- .../aspeed,ast2700-intc.yaml | 155 +++++++++++++----- 1 file changed, 112 insertions(+), 43 deletions(-) diff --git a/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml index 55636d06a674..751a07d49c90 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml +++ b/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml @@ -10,6 +10,33 @@ description: This interrupt controller hardware is second level interrupt controller that is hooked to a parent interrupt controller. It's useful to combine multiple interrupt sources into 1 interrupt to parent interrupt controller. + Depend to which INTC0 or INTC1 used. + INTC0 and INTC1 are two kinds of interrupt controller with enable and raw + status registers for use. + INTC0 is used to assert GIC if interrupt in INTC1 asserted. + INTC1 is used to assert INTC0 if interrupt of modules asserted. + +-----+ +---------+ + | GIC |---| INTC0 | + +-----+ +---------+ + +---------+ + | |---module0 + | INTC0_0 |---module1 + | |---... + +---------+---module31 + |---.... | + +---------+ + | | +---------+ + | INTC0_11| +---| INTC1 | + | | +---------+ + +---------+ +---------+---module0 + | INTC1_0 |---module1 + | |---... + +---------+---module31 + ... + +---------+---module0 + | INTC1_5 |---module1 + | |---... + +---------+---module31 maintainers: - Kevin Chen @@ -17,49 +44,67 @@ maintainers: properties: compatible: enum: - - aspeed,ast2700-intc-ic + - aspeed,ast2700-intc0 + - aspeed,ast2700-intc1 reg: maxItems: 1 - interrupt-controller: true + 'address-cells': + const: 2 - '#interrupt-cells': + 'size-cells': const: 2 - description: - The first cell is the IRQ number, the second cell is the trigger - type as defined in interrupt.txt in this directory. - - interrupts: - maxItems: 6 - description: | - Depend to which INTC0 or INTC1 used. - INTC0 and INTC1 are two kinds of interrupt controller with enable and raw - status registers for use. - INTC0 is used to assert GIC if interrupt in INTC1 asserted. - INTC1 is used to assert INTC0 if interrupt of modules asserted. - +-----+ +-------+ +---------+---module0 - | GIC |---| INTC0 |--+--| INTC1_0 |---module2 - | | | | | | |---... - +-----+ +-------+ | +---------+---module31 - | - | +---------+---module0 - +---| INTC1_1 |---module2 - | | |---... - | +---------+---module31 - ... - | +---------+---module0 - +---| INTC1_5 |---module2 - | |---... - +---------+---module31 + ranges: true + +patternProperties: + "^interrupt-controller@": + type: object + description: Interrupt group child nodes + additionalProperties: false + + properties: + compatible: + enum: + - aspeed,ast2700-intc-ic + + reg: + maxItems: 1 + + interrupt-controller: true + + '#interrupt-cells': + const: 2 + description: | + The first cell is the IRQ number, the second cell is the trigger + type as defined in interrupt.txt in this directory. + + interrupts: + minItems: 1 + maxItems: 6 + description: | + The interrupts provided by this interrupt controller. + + interrupts-extended: + minItems: 1 + maxItems: 6 + description: | + This property is required when defining a cascaded interrupt controller + that is connected under another interrupt controller. It specifies the + parent interrupt(s) in the upstream controller to which this controller + is connected. + + required: + - compatible + - reg + - interrupt-controller + - '#interrupt-cells' + - interrupts required: - compatible - reg - - interrupt-controller - - '#interrupt-cells' - - interrupts additionalProperties: false @@ -68,19 +113,43 @@ examples: #include bus { + #address-cells = <2>; + #size-cells = <2>; + + intc0: interrupt-controller at 12100000 { + compatible = "aspeed,ast2700-intc0"; + reg = <0 0x12100000 0 0x4000>; + ranges = <0x0 0x0 0x0 0x12100000 0x0 0x4000>; + #address-cells = <2>; + #size-cells = <2>; + + intc0_11: interrupt-controller at 1b00 { + compatible = "aspeed,ast2700-intc-ic"; + reg = <0 0x12101b00 0x10>; + #interrupt-cells = <2>; + interrupt-controller; + interrupts = , + , + , + , + , + ; + }; + }; + + intc1: interrupt-controller at 14c18000 { + compatible = "aspeed,ast2700-intc1"; + reg = <0 0x14c18000 0 0x400>; + ranges = <0x0 0x0 0x0 0x14c18000 0x0 0x400>; #address-cells = <2>; #size-cells = <2>; - interrupt-controller at 12101b00 { - compatible = "aspeed,ast2700-intc-ic"; - reg = <0 0x12101b00 0 0x10>; - #interrupt-cells = <2>; - interrupt-controller; - interrupts = , - , - , - , - , - ; + intc1_0: interrupt-controller at 100 { + compatible = "aspeed,ast2700-intc-ic"; + reg = <0x0 0x100 0x0 0x10>; + #interrupt-cells = <2>; + interrupt-controller; + interrupts-extended = <&intc0_11 0 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; }; + }; }; -- 2.34.1 From krzk at kernel.org Mon Jul 14 17:21:09 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Mon, 14 Jul 2025 09:21:09 +0200 Subject: [PATCH] dt-bindings: interrupt-controller: aspeed: Refine AST2700 binding description and example In-Reply-To: <20250714071753.2653620-1-ryan_chen@aspeedtech.com> References: <20250714071753.2653620-1-ryan_chen@aspeedtech.com> Message-ID: On 14/07/2025 09:17, Ryan Chen wrote: > - Update block diagram for better readability and accuracy. > - Clarify the relationship and function of INTC0, INTC1, and the GIC. > - Documentation and example refine. > > This enhances the documentation quality and helps developers understand > the interrupt controller hierarchy and usage. Changing ABI (compatibles) is not enhancing quality and is not explained here. > > Signed-off-by: Ryan Chen > --- > .../aspeed,ast2700-intc.yaml | 155 +++++++++++++----- > 1 file changed, 112 insertions(+), 43 deletions(-) > > diff --git a/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml > index 55636d06a674..751a07d49c90 100644 > --- a/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml > +++ b/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml > @@ -10,6 +10,33 @@ description: > This interrupt controller hardware is second level interrupt controller that > is hooked to a parent interrupt controller. It's useful to combine multiple > interrupt sources into 1 interrupt to parent interrupt controller. > + Depend to which INTC0 or INTC1 used. > + INTC0 and INTC1 are two kinds of interrupt controller with enable and raw > + status registers for use. > + INTC0 is used to assert GIC if interrupt in INTC1 asserted. > + INTC1 is used to assert INTC0 if interrupt of modules asserted. > + +-----+ +---------+ > + | GIC |---| INTC0 | > + +-----+ +---------+ > + +---------+ > + | |---module0 > + | INTC0_0 |---module1 > + | |---... > + +---------+---module31 > + |---.... | > + +---------+ > + | | +---------+ > + | INTC0_11| +---| INTC1 | > + | | +---------+ > + +---------+ +---------+---module0 > + | INTC1_0 |---module1 > + | |---... > + +---------+---module31 > + ... > + +---------+---module0 > + | INTC1_5 |---module1 > + | |---... > + +---------+---module31 > > maintainers: > - Kevin Chen > @@ -17,49 +44,67 @@ maintainers: > properties: > compatible: > enum: > - - aspeed,ast2700-intc-ic > + - aspeed,ast2700-intc0 > + - aspeed,ast2700-intc1 No, you cannot change compatibles. You just rewrite entire bindings just because of wish to "refine"? Hardware changed? What happened here? You need to clearly describe ABI impact and reasons, like possible bugs you address. You cannot just rewrite existing binding into something entirely else. Best regards, Krzysztof From ryan_chen at aspeedtech.com Mon Jul 14 17:36:58 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Mon, 14 Jul 2025 07:36:58 +0000 Subject: [PATCH] dt-bindings: interrupt-controller: aspeed: Refine AST2700 binding description and example In-Reply-To: References: <20250714071753.2653620-1-ryan_chen@aspeedtech.com> Message-ID: > Subject: Re: [PATCH] dt-bindings: interrupt-controller: aspeed: Refine AST2700 > binding description and example > > On 14/07/2025 09:17, Ryan Chen wrote: > > - Update block diagram for better readability and accuracy. > > - Clarify the relationship and function of INTC0, INTC1, and the GIC. > > - Documentation and example refine. > > > > This enhances the documentation quality and helps developers > > understand the interrupt controller hierarchy and usage. > > Changing ABI (compatibles) is not enhancing quality and is not explained here. > Sorry, I would add following in description. - add 'aspeed,ast2700-intc0' and 'aspeed,ast2700-intc1' compatible strings for parent interrupt controller nodes, in addition to the existing 'aspeed,ast2700-intc-ic' for child nodes. > > > > Signed-off-by: Ryan Chen > > --- > > .../aspeed,ast2700-intc.yaml | 155 > +++++++++++++----- > > 1 file changed, 112 insertions(+), 43 deletions(-) > > > > diff --git > > a/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast270 > > 0-intc.yaml > > b/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast270 > > 0-intc.yaml index 55636d06a674..751a07d49c90 100644 > > --- > > a/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast270 > > 0-intc.yaml > > +++ b/Documentation/devicetree/bindings/interrupt-controller/aspeed,as > > +++ t2700-intc.yaml > > @@ -10,6 +10,33 @@ description: > > This interrupt controller hardware is second level interrupt controller > that > > is hooked to a parent interrupt controller. It's useful to combine multiple > > interrupt sources into 1 interrupt to parent interrupt controller. > > + Depend to which INTC0 or INTC1 used. > > + INTC0 and INTC1 are two kinds of interrupt controller with enable > > + and raw status registers for use. > > + INTC0 is used to assert GIC if interrupt in INTC1 asserted. > > + INTC1 is used to assert INTC0 if interrupt of modules asserted. > > + +-----+ +---------+ > > + | GIC |---| INTC0 | > > + +-----+ +---------+ > > + +---------+ > > + | |---module0 > > + | INTC0_0 |---module1 > > + | |---... > > + +---------+---module31 > > + |---.... | > > + +---------+ > > + | | +---------+ > > + | INTC0_11| +---| INTC1 | > > + | | +---------+ > > + +---------+ +---------+---module0 > > + | INTC1_0 |---module1 > > + | |---... > > + +---------+---module31 > > + ... > > + +---------+---module0 > > + | INTC1_5 |---module1 > > + | |---... > > + +---------+---module31 > > > > maintainers: > > - Kevin Chen @@ -17,49 +44,67 @@ > > maintainers: > > properties: > > compatible: > > enum: > > - - aspeed,ast2700-intc-ic > > + - aspeed,ast2700-intc0 > > + - aspeed,ast2700-intc1 > > No, you cannot change compatibles. > > You just rewrite entire bindings just because of wish to "refine"? > Hardware changed? What happened here? > Thank you for your feedback. There is no hardware change. My intention was to clarify the interrupt controller hierarchy by introducing separate compatible strings for the parent nodes. Sorry, I don't change original compatibles, I add parent compatibles aspeed,ast2700-intc0, aspeed,ast2700-intc1. Modify original to be child nodes, and still keep the same compatible aspeed,ast2700-intc-ic > You need to clearly describe ABI impact and reasons, like possible bugs you > address. You cannot just rewrite existing binding into something entirely else. > > Best regards, > Krzysztof From robh at kernel.org Mon Jul 14 18:17:29 2025 From: robh at kernel.org (Rob Herring (Arm)) Date: Mon, 14 Jul 2025 03:17:29 -0500 Subject: [PATCH] dt-bindings: interrupt-controller: aspeed: Refine AST2700 binding description and example In-Reply-To: <20250714071753.2653620-1-ryan_chen@aspeedtech.com> References: <20250714071753.2653620-1-ryan_chen@aspeedtech.com> Message-ID: <175248104913.1053585.2976024588034663905.robh@kernel.org> On Mon, 14 Jul 2025 15:17:53 +0800, Ryan Chen wrote: > - Update block diagram for better readability and accuracy. > - Clarify the relationship and function of INTC0, INTC1, and the GIC. > - Documentation and example refine. > > This enhances the documentation quality and helps developers understand > the interrupt controller hierarchy and usage. > > Signed-off-by: Ryan Chen > --- > .../aspeed,ast2700-intc.yaml | 155 +++++++++++++----- > 1 file changed, 112 insertions(+), 43 deletions(-) > My bot found errors running 'make dt_binding_check' on your patch: yamllint warnings/errors: dtschema/dtc warnings/errors: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml: address-cells: missing type definition /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml: size-cells: missing type definition Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.example.dts:39.15-41: Warning (reg_format): /example-0/bus/interrupt-controller at 12100000/interrupt-controller at 1b00:reg: property has invalid length (12 bytes) (#address-cells == 2, #size-cells == 2) Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.example.dtb: Warning (pci_device_reg): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.example.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.example.dtb: Warning (simple_bus_reg): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.example.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format' Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.example.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format' /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.example.dtb: interrupt-controller at 12100000 (aspeed,ast2700-intc0): '#address-cells', '#size-cells' do not match any of the regexes: '^interrupt-controller@', '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/interrupt-controller/aspeed,ast2700-intc.yaml# /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.example.dtb: interrupt-controller at 12100000 (aspeed,ast2700-intc0): interrupt-controller at 1b00:reg:0: [0, 303045376, 16] is too short from schema $id: http://devicetree.org/schemas/reg.yaml# /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.example.dtb: interrupt-controller at 14c18000 (aspeed,ast2700-intc1): '#address-cells', '#size-cells' do not match any of the regexes: '^interrupt-controller@', '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/interrupt-controller/aspeed,ast2700-intc.yaml# /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.example.dtb: interrupt-controller at 14c18000 (aspeed,ast2700-intc1): interrupt-controller at 100: 'interrupts' is a required property from schema $id: http://devicetree.org/schemas/interrupt-controller/aspeed,ast2700-intc.yaml# doc reference errors (make refcheckdocs): See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20250714071753.2653620-1-ryan_chen at aspeedtech.com The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema. From krzk at kernel.org Mon Jul 14 18:23:21 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Mon, 14 Jul 2025 10:23:21 +0200 Subject: [PATCH] dt-bindings: interrupt-controller: aspeed: Refine AST2700 binding description and example In-Reply-To: References: <20250714071753.2653620-1-ryan_chen@aspeedtech.com> Message-ID: <57c0d48d-1484-45df-a99d-11388b6efdb1@kernel.org> On 14/07/2025 09:36, Ryan Chen wrote: >> Subject: Re: [PATCH] dt-bindings: interrupt-controller: aspeed: Refine AST2700 >> binding description and example >> >> On 14/07/2025 09:17, Ryan Chen wrote: >>> - Update block diagram for better readability and accuracy. >>> - Clarify the relationship and function of INTC0, INTC1, and the GIC. >>> - Documentation and example refine. >>> >>> This enhances the documentation quality and helps developers >>> understand the interrupt controller hierarchy and usage. >> >> Changing ABI (compatibles) is not enhancing quality and is not explained here. >> > Sorry, I would add following in description. > - add 'aspeed,ast2700-intc0' and 'aspeed,ast2700-intc1' compatible strings > for parent interrupt controller nodes, in addition to the existing > 'aspeed,ast2700-intc-ic' for child nodes. > It does not say why is this needed in the first place... Best regards, Krzysztof From krzk at kernel.org Mon Jul 14 18:24:16 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Mon, 14 Jul 2025 10:24:16 +0200 Subject: [PATCH] dt-bindings: interrupt-controller: aspeed: Refine AST2700 binding description and example In-Reply-To: <57c0d48d-1484-45df-a99d-11388b6efdb1@kernel.org> References: <20250714071753.2653620-1-ryan_chen@aspeedtech.com> <57c0d48d-1484-45df-a99d-11388b6efdb1@kernel.org> Message-ID: <6685da47-748a-4d90-ba1f-d7bcf82e8677@kernel.org> On 14/07/2025 10:23, Krzysztof Kozlowski wrote: > On 14/07/2025 09:36, Ryan Chen wrote: >>> Subject: Re: [PATCH] dt-bindings: interrupt-controller: aspeed: Refine AST2700 >>> binding description and example >>> >>> On 14/07/2025 09:17, Ryan Chen wrote: >>>> - Update block diagram for better readability and accuracy. >>>> - Clarify the relationship and function of INTC0, INTC1, and the GIC. >>>> - Documentation and example refine. >>>> >>>> This enhances the documentation quality and helps developers >>>> understand the interrupt controller hierarchy and usage. >>> >>> Changing ABI (compatibles) is not enhancing quality and is not explained here. >>> >> Sorry, I would add following in description. >> - add 'aspeed,ast2700-intc0' and 'aspeed,ast2700-intc1' compatible strings >> for parent interrupt controller nodes, in addition to the existing >> 'aspeed,ast2700-intc-ic' for child nodes. >> > > It does not say why is this needed in the first place... > And also never tested :/. I won't be reviewing it. Best regards, Krzysztof From ryan_chen at aspeedtech.com Mon Jul 14 19:42:49 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Mon, 14 Jul 2025 09:42:49 +0000 Subject: [PATCH] dt-bindings: interrupt-controller: aspeed: Refine AST2700 binding description and example In-Reply-To: <6685da47-748a-4d90-ba1f-d7bcf82e8677@kernel.org> References: <20250714071753.2653620-1-ryan_chen@aspeedtech.com> <57c0d48d-1484-45df-a99d-11388b6efdb1@kernel.org> <6685da47-748a-4d90-ba1f-d7bcf82e8677@kernel.org> Message-ID: > Subject: Re: [PATCH] dt-bindings: interrupt-controller: aspeed: Refine AST2700 > binding description and example > > On 14/07/2025 10:23, Krzysztof Kozlowski wrote: > > On 14/07/2025 09:36, Ryan Chen wrote: > >>> Subject: Re: [PATCH] dt-bindings: interrupt-controller: aspeed: > >>> Refine AST2700 binding description and example > >>> > >>> On 14/07/2025 09:17, Ryan Chen wrote: > >>>> - Update block diagram for better readability and accuracy. > >>>> - Clarify the relationship and function of INTC0, INTC1, and the GIC. > >>>> - Documentation and example refine. > >>>> > >>>> This enhances the documentation quality and helps developers > >>>> understand the interrupt controller hierarchy and usage. > >>> > >>> Changing ABI (compatibles) is not enhancing quality and is not explained > here. > >>> > >> Sorry, I would add following in description. > >> - add 'aspeed,ast2700-intc0' and 'aspeed,ast2700-intc1' compatible > >> strings for parent interrupt controller nodes, in addition to the > >> existing 'aspeed,ast2700-intc-ic' for child nodes. > >> > > > > It does not say why is this needed in the first place... > > > And also never tested :/. I won't be reviewing it. Thanks, will update example and test it, and send v2 > > > Best regards, > Krzysztof From andi.shyti at kernel.org Tue Jul 15 07:30:33 2025 From: andi.shyti at kernel.org (Andi Shyti) Date: Mon, 14 Jul 2025 23:30:33 +0200 Subject: [PATCH] i2c: aspeed: change debug level in irq handler In-Reply-To: <20250618102148.3085214-1-zhangjian.3032@bytedance.com> References: <20250618102148.3085214-1-zhangjian.3032@bytedance.com> Message-ID: Hi Jian, On Wed, Jun 18, 2025 at 06:21:48PM +0800, Jian Zhang wrote: > In interrupt context, using dev_err() can potentially cause latency > or affect system responsiveness due to printing to console. > > In our scenario, under certain conditions, i2c1 repeatedly printed > "irq handled != irq. expected ..." around 20 times within 1 second. > Each dev_err() log introduced approximately 10ms of blocking time, > which delayed the handling of other interrupts ? for example, i2c2. > > At the time, i2c2 was performing a PMBus firmware upgrade. The > target device on i2c2 was time-sensitive, and the upgrade protocol > was non-retryable. As a result, the delay caused by frequent error > logging led to a timeout and ultimately a failed firmware upgrade. > > Frequent error printing in interrupt context can be dangerous, > as it introduces latency and interferes with time-critical tasks. > This patch changes the log level from dev_err() to dev_dbg() to > reduce potential impact. this change doesn't fix any issue. This might improve it in your system because maybe your printing level does not include debug messages. But if you increase the printing level you would immediately fall into this same issue. ... > @@ -665,7 +665,7 @@ static irqreturn_t aspeed_i2c_bus_irq(int irq, void *dev_id) > > irq_remaining &= ~irq_handled; > if (irq_remaining) > - dev_err(bus->dev, > + dev_dbg(bus->dev, > "irq handled != irq. expected 0x%08x, but was 0x%08x\n", > irq_received, irq_handled); I agree that this is excessive logging and in my opinion you can completely remove this line. But what other error are you hitting? Andi > > -- > 2.47.0 > From ryan_chen at aspeedtech.com Tue Jul 15 12:42:58 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Tue, 15 Jul 2025 10:42:58 +0800 Subject: [PATCH v2] dt-bindings: interrupt-controller: aspeed: Add parent node compatibles and refine documentation Message-ID: <20250715024258.2304665-1-ryan_chen@aspeedtech.com> - Add 'aspeed,ast2700-intc0' and 'aspeed,ast2700-intc1' compatible strings for parent interrupt controller nodes, in addition to the existing 'aspeed,ast2700-intc-ic' for child nodes. - Clarify the relationship and function of INTC0, INTC1, and the GIC. - Update and clarify documentation, block diagram, and examples to reflect the hierarchy and compatible usage. - Documentation and example refine. This change allows the device tree and driver to distinguish between parent (top-level) and child (group) interrupt controller nodes, enabling more precise driver matching SOC register space allocation. Signed-off-by: Ryan Chen --- v2: make dt_binding_check check address-cells,size-cells -> #address-cells,#size-cells. add oneOf required, parent us interrupts, child use interrupts-extended. fix intc0_11 size-cells. --- .../aspeed,ast2700-intc.yaml | 158 +++++++++++++----- 1 file changed, 115 insertions(+), 43 deletions(-) diff --git a/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml index 55636d06a674..bdc4d8835843 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml +++ b/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml @@ -10,6 +10,33 @@ description: This interrupt controller hardware is second level interrupt controller that is hooked to a parent interrupt controller. It's useful to combine multiple interrupt sources into 1 interrupt to parent interrupt controller. + Depend to which INTC0 or INTC1 used. + INTC0 and INTC1 are two kinds of interrupt controller with enable and raw + status registers for use. + INTC0 is used to assert GIC if interrupt in INTC1 asserted. + INTC1 is used to assert INTC0 if interrupt of modules asserted. + +-----+ +---------+ + | GIC |---| INTC0 | + +-----+ +---------+ + +---------+ + | |---module0 + | INTC0_0 |---module1 + | |---... + +---------+---module31 + |---.... | + +---------+ + | | +---------+ + | INTC0_11| +---| INTC1 | + | | +---------+ + +---------+ +---------+---module0 + | INTC1_0 |---module1 + | |---... + +---------+---module31 + ... + +---------+---module0 + | INTC1_5 |---module1 + | |---... + +---------+---module31 maintainers: - Kevin Chen @@ -17,49 +44,70 @@ maintainers: properties: compatible: enum: - - aspeed,ast2700-intc-ic + - aspeed,ast2700-intc0 + - aspeed,ast2700-intc1 reg: maxItems: 1 - interrupt-controller: true + '#address-cells': + const: 2 - '#interrupt-cells': + '#size-cells': const: 2 - description: - The first cell is the IRQ number, the second cell is the trigger - type as defined in interrupt.txt in this directory. - - interrupts: - maxItems: 6 - description: | - Depend to which INTC0 or INTC1 used. - INTC0 and INTC1 are two kinds of interrupt controller with enable and raw - status registers for use. - INTC0 is used to assert GIC if interrupt in INTC1 asserted. - INTC1 is used to assert INTC0 if interrupt of modules asserted. - +-----+ +-------+ +---------+---module0 - | GIC |---| INTC0 |--+--| INTC1_0 |---module2 - | | | | | | |---... - +-----+ +-------+ | +---------+---module31 - | - | +---------+---module0 - +---| INTC1_1 |---module2 - | | |---... - | +---------+---module31 - ... - | +---------+---module0 - +---| INTC1_5 |---module2 - | |---... - +---------+---module31 + ranges: true + +patternProperties: + "^interrupt-controller@": + type: object + description: Interrupt group child nodes + additionalProperties: false + + properties: + compatible: + enum: + - aspeed,ast2700-intc-ic + + reg: + maxItems: 1 + + interrupt-controller: true + + '#interrupt-cells': + const: 2 + description: | + The first cell is the IRQ number, the second cell is the trigger + type as defined in interrupt.txt in this directory. + + interrupts: + minItems: 1 + maxItems: 6 + description: | + The interrupts provided by this interrupt controller. + + interrupts-extended: + minItems: 1 + maxItems: 6 + description: | + This property is required when defining a cascaded interrupt controller + that is connected under another interrupt controller. It specifies the + parent interrupt(s) in the upstream controller to which this controller + is connected. + + oneOf: + - required: [interrupts] + - required: [interrupts-extended] + + required: + - compatible + - reg + - interrupt-controller + - '#interrupt-cells' required: - compatible - reg - - interrupt-controller - - '#interrupt-cells' - - interrupts additionalProperties: false @@ -68,19 +116,43 @@ examples: #include bus { + #address-cells = <2>; + #size-cells = <2>; + + intc0: interrupt-controller at 12100000 { + compatible = "aspeed,ast2700-intc0"; + reg = <0 0x12100000 0 0x4000>; + ranges = <0x0 0x0 0x0 0x12100000 0x0 0x4000>; + #address-cells = <2>; + #size-cells = <2>; + + intc0_11: interrupt-controller at 1b00 { + compatible = "aspeed,ast2700-intc-ic"; + reg = <0 0x12101b00 0 0x10>; + #interrupt-cells = <2>; + interrupt-controller; + interrupts = , + , + , + , + , + ; + }; + }; + + intc1: interrupt-controller at 14c18000 { + compatible = "aspeed,ast2700-intc1"; + reg = <0 0x14c18000 0 0x400>; + ranges = <0x0 0x0 0x0 0x14c18000 0x0 0x400>; #address-cells = <2>; #size-cells = <2>; - interrupt-controller at 12101b00 { - compatible = "aspeed,ast2700-intc-ic"; - reg = <0 0x12101b00 0 0x10>; - #interrupt-cells = <2>; - interrupt-controller; - interrupts = , - , - , - , - , - ; + intc1_0: interrupt-controller at 100 { + compatible = "aspeed,ast2700-intc-ic"; + reg = <0x0 0x100 0x0 0x10>; + #interrupt-cells = <2>; + interrupt-controller; + interrupts-extended = <&intc0_11 0 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; }; + }; }; -- 2.34.1 From p.zabel at pengutronix.de Tue Jul 15 23:51:48 2025 From: p.zabel at pengutronix.de (Philipp Zabel) Date: Tue, 15 Jul 2025 15:51:48 +0200 Subject: [PATCH v2 09/10] PCI: aspeed: Add ASPEED PCIe RC driver In-Reply-To: <20250715034320.2553837-10-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> <20250715034320.2553837-10-jacky_chou@aspeedtech.com> Message-ID: On Di, 2025-07-15 at 11:43 +0800, Jacky Chou wrote: > Introduce PCIe Root Complex driver for ASPEED SoCs. Support RC > initialization, reset, clock, IRQ domain, and MSI domain setup. > Implement platform-specific setup and register configuration for > ASPEED. And provide PCI config space read/write and INTx/MSI > interrupt handling. > > Signed-off-by: Jacky Chou > --- > drivers/pci/controller/Kconfig | 13 + > drivers/pci/controller/Makefile | 1 + > drivers/pci/controller/pcie-aspeed.c | 1137 ++++++++++++++++++++++++++ > 3 files changed, 1151 insertions(+) > create mode 100644 drivers/pci/controller/pcie-aspeed.c > [...] > diff --git a/drivers/pci/controller/pcie-aspeed.c b/drivers/pci/controller/pcie-aspeed.c > new file mode 100644 > index 000000000000..a7e679d5fb42 > --- /dev/null > +++ b/drivers/pci/controller/pcie-aspeed.c > @@ -0,0 +1,1137 @@ [...] > +static int aspeed_pcie_parse_port(struct aspeed_pcie *pcie, > + struct device_node *node, > + int slot) > +{ > + struct aspeed_pcie_port *port; > + struct device *dev = pcie->dev; > + > + port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL); > + if (!port) > + return -ENOMEM; > + > + port->pciephy = syscon_regmap_lookup_by_phandle(node, "aspeed,pciephy"); > + if (IS_ERR(port->pciephy)) > + return dev_err_probe(dev, PTR_ERR(port->pciephy), > + "Failed to map pcie%d pciephy base\n", slot); > + > + port->clk = devm_get_clk_from_child(dev, node, NULL); > + if (IS_ERR(port->clk)) > + return dev_err_probe(dev, PTR_ERR(port->clk), > + "Failed to get pcie%d clock\n", slot); > + > + port->perst = of_reset_control_get_exclusive(node, "perst"); > + if (IS_ERR(port->perst)) > + return dev_err_probe(dev, PTR_ERR(port->perst), > + "Failed to get pcie%d reset control\n", slot); How about registering a reset_control_put() via devm_add_action_or_reset()? Otherwise these reset controls are not released on .remove. [...] > +static int aspeed_pcie_probe(struct platform_device *pdev) > +{ > + struct device *dev = &pdev->dev; > + struct pci_host_bridge *host; > + struct aspeed_pcie *pcie; > + struct aspeed_pcie_port *port; > + struct device_node *node = dev->of_node; > + const struct aspeed_pcie_rc_platform *md = of_device_get_match_data(dev); > + int irq, ret; > + > + if (!md) > + return -ENODEV; > + > + host = devm_pci_alloc_host_bridge(dev, sizeof(*pcie)); > + if (!host) > + return -ENOMEM; > + > + pcie = pci_host_bridge_priv(host); > + pcie->dev = dev; > + pcie->tx_tag = 0; > + platform_set_drvdata(pdev, pcie); > + > + pcie->platform = md; > + pcie->host = host; > + INIT_LIST_HEAD(&pcie->ports); > + > + pcie->reg = devm_platform_ioremap_resource(pdev, 0); > + if (IS_ERR(pcie->reg)) > + return PTR_ERR(pcie->reg); > + > + of_property_read_u32(node, "linux,pci-domain", &pcie->domain); > + > + pcie->cfg = syscon_regmap_lookup_by_phandle(dev->of_node, "aspeed,pciecfg"); > + if (IS_ERR(pcie->cfg)) > + return dev_err_probe(dev, PTR_ERR(pcie->cfg), "Failed to map pciecfg base\n"); > + > + pcie->h2xrst = devm_reset_control_get_exclusive(dev, "h2x"); > + if (IS_ERR(pcie->h2xrst)) > + return dev_err_probe(dev, PTR_ERR(pcie->h2xrst), "Failed to get h2x reset\n"); > + > + ret = devm_mutex_init(dev, &pcie->lock); > + if (ret) > + return dev_err_probe(dev, ret, "Failed to init mutex\n"); > + > + ret = pcie->platform->setup(pdev); > + if (ret) > + return dev_err_probe(dev, ret, "Failed to setup PCIe RC\n"); > + > + ret = aspeed_pcie_parse_dt(pcie); > + if (ret) > + return ret; > + > + ret = aspeed_pcie_init_ports(pcie); > + if (ret) > + goto err_remove_resets; > + > + host->sysdata = pcie; > + > + ret = aspeed_pcie_init_irq_domain(pcie); > + if (ret) > + goto err_irq_init; > + > + irq = platform_get_irq(pdev, 0); > + if (irq < 0) { > + ret = irq; > + goto err_irq; > + } > + > + ret = devm_request_irq(dev, irq, aspeed_pcie_intr_handler, IRQF_SHARED, dev_name(dev), > + pcie); > + if (ret) > + goto err_irq; > + > + ret = pci_host_probe(host); > + if (ret) > + goto err_irq; > + > + return 0; > +err_irq: > + aspeed_pcie_irq_domain_free(pcie); If pci_host_probe() fails, aspeed_pcie_irq_domain_free() will be called before the IRQ requested with devm_request_irq() above is released. Also, this is never called on .remove. You can fix both with devm_add_action_or_reset(). > +err_irq_init: > +err_remove_resets: > + list_for_each_entry(port, &pcie->ports, list) > + reset_control_put(port->perst); I suggest to let devres handle this (see above). regards Philipp From robh at kernel.org Wed Jul 16 01:25:00 2025 From: robh at kernel.org (Rob Herring) Date: Tue, 15 Jul 2025 10:25:00 -0500 Subject: [PATCH v2 06/10] ARM: dts: aspeed-g6: Add PCIe RC node In-Reply-To: <20250715034320.2553837-7-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> <20250715034320.2553837-7-jacky_chou@aspeedtech.com> Message-ID: On Mon, Jul 14, 2025 at 10:43?PM Jacky Chou wrote: > > The AST2600 has one PCIe RC, and add the relative configure regmap. > > Signed-off-by: Jacky Chou > --- > arch/arm/boot/dts/aspeed/aspeed-g6.dtsi | 61 +++++++++++++++++++++++++ > 1 file changed, 61 insertions(+) > > diff --git a/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi b/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi > index 8ed715bd53aa..ed99780b6860 100644 > --- a/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi > +++ b/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi > @@ -379,6 +379,67 @@ rng: hwrng at 1e6e2524 { > quality = <100>; > }; > > + pcie_phy1: syscon at 1e6ed200 { > + compatible = "aspeed,pcie-phy", "syscon"; > + reg = <0x1e6ed200 0x100>; This looks like part of something else? It should be a child of that. If this is the controls for the PCIe PHY, then use the PHY binding instead of your own custom phandle property. > + }; > + > + pcie_cfg: syscon at 1e770000 { > + compatible = "aspeed,pcie-cfg", "syscon"; > + reg = <0x1e770000 0x80>; Looks like this is really part of the PCIe block as a h/w block isn't going to start at offset 0xc0. > + }; > + > + pcie0: pcie at 1e7700c0 { > + compatible = "aspeed,ast2600-pcie"; > + device_type = "pci"; > + reg = <0x1e7700c0 0x40>; > + linux,pci-domain = <0>; No need for this. You only have 1 PCI host. > + #address-cells = <3>; > + #size-cells = <2>; > + interrupts = ; > + bus-range = <0x80 0xff>; Does this h/w not support bus 0-0x7f for some reason? > + > + ranges = <0x01000000 0x0 0x00018000 0x00018000 0x0 0x00008000 > + 0x02000000 0x0 0x70000000 0x70000000 0x0 0x10000000>; > + > + status = "disabled"; > + > + resets = <&syscon ASPEED_RESET_H2X>; > + reset-names = "h2x"; > + > + #interrupt-cells = <1>; > + msi-parent = <&pcie0>; > + msi-controller; > + > + aspeed,ahbc = <&ahbc>; > + aspeed,pciecfg = <&pcie_cfg>; > + > + interrupt-map-mask = <0 0 0 7>; > + interrupt-map = <0 0 0 1 &pcie_intc0 0>, > + <0 0 0 2 &pcie_intc0 1>, > + <0 0 0 3 &pcie_intc0 2>, > + <0 0 0 4 &pcie_intc0 3>; > + pcie_intc0: interrupt-controller { > + interrupt-controller; > + #address-cells = <0>; > + #interrupt-cells = <1>; > + }; > + > + pcie at 8,0 { > + reg = <0x804000 0 0 0 0>; > + #address-cells = <3>; > + #size-cells = <2>; > + device_type = "pci"; > + resets = <&syscon ASPEED_RESET_PCIE_RC_O>; > + reset-names = "perst"; > + clocks = <&syscon ASPEED_CLK_GATE_BCLK>; > + pinctrl-names = "default"; > + pinctrl-0 = <&pinctrl_pcierc1_default>; > + aspeed,pciephy = <&pcie_phy1>; > + ranges; > + }; > + }; > + > gfx: display at 1e6e6000 { > compatible = "aspeed,ast2600-gfx", "syscon"; > reg = <0x1e6e6000 0x1000>; > -- > 2.43.0 > From helgaas at kernel.org Wed Jul 16 01:41:45 2025 From: helgaas at kernel.org (Bjorn Helgaas) Date: Tue, 15 Jul 2025 10:41:45 -0500 Subject: [PATCH v2 08/10] PCI: Add FMT and TYPE definition for TLP header In-Reply-To: <20250715034320.2553837-9-jacky_chou@aspeedtech.com> Message-ID: <20250715154145.GA2461632@bhelgaas> On Tue, Jul 15, 2025 at 11:43:18AM +0800, Jacky Chou wrote: > According to PCIe specification, add FMT and TYPE definition > for TLP header. And also add macro to combine FMT and TYPE to > 1 byte. > > Signed-off-by: Jacky Chou > --- > include/uapi/linux/pci_regs.h | 32 ++++++++++++++++++++++++++++++++ > 1 file changed, 32 insertions(+) I don't think these definitions are relevant to uapi users, so they could go in drivers/pci/pci.h, similar to the existing PCIE_MSG_* definitions. Please follow the style of PCIE_MSG_*, including the brief spec citations and /* */ comments. Not sure we need *all* of these; it looks like you only use: PCI_TLP_TYPE_CFG0_RD PCI_TLP_TYPE_CFG0_WR PCI_TLP_TYPE_CFG1_RD PCI_TLP_TYPE_CFG1_WR PCI_TLP_FMT_3DW_NO_DATA PCI_TLP_FMT_3DW_DATA > diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h > index a3a3e942dedf..700b915e00f5 100644 > --- a/include/uapi/linux/pci_regs.h > +++ b/include/uapi/linux/pci_regs.h > @@ -1230,4 +1230,36 @@ > #define PCI_DVSEC_CXL_PORT_CTL 0x0c > #define PCI_DVSEC_CXL_PORT_CTL_UNMASK_SBR 0x00000001 > > +/* Fmt[2:0] encoding for TLP Header */ > +#define PCI_TLP_FMT_3DW_NO_DATA 0x0 // 3DW header, no data > +#define PCI_TLP_FMT_4DW_NO_DATA 0x1 // 4DW header, no data > +#define PCI_TLP_FMT_3DW_DATA 0x2 // 3DW header, with data > +#define PCI_TLP_FMT_4DW_DATA 0x3 // 4DW header, with data > +#define PCI_TLP_FMT_PREFIX 0x4 // Prefix header > + > +/* Type[4:0] encoding for TLP Header */ > +#define PCI_TLP_TYPE_MEM_RD 0x00 // Memory Read Request > +#define PCI_TLP_TYPE_MEM_RDLK 0x01 // Memory Read Lock Request > +#define PCI_TLP_TYPE_MEM_WR 0x00 // Memory Write Request (Fmt must be with data) > +#define PCI_TLP_TYPE_IO_RD 0x02 // IO Read Request > +#define PCI_TLP_TYPE_IO_WR 0x02 // IO Write Request (Fmt must be with data) > +#define PCI_TLP_TYPE_CFG0_RD 0x04 // Config Type 0 Read Request > +#define PCI_TLP_TYPE_CFG0_WR 0x04 // Config Type 0 Write Request (Fmt must be with data) > +#define PCI_TLP_TYPE_CFG1_RD 0x05 // Config Type 1 Read Request > +#define PCI_TLP_TYPE_CFG1_WR 0x05 // Config Type 1 Write Request (Fmt must be with data) > +#define PCI_TLP_TYPE_MSG 0x10 // Message Request (see routing field) > +#define PCI_TLP_TYPE_MSGD 0x11 // Message Request with Data (see routing field) > +#define PCI_TLP_TYPE_CPL 0x0A // Completion without Data > +#define PCI_TLP_TYPE_CPLD 0x0A // Completion with Data (Fmt must be with data) > +#define PCI_TLP_TYPE_CPLLCK 0x0B // Completion Locked > +#define PCI_TLP_TYPE_CPLDLCK 0x0B // Completion with Data Locked (Fmt must be with data) > +#define PCI_TLP_TYPE_FETCH_ADD 0x0C // Fetch and Add AtomicOp Request > +#define PCI_TLP_TYPE_SWAP 0x0D // Unconditional Swap AtomicOp Request > +#define PCI_TLP_TYPE_CMP_SWAP 0x0E // Compare and Swap AtomicOp Request > +#define PCI_TLP_TYPE_LOCAL_PREFIX 0x00 // Local TLP Prefix (Fmt = 0x4) > +#define PCI_TLP_TYPE_E2E_PREFIX 0x10 // End-to-End TLP Prefix (Fmt = 0x4) > + > +/* Macro to combine Fmt and Type into the 8-bit field */ > +#define PCIE_TLP_FMT_TYPE(fmt, type) (((fmt) << 5) | ((type) & 0x1F)) This looks like it might be controller-specific and could go in pcie-aspeed.c. From helgaas at kernel.org Wed Jul 16 02:22:02 2025 From: helgaas at kernel.org (Bjorn Helgaas) Date: Tue, 15 Jul 2025 11:22:02 -0500 Subject: [PATCH v2 09/10] PCI: aspeed: Add ASPEED PCIe RC driver In-Reply-To: <20250715034320.2553837-10-jacky_chou@aspeedtech.com> Message-ID: <20250715162202.GA2461591@bhelgaas> v1 posting was https://lore.kernel.org/r/20250613033001.3153637-1-jacky_chou at aspeedtech.com Links to previous postings are helpful in the cover letter. On Tue, Jul 15, 2025 at 11:43:19AM +0800, Jacky Chou wrote: > Introduce PCIe Root Complex driver for ASPEED SoCs. Support RC > initialization, reset, clock, IRQ domain, and MSI domain setup. > Implement platform-specific setup and register configuration for > ASPEED. And provide PCI config space read/write and INTx/MSI > interrupt handling. > +config PCIE_ASPEED > + bool "ASPEED PCIe controller" > + depends on ARCH_ASPEED || COMPILE_TEST > + depends on OF > + select PCI_MSI_ARCH_FALLBACKS > + help > + Enable this option to add support for the PCIe controller > + found on ASPEED SoCs. > + This driver provides initialization and management for PCIe > + Root Complex functionality, including interrupt and MSI support. > + Select Y if your platform uses an ASPEED SoC and requires PCIe > + connectivity. Add blank line between paragraphs or reflow into single paragraph (mentioned before). Alphabetize this entry by the menu item ("ASPEED PCIe controller", "ARM Versatile PB PCI controller"). > config PCI_VERSATILE > bool "ARM Versatile PB PCI controller" > depends on ARCH_VERSATILE || COMPILE_TEST > +#define MAX_MSI_HOST_IRQS 64 > +#define PCIE_RESET_CONFIG_DEVICE_WAIT_MS 500 Where does this value come from? Is there a generic value from drivers/pci/pci.h you can use? > +#define PCIE_RESET_CONFIG_RC_WAIT_MS 10 Ditto. If it's an Aspeed-specific value, can you point to the source in the Aspeed datasheet? > +#define CRG0_READ_FMTTYPE \ > + FIELD_PREP(GENMASK(31, 24), PCIE_TLP_FMT_TYPE(PCI_TLP_FMT_3DW_NO_DATA, \ > + PCI_TLP_TYPE_CFG0_RD)) > +#define CRG0_WRITE_FMTTYPE \ > + FIELD_PREP(GENMASK(31, 24), PCIE_TLP_FMT_TYPE(PCI_TLP_FMT_3DW_DATA, \ > + PCI_TLP_TYPE_CFG0_WR)) > +#define CRG1_READ_FMTTYPE \ > + FIELD_PREP(GENMASK(31, 24), PCIE_TLP_FMT_TYPE(PCI_TLP_FMT_3DW_NO_DATA, \ > + PCI_TLP_TYPE_CFG1_RD)) > +#define CRG1_WRITE_FMTTYPE \ > + FIELD_PREP(GENMASK(31, 24), PCIE_TLP_FMT_TYPE(PCI_TLP_FMT_3DW_DATA, \ > + PCI_TLP_TYPE_CFG1_WR)) Looks like a #define for GENMASK(31, 24) might make sense? > + * struct aspeed_pcie_port - PCIe port information > + * @list: port list > + * @pcie: pointer to PCIe host info > + * @clk: pointer to the port clock gate > + * @phy: pointer to PHY control block > + * @perst: pointer to port reset control > + * @slot: port slot > + */ > +struct aspeed_pcie_port { > + struct list_head list; > + struct aspeed_pcie *pcie; > + struct clk *clk; > + struct regmap *pciephy; > + struct reset_control *perst; > + u32 slot; > +}; > + > +/** > + * struct aspeed_pcie - PCIe port information I think aspeed_pcie_port is for a Root Port; this looks like it might be for the Root Complex as a whole. > + * @host: pointer to pcie host bridge s/pcie/PCIe/ > + * @dev: pointer to device structure > + * @reg: PCIe Host register base address > + * @ahbc: pointer to AHHC register map > + * @cfg: pointer to Aspeed PCIe configuration register map > + * @platform: platform specific information > + * @ports: list of PCIe ports > + * @domain: PCI domain number > + * @tx_tag: current TX tag for the port > + * @h2xrst: pointer to H2X reset control > + * @irq_domain: IRQ domain for INTx interrupts > + * @dev_domain: IRQ domain for device interrupts > + * @msi_domain: IRQ domain for MSI interrupts > + * @lock: mutex to protect MSI bitmap variable > + * @msi_irq_in_use: bitmap to track used MSI host IRQs > + */ > +struct aspeed_pcie { > + struct pci_host_bridge *host; > + struct device *dev; > + void __iomem *reg; > + struct regmap *ahbc; > + struct regmap *cfg; > + const struct aspeed_pcie_rc_platform *platform; > + struct list_head ports; > + > + int domain; > + u8 tx_tag; > + > + struct reset_control *h2xrst; > + > + struct irq_domain *irq_domain; Name "intx_domain" to remove ambiguity. > + struct irq_domain *dev_domain; > + struct irq_domain *msi_domain; > + struct mutex lock; /* Protect MSI bitmap variable */ > + DECLARE_BITMAP(msi_irq_in_use, MAX_MSI_HOST_IRQS); > +}; > +static void aspeed_pcie_intx_irq_ack(struct irq_data *d) > +{ > + struct aspeed_pcie *pcie = irq_data_get_irq_chip_data(d); > + int intx_en = pcie->platform->reg_intx_en; > + u32 en; > + > + en = readl(pcie->reg + intx_en); > + en |= BIT(d->hwirq); > + writel(en, pcie->reg + intx_en); > +} > + > +static void aspeed_pcie_intx_irq_mask(struct irq_data *d) > +{ > + struct aspeed_pcie *pcie = irq_data_get_irq_chip_data(d); > + int intx_en = pcie->platform->reg_intx_en; > + u32 en; > + > + en = readl(pcie->reg + intx_en); > + en |= BIT(d->hwirq); > + writel(en, pcie->reg + intx_en); > +} > + > +static void aspeed_pcie_intx_irq_unmask(struct irq_data *d) > +{ > + struct aspeed_pcie *pcie = irq_data_get_irq_chip_data(d); > + int intx_en = pcie->platform->reg_intx_en; > + u32 en; > + > + en = readl(pcie->reg + intx_en); > + en |= BIT(d->hwirq); > + writel(en, pcie->reg + intx_en); > +} aspeed_pcie_intx_irq_ack(), aspeed_pcie_intx_irq_mask(), and aspeed_pcie_intx_irq_unmask() all look identical. Am I missing something? > +static struct irq_chip aspeed_intx_irq_chip = { > + .name = "IntX", "INTx" (mentioned before). > +static irqreturn_t aspeed_pcie_intr_handler(int irq, void *dev_id) > +{ > + struct aspeed_pcie *pcie = dev_id; > + const struct aspeed_pcie_rc_platform *platform = pcie->platform; > + unsigned long status; > + unsigned long intx; Looks like status and intx should both be u32? > + u32 bit; > + int i; > + > + intx = readl(pcie->reg + platform->reg_intx_sts) & PCIE_INTX_STS; Use FIELD_GET() to avoid assumption that PCIE_INTX_STS starts at bit 0. > + for_each_set_bit(bit, &intx, PCI_NUM_INTX) > + generic_handle_domain_irq(pcie->irq_domain, bit); > + > + if (IS_ENABLED(CONFIG_PCI_MSI)) { > + for (i = 0; i < 2; i++) { > + status = readl(pcie->reg + platform->reg_msi_sts + (i * 4)); > + writel(status, pcie->reg + platform->reg_msi_sts + (i * 4)); > + > + for_each_set_bit(bit, &status, 32) { > + bit += (i * 32); > + generic_handle_domain_irq(pcie->dev_domain, bit); > + } > + } > + } > + > + return IRQ_HANDLED; > +} > +static int aspeed_ast2600_rd_conf(struct pci_bus *bus, unsigned int devfn, > + int where, int size, u32 *val) > +{ > + int slot = PCI_SLOT(devfn); > + > + if (slot != 0 && slot != 8) > + return PCIBIOS_DEVICE_NOT_FOUND; I previously asked for a hint about why certain device addresses aren't valid. I meant a comment with a hint so the same question doesn't arise every time. > + return aspeed_ast2600_conf(bus, devfn, where, size, val, CRG0_READ_FMTTYPE, false); > +} > +static bool aspeed_ast2700_get_link(struct aspeed_pcie_port *port) > +{ > + u32 reg; > + > + /* AST2700 has Gen2 and Gen4 RCs. > + * Read register to distinguish between Gen2 or Gen4. > + * Then read the corresonding register that is from Aspeed > + * design to get whether it linked up or not. > + */ Comment style is: /* * Text ... */ Add blank line between paragraphs or reflow to a single paragraph. s/corresonding/corresponding/ "that is from Aspeed design" seems unnecessary. > +static int aspeed_ast2700_child_config(struct pci_bus *bus, unsigned int devfn, > + int where, int size, u32 *val, > + bool write) > +{ > + struct aspeed_pcie *pcie = bus->sysdata; > + u32 bdf_offset, status, cfg_val; > + int ret; > + > + bdf_offset = aspeed_pcie_get_bdf_offset(bus, devfn, where); > + > + cfg_val = CRG_PAYLOAD_SIZE; > + if (write) > + cfg_val |= (bus->number == 1) ? CRG0_WRITE_FMTTYPE : CRG1_WRITE_FMTTYPE; > + else > + cfg_val |= (bus->number == 1) ? CRG0_READ_FMTTYPE : CRG1_READ_FMTTYPE; I don't think you should assume that bus 0 is the root bus. The root bus number should come from the DT bus-range. > +static int aspeed_ast2700_rd_conf(struct pci_bus *bus, unsigned int devfn, > + int where, int size, u32 *val) > +{ > + if (devfn != 0) > + return PCIBIOS_DEVICE_NOT_FOUND; Another good place for a hint about why this restriction exists. > +static int aspeed_pcie_msi_init(struct aspeed_pcie *pcie) > +{ > + int ret = 0; > + > + writel(~0, pcie->reg + pcie->platform->reg_msi_en); > + writel(~0, pcie->reg + pcie->platform->reg_msi_en + 0x04); > + writel(~0, pcie->reg + pcie->platform->reg_msi_sts); > + writel(~0, pcie->reg + pcie->platform->reg_msi_sts + 0x04); > + > + pcie->dev_domain = > + irq_domain_add_linear(NULL, MAX_MSI_HOST_IRQS, &aspeed_msi_domain_ops, pcie); > + if (!pcie->dev_domain) > + return dev_err_probe(pcie->dev, -ENOMEM, "failed to create IRQ domain\n"); > + > + pcie->msi_domain = pci_msi_create_irq_domain(dev_fwnode(pcie->dev), &aspeed_msi_domain_info, > + pcie->dev_domain); > + if (!pcie->msi_domain) > + return dev_err_probe(pcie->dev, -ENOMEM, "failed to create MSI domain\n"); Can you please rework this to follow what Nam Cao is doing for existing drivers: https://lore.kernel.org/r/cover.1750858083.git.namcao at linutronix.de > +static int aspeed_ast2700_setup(struct platform_device *pdev) > +{ > + struct aspeed_pcie *pcie = platform_get_drvdata(pdev); > + int ret; > + > + regmap_update_bits(pcie->cfg, SCU_60, > + RC_E2M_PATH_EN | RC_H2XS_PATH_EN | RC_H2XD_PATH_EN | RC_H2XX_PATH_EN | > + RC_UPSTREAM_MEM_EN, > + RC_E2M_PATH_EN | RC_H2XS_PATH_EN | RC_H2XD_PATH_EN | RC_H2XX_PATH_EN | > + RC_UPSTREAM_MEM_EN); > + regmap_write(pcie->cfg, SCU_64, > + RC0_DECODE_DMA_BASE(0) | RC0_DECODE_DMA_LIMIT(0xFF) | RC1_DECODE_DMA_BASE(0) | > + RC1_DECODE_DMA_LIMIT(0xFF)); > + regmap_write(pcie->cfg, SCU_70, DISABLE_EP_FUNC); > + > + aspeed_host_reset(pcie); > + > + writel(0, pcie->reg + H2X_CTRL); > + writel(H2X_BRIDGE_EN | H2X_BRIDGE_DIRECT_EN, pcie->reg + H2X_CTRL); > + > + ret = aspeed_ast2700_bar_assign(pcie); > + if (ret) > + return dev_err_probe(pcie->dev, ret, "Failed to assign bar\n"); s/bar/BAR/ in the message since it's an acronym. > + /* Prepare for 64-bit BAR pref */ > + writel(REMAP_PREF_ADDR_63_32(0x3), pcie->reg + H2X_REMAP_PREF_ADDR); > + > + pcie->host->ops = &aspeed_ast2700_pcie_ops; > + pcie->host->child_ops = &aspeed_ast2700_pcie_child_ops; > + > + return 0; > +} > +static int aspeed_pcie_parse_port(struct aspeed_pcie *pcie, > + struct device_node *node, > + int slot) > +{ > + struct aspeed_pcie_port *port; > + struct device *dev = pcie->dev; > + > + port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL); > + if (!port) > + return -ENOMEM; > + > + port->pciephy = syscon_regmap_lookup_by_phandle(node, "aspeed,pciephy"); > + if (IS_ERR(port->pciephy)) > + return dev_err_probe(dev, PTR_ERR(port->pciephy), > + "Failed to map pcie%d pciephy base\n", slot); > + > + port->clk = devm_get_clk_from_child(dev, node, NULL); > + if (IS_ERR(port->clk)) > + return dev_err_probe(dev, PTR_ERR(port->clk), > + "Failed to get pcie%d clock\n", slot); > + > + port->perst = of_reset_control_get_exclusive(node, "perst"); > + if (IS_ERR(port->perst)) > + return dev_err_probe(dev, PTR_ERR(port->perst), > + "Failed to get pcie%d reset control\n", slot); Driver messages are inconsistently capitalized. > + reset_control_assert(port->perst); > + > + port->slot = slot; > + port->pcie = pcie; > + > + INIT_LIST_HEAD(&port->list); > + list_add_tail(&port->list, &pcie->ports); > + > + return 0; > +} > +static int aspeed_pcie_probe(struct platform_device *pdev) > +{ > + struct device *dev = &pdev->dev; > + struct pci_host_bridge *host; > + struct aspeed_pcie *pcie; > + struct aspeed_pcie_port *port; > + struct device_node *node = dev->of_node; > + const struct aspeed_pcie_rc_platform *md = of_device_get_match_data(dev); > + int irq, ret; > + > + if (!md) > + return -ENODEV; > + > + host = devm_pci_alloc_host_bridge(dev, sizeof(*pcie)); > + if (!host) > + return -ENOMEM; > + > + pcie = pci_host_bridge_priv(host); > + pcie->dev = dev; > + pcie->tx_tag = 0; > + platform_set_drvdata(pdev, pcie); > + > + pcie->platform = md; > + pcie->host = host; > + INIT_LIST_HEAD(&pcie->ports); > + > + pcie->reg = devm_platform_ioremap_resource(pdev, 0); > + if (IS_ERR(pcie->reg)) > + return PTR_ERR(pcie->reg); > + > + of_property_read_u32(node, "linux,pci-domain", &pcie->domain); Normally not needed in a controller driver. See of_get_pci_domain_nr() and related interfaces. > + pcie->cfg = syscon_regmap_lookup_by_phandle(dev->of_node, "aspeed,pciecfg"); > + if (IS_ERR(pcie->cfg)) > + return dev_err_probe(dev, PTR_ERR(pcie->cfg), "Failed to map pciecfg base\n"); > + > + pcie->h2xrst = devm_reset_control_get_exclusive(dev, "h2x"); > + if (IS_ERR(pcie->h2xrst)) > + return dev_err_probe(dev, PTR_ERR(pcie->h2xrst), "Failed to get h2x reset\n"); > + > + ret = devm_mutex_init(dev, &pcie->lock); > + if (ret) > + return dev_err_probe(dev, ret, "Failed to init mutex\n"); > + > + ret = pcie->platform->setup(pdev); > + if (ret) > + return dev_err_probe(dev, ret, "Failed to setup PCIe RC\n"); > + > + ret = aspeed_pcie_parse_dt(pcie); > + if (ret) > + return ret; > + > + ret = aspeed_pcie_init_ports(pcie); > + if (ret) > + goto err_remove_resets; > + > + host->sysdata = pcie; > + > + ret = aspeed_pcie_init_irq_domain(pcie); > + if (ret) > + goto err_irq_init; > + > + irq = platform_get_irq(pdev, 0); > + if (irq < 0) { > + ret = irq; > + goto err_irq; > + } > + > + ret = devm_request_irq(dev, irq, aspeed_pcie_intr_handler, IRQF_SHARED, dev_name(dev), > + pcie); Most of this file is formatted to fit in 80 columns; would be nice to make the few outliers also fit. > + if (ret) > + goto err_irq; > + > + ret = pci_host_probe(host); > + if (ret) > + goto err_irq; > + > + return 0; > +err_irq: > + aspeed_pcie_irq_domain_free(pcie); > +err_irq_init: > +err_remove_resets: > + list_for_each_entry(port, &pcie->ports, list) > + reset_control_put(port->perst); > + dev_err_probe(dev, ret, "Failed to initial RC\n"); > + return ret; > +} > + > +const struct aspeed_pcie_rc_platform pcie_rc_ast2600 = { > + .setup = aspeed_ast2600_setup, > + .get_link = aspeed_ast2600_get_link, > + .port_init = aspeed_ast2600_port_init, > + .reg_intx_en = 0x04, > + .reg_intx_sts = 0x08, > + .reg_msi_en = 0x20, > + .reg_msi_sts = 0x28, > + .msi_address = 0x1e77005c, Capitalize hex numbers consistently. It appears upper-case is the convention in this file. > +}; > + > +const struct aspeed_pcie_rc_platform pcie_rc_ast2700 = { > + .setup = aspeed_ast2700_setup, > + .get_link = aspeed_ast2700_get_link, > + .port_init = aspeed_ast2700_port_init, > + .reg_intx_en = 0x40, > + .reg_intx_sts = 0x48, > + .reg_msi_en = 0x50, > + .reg_msi_sts = 0x58, > + .msi_address = 0x000000F0, > +}; Bjorn From Markus.Elfring at web.de Wed Jul 16 03:00:27 2025 From: Markus.Elfring at web.de (Markus Elfring) Date: Tue, 15 Jul 2025 19:00:27 +0200 Subject: [PATCH v2 09/10] PCI: aspeed: Add ASPEED PCIe RC driver In-Reply-To: <20250715034320.2553837-10-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-10-jacky_chou@aspeedtech.com> Message-ID: <8fe0f561-ef44-4ec2-9b93-f73105bd67ed@web.de> ? > +++ b/drivers/pci/controller/pcie-aspeed.c > @@ -0,0 +1,1137 @@ ? > +static int aspeed_irq_msi_domain_alloc(struct irq_domain *domain, > + unsigned int virq, unsigned int nr_irqs, > + void *args) > +{ ? > + mutex_lock(&pcie->lock); > + > + bit = bitmap_find_free_region(pcie->msi_irq_in_use, MAX_MSI_HOST_IRQS, > + get_count_order(nr_irqs)); > + > + mutex_unlock(&pcie->lock); ? Under which circumstances would you become interested to apply a statement like ?guard(mutex)(&pcie->lock);?? https://elixir.bootlin.com/linux/v6.16-rc6/source/include/linux/mutex.h#L225 Regards, Markus From lkp at intel.com Wed Jul 16 06:13:31 2025 From: lkp at intel.com (kernel test robot) Date: Wed, 16 Jul 2025 04:13:31 +0800 Subject: [PATCH v2 08/10] PCI: Add FMT and TYPE definition for TLP header In-Reply-To: <20250715034320.2553837-9-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-9-jacky_chou@aspeedtech.com> Message-ID: <202507160314.e3odwyX7-lkp@intel.com> Hi Jacky, kernel test robot noticed the following build warnings: [auto build test WARNING on pci/next] [also build test WARNING on pci/for-linus robh/for-next linusw-pinctrl/devel linusw-pinctrl/for-next linus/master v6.16-rc6 next-20250715] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Jacky-Chou/dt-bindings-soc-aspeed-Add-ASPEED-PCIe-Config-support/20250715-114814 base: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git next patch link: https://lore.kernel.org/r/20250715034320.2553837-9-jacky_chou%40aspeedtech.com patch subject: [PATCH v2 08/10] PCI: Add FMT and TYPE definition for TLP header config: i386-buildonly-randconfig-004-20250715 (https://download.01.org/0day-ci/archive/20250716/202507160314.e3odwyX7-lkp at intel.com/config) compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250716/202507160314.e3odwyX7-lkp at intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202507160314.e3odwyX7-lkp at intel.com/ All warnings (new ones prefixed by >>): In file included from :1: In file included from ./usr/include/linux/pci.h:21: >> usr/include/linux/pci_regs.h:1234:39: warning: // comments are not allowed in this language [-Wcomment] 1234 | #define PCI_TLP_FMT_3DW_NO_DATA 0x0 // 3DW header, no data | ^ 1 warning generated. -- In file included from :1: >> ./usr/include/linux/pci_regs.h:1234:39: warning: // comments are not allowed in this language [-Wcomment] 1234 | #define PCI_TLP_FMT_3DW_NO_DATA 0x0 // 3DW header, no data | ^ 1 warning generated. -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki From lkp at intel.com Wed Jul 16 08:28:22 2025 From: lkp at intel.com (kernel test robot) Date: Wed, 16 Jul 2025 06:28:22 +0800 Subject: [PATCH v2 09/10] PCI: aspeed: Add ASPEED PCIe RC driver In-Reply-To: <20250715034320.2553837-10-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-10-jacky_chou@aspeedtech.com> Message-ID: <202507160642.yzIrPY1i-lkp@intel.com> Hi Jacky, kernel test robot noticed the following build warnings: [auto build test WARNING on pci/next] [also build test WARNING on pci/for-linus robh/for-next linusw-pinctrl/devel linusw-pinctrl/for-next linus/master v6.16-rc6 next-20250715] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Jacky-Chou/dt-bindings-soc-aspeed-Add-ASPEED-PCIe-Config-support/20250715-114814 base: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git next patch link: https://lore.kernel.org/r/20250715034320.2553837-10-jacky_chou%40aspeedtech.com patch subject: [PATCH v2 09/10] PCI: aspeed: Add ASPEED PCIe RC driver config: loongarch-allyesconfig (https://download.01.org/0day-ci/archive/20250716/202507160642.yzIrPY1i-lkp at intel.com/config) compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 16534d19bf50bde879a83f0ae62875e2c5120e64) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250716/202507160642.yzIrPY1i-lkp at intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Closes: https://lore.kernel.org/oe-kbuild-all/202507160642.yzIrPY1i-lkp at intel.com/ All warnings (new ones prefixed by >>): >> Warning: drivers/pci/controller/pcie-aspeed.c:179 struct member 'pciephy' not described in 'aspeed_pcie_port' Warning: drivers/pci/controller/pcie-aspeed.c:179 Excess struct member 'phy' description in 'aspeed_pcie_port' -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki From jacky_chou at aspeedtech.com Tue Jul 15 13:43:18 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Tue, 15 Jul 2025 11:43:18 +0800 Subject: [PATCH v2 08/10] PCI: Add FMT and TYPE definition for TLP header In-Reply-To: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> Message-ID: <20250715034320.2553837-9-jacky_chou@aspeedtech.com> According to PCIe specification, add FMT and TYPE definition for TLP header. And also add macro to combine FMT and TYPE to 1 byte. Signed-off-by: Jacky Chou --- include/uapi/linux/pci_regs.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h index a3a3e942dedf..700b915e00f5 100644 --- a/include/uapi/linux/pci_regs.h +++ b/include/uapi/linux/pci_regs.h @@ -1230,4 +1230,36 @@ #define PCI_DVSEC_CXL_PORT_CTL 0x0c #define PCI_DVSEC_CXL_PORT_CTL_UNMASK_SBR 0x00000001 +/* Fmt[2:0] encoding for TLP Header */ +#define PCI_TLP_FMT_3DW_NO_DATA 0x0 // 3DW header, no data +#define PCI_TLP_FMT_4DW_NO_DATA 0x1 // 4DW header, no data +#define PCI_TLP_FMT_3DW_DATA 0x2 // 3DW header, with data +#define PCI_TLP_FMT_4DW_DATA 0x3 // 4DW header, with data +#define PCI_TLP_FMT_PREFIX 0x4 // Prefix header + +/* Type[4:0] encoding for TLP Header */ +#define PCI_TLP_TYPE_MEM_RD 0x00 // Memory Read Request +#define PCI_TLP_TYPE_MEM_RDLK 0x01 // Memory Read Lock Request +#define PCI_TLP_TYPE_MEM_WR 0x00 // Memory Write Request (Fmt must be with data) +#define PCI_TLP_TYPE_IO_RD 0x02 // IO Read Request +#define PCI_TLP_TYPE_IO_WR 0x02 // IO Write Request (Fmt must be with data) +#define PCI_TLP_TYPE_CFG0_RD 0x04 // Config Type 0 Read Request +#define PCI_TLP_TYPE_CFG0_WR 0x04 // Config Type 0 Write Request (Fmt must be with data) +#define PCI_TLP_TYPE_CFG1_RD 0x05 // Config Type 1 Read Request +#define PCI_TLP_TYPE_CFG1_WR 0x05 // Config Type 1 Write Request (Fmt must be with data) +#define PCI_TLP_TYPE_MSG 0x10 // Message Request (see routing field) +#define PCI_TLP_TYPE_MSGD 0x11 // Message Request with Data (see routing field) +#define PCI_TLP_TYPE_CPL 0x0A // Completion without Data +#define PCI_TLP_TYPE_CPLD 0x0A // Completion with Data (Fmt must be with data) +#define PCI_TLP_TYPE_CPLLCK 0x0B // Completion Locked +#define PCI_TLP_TYPE_CPLDLCK 0x0B // Completion with Data Locked (Fmt must be with data) +#define PCI_TLP_TYPE_FETCH_ADD 0x0C // Fetch and Add AtomicOp Request +#define PCI_TLP_TYPE_SWAP 0x0D // Unconditional Swap AtomicOp Request +#define PCI_TLP_TYPE_CMP_SWAP 0x0E // Compare and Swap AtomicOp Request +#define PCI_TLP_TYPE_LOCAL_PREFIX 0x00 // Local TLP Prefix (Fmt = 0x4) +#define PCI_TLP_TYPE_E2E_PREFIX 0x10 // End-to-End TLP Prefix (Fmt = 0x4) + +/* Macro to combine Fmt and Type into the 8-bit field */ +#define PCIE_TLP_FMT_TYPE(fmt, type) (((fmt) << 5) | ((type) & 0x1F)) + #endif /* LINUX_PCI_REGS_H */ -- 2.43.0 From jacky_chou at aspeedtech.com Tue Jul 15 13:43:17 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Tue, 15 Jul 2025 11:43:17 +0800 Subject: [PATCH v2 07/10] pinctrl: aspeed-g6: Add PCIe RC PERST pin group In-Reply-To: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> Message-ID: <20250715034320.2553837-8-jacky_chou@aspeedtech.com> The PCIe RC PERST uses SSPRST# as PERST# and enable this pin to output. Signed-off-by: Jacky Chou --- drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c b/drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c index 5a7cd0a88687..c751703acdb9 100644 --- a/drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c +++ b/drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c @@ -17,6 +17,7 @@ #include "../pinctrl-utils.h" #include "pinctrl-aspeed.h" +#define SCU040 0x040 /* Reset Control Set 1 */ #define SCU400 0x400 /* Multi-function Pin Control #1 */ #define SCU404 0x404 /* Multi-function Pin Control #2 */ #define SCU40C 0x40C /* Multi-function Pin Control #3 */ @@ -52,7 +53,7 @@ #define SCU6D0 0x6D0 /* Multi-function Pin Control #29 */ #define SCUC20 0xC20 /* PCIE configuration Setting Control */ -#define ASPEED_G6_NR_PINS 256 +#define ASPEED_G6_NR_PINS 258 #define M24 0 SIG_EXPR_LIST_DECL_SESG(M24, MDC3, MDIO3, SIG_DESC_SET(SCU410, 0)); @@ -1636,6 +1637,12 @@ FUNC_DECL_1(USB11BHID, USBB); FUNC_DECL_1(USB2BD, USBB); FUNC_DECL_1(USB2BH, USBB); +#define D7 257 +SIG_EXPR_LIST_DECL_SESG(D7, RCRST, PCIERC1, SIG_DESC_SET(SCU040, 19), + SIG_DESC_SET(SCU500, 24)); +PIN_DECL_(D7, SIG_EXPR_LIST_PTR(D7, RCRST)); +FUNC_GROUP_DECL(PCIERC1, D7); + /* Pins, groups and functions are sort(1):ed alphabetically for sanity */ static struct pinctrl_pin_desc aspeed_g6_pins[ASPEED_G6_NR_PINS] = { @@ -1806,6 +1813,7 @@ static struct pinctrl_pin_desc aspeed_g6_pins[ASPEED_G6_NR_PINS] = { ASPEED_PINCTRL_PIN(D4), ASPEED_PINCTRL_PIN(D5), ASPEED_PINCTRL_PIN(D6), + ASPEED_PINCTRL_PIN(D7), ASPEED_PINCTRL_PIN(E1), ASPEED_PINCTRL_PIN(E11), ASPEED_PINCTRL_PIN(E12), @@ -2073,6 +2081,7 @@ static const struct aspeed_pin_group aspeed_g6_groups[] = { ASPEED_PINCTRL_GROUP(SALT9G1), ASPEED_PINCTRL_GROUP(SD1), ASPEED_PINCTRL_GROUP(SD2), + ASPEED_PINCTRL_GROUP(PCIERC1), ASPEED_PINCTRL_GROUP(EMMCG1), ASPEED_PINCTRL_GROUP(EMMCG4), ASPEED_PINCTRL_GROUP(EMMCG8), @@ -2314,6 +2323,7 @@ static const struct aspeed_pin_function aspeed_g6_functions[] = { ASPEED_PINCTRL_FUNC(SPI2), ASPEED_PINCTRL_FUNC(SPI2CS1), ASPEED_PINCTRL_FUNC(SPI2CS2), + ASPEED_PINCTRL_FUNC(PCIERC1), ASPEED_PINCTRL_FUNC(TACH0), ASPEED_PINCTRL_FUNC(TACH1), ASPEED_PINCTRL_FUNC(TACH10), -- 2.43.0 From jacky_chou at aspeedtech.com Tue Jul 15 13:43:19 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Tue, 15 Jul 2025 11:43:19 +0800 Subject: [PATCH v2 09/10] PCI: aspeed: Add ASPEED PCIe RC driver In-Reply-To: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> Message-ID: <20250715034320.2553837-10-jacky_chou@aspeedtech.com> Introduce PCIe Root Complex driver for ASPEED SoCs. Support RC initialization, reset, clock, IRQ domain, and MSI domain setup. Implement platform-specific setup and register configuration for ASPEED. And provide PCI config space read/write and INTx/MSI interrupt handling. Signed-off-by: Jacky Chou --- drivers/pci/controller/Kconfig | 13 + drivers/pci/controller/Makefile | 1 + drivers/pci/controller/pcie-aspeed.c | 1137 ++++++++++++++++++++++++++ 3 files changed, 1151 insertions(+) create mode 100644 drivers/pci/controller/pcie-aspeed.c diff --git a/drivers/pci/controller/Kconfig b/drivers/pci/controller/Kconfig index 886f6f43a895..acab0dd48e8d 100644 --- a/drivers/pci/controller/Kconfig +++ b/drivers/pci/controller/Kconfig @@ -52,6 +52,19 @@ config PCIE_APPLE If unsure, say Y if you have an Apple Silicon system. +config PCIE_ASPEED + bool "ASPEED PCIe controller" + depends on ARCH_ASPEED || COMPILE_TEST + depends on OF + select PCI_MSI_ARCH_FALLBACKS + help + Enable this option to add support for the PCIe controller + found on ASPEED SoCs. + This driver provides initialization and management for PCIe + Root Complex functionality, including interrupt and MSI support. + Select Y if your platform uses an ASPEED SoC and requires PCIe + connectivity. + config PCI_VERSATILE bool "ARM Versatile PB PCI controller" depends on ARCH_VERSATILE || COMPILE_TEST diff --git a/drivers/pci/controller/Makefile b/drivers/pci/controller/Makefile index 038ccbd9e3ba..1339f88e153d 100644 --- a/drivers/pci/controller/Makefile +++ b/drivers/pci/controller/Makefile @@ -39,6 +39,7 @@ obj-$(CONFIG_PCI_LOONGSON) += pci-loongson.o obj-$(CONFIG_PCIE_HISI_ERR) += pcie-hisi-error.o obj-$(CONFIG_PCIE_APPLE) += pcie-apple.o obj-$(CONFIG_PCIE_MT7621) += pcie-mt7621.o +obj-$(CONFIG_PCIE_ASPEED) += pcie-aspeed.o # pcie-hisi.o quirks are needed even without CONFIG_PCIE_DW obj-y += dwc/ diff --git a/drivers/pci/controller/pcie-aspeed.c b/drivers/pci/controller/pcie-aspeed.c new file mode 100644 index 000000000000..a7e679d5fb42 --- /dev/null +++ b/drivers/pci/controller/pcie-aspeed.c @@ -0,0 +1,1137 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2025 Aspeed Technology Inc. + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MAX_MSI_HOST_IRQS 64 +#define PCIE_RESET_CONFIG_DEVICE_WAIT_MS 500 +#define PCIE_RESET_CONFIG_RC_WAIT_MS 10 + +/* AST2600 AHBC Registers */ +#define AHBC_KEY 0x00 +#define AHBC_UNLOCK_KEY 0xAEED1A03 +#define AHBC_UNLOCK 0x01 +#define AHBC_ADDR_MAPPING 0x8C +#define PCIE_RC_MEMORY_EN BIT(5) + +/* AST2600 PCIe Host Controller Registers */ +#define PEHR_GLOBAL 0x30 +#define AST2600_PORT_TYPE_MASK GENMASK(5, 4) +#define AST2600_PORT_TYPE(x) FIELD_PREP(AST2600_PORT_TYPE_MASK, x) +#define PEHR_LOCK 0x7C +#define PCIE_UNLOCK 0xa8 +#define PEHR_LINK 0xC0 +#define PCIE_LINK_UP BIT(5) + +/* AST2600 H2X Controller Registers */ +/* Common Registers*/ +#define H2X_INT_STS 0x08 +#define PCIE_TX_IDLE_CLEAR BIT(0) +#define PCIE_INTX_STS GENMASK(3, 0) +#define H2X_TX_DESC0 0x10 +#define H2X_TX_DESC1 0x14 +#define H2X_TX_DESC2 0x18 +#define H2X_TX_DESC3 0x1C +#define H2X_TX_DESC_DATA 0x20 +#define H2X_STS 0x24 +#define PCIE_TX_IDLE BIT(31) +#define PCIE_STATUS_OF_TX GENMASK(25, 24) +#define PCIE_RC_L_TX_COMPLETE BIT(24) +#define PCIE_RC_H_TX_COMPLETE BIT(25) +#define PCIE_TRIGGER_TX BIT(0) +#define H2X_AHB_ADDR_CONFIG0 0x60 +#define AHB_REMAP_LO_ADDR(x) FIELD_PREP(GENMASK(15, 4), x) +#define AHB_MASK_LO_ADDR(x) FIELD_PREP(GENMASK(31, 20), x) +#define H2X_AHB_ADDR_CONFIG1 0x64 +#define AHB_REMAP_HI_ADDR(x) (x) +#define H2X_AHB_ADDR_CONFIG2 0x68 +#define AHB_MASK_HI_ADDR(x) (x) + +/* Device Registers */ +#define H2X_DEV_CTRL 0x00 +#define PCIE_RX_DMA_EN BIT(9) +#define PCIE_RX_LINEAR BIT(8) +#define PCIE_RX_MSI_SEL BIT(7) +#define PCIE_RX_MSI_EN BIT(6) +#define PCIE_UNLOCK_RX_BUFF BIT(4) +#define PCIE_Wait_RX_TLP_CLR BIT(2) +#define PCIE_RC_RX_ENABLE BIT(1) +#define PCIE_RC_ENABLE BIT(0) +#define H2X_DEV_STS 0x08 +#define PCIE_RC_RX_DONE_ISR BIT(4) +#define H2X_DEV_RX_DESC_DATA 0x0C +#define H2X_DEV_RX_DESC1 0x14 +#define H2X_DEV_TX_TAG 0x3C + +/* AST2700 H2X */ +#define H2X_CTRL 0x00 +#define H2X_BRIDGE_EN BIT(0) +#define H2X_BRIDGE_DIRECT_EN BIT(1) +#define H2X_CFGE_INT_STS 0x08 +#define CFGE_TX_IDLE BIT(0) +#define CFGE_RX_BUSY BIT(1) +#define H2X_CFGI_TLP 0x20 +#define CFGI_BYTE_EN_MASK GENMASK(19, 16) +#define CFGI_BYTE_EN(x) FIELD_PREP(CFGI_BYTE_EN_MASK, (x)) +#define H2X_CFGI_WR_DATA 0x24 +#define CFGI_WRITE BIT(20) +#define H2X_CFGI_CTRL 0x28 +#define CFGI_TLP_FIRE BIT(0) +#define H2X_CFGI_RET_DATA 0x2C +#define H2X_CFGE_TLP_1ST 0x30 +#define H2X_CFGE_TLP_NEXT 0x34 +#define H2X_CFGE_CTRL 0x38 +#define CFGE_TLP_FIRE BIT(0) +#define H2X_CFGE_RET_DATA 0x3C +#define H2X_REMAP_PREF_ADDR 0x70 +#define REMAP_PREF_ADDR_63_32(x) (x) +#define H2X_REMAP_DIRECT_ADDR 0x78 +#define REMAP_BAR_BASE(x) (x) + +/* AST2700 PEHR */ +#define PEHR_MISC_58 0x58 +#define LOCAL_SCALE_SUP BIT(0) +#define PEHR_MISC_5C 0x5C +#define CONFIG_RC_DEVICE BIT(30) +#define PEHR_MISC_60 0x60 +#define AST2700_PORT_TYPE_MASK GENMASK(7, 4) +#define PORT_TYPE_ROOT BIT(2) +#define PEHR_MISC_70 0x70 +#define POSTED_DATA_CREDITS(x) FIELD_PREP(GENMASK(15, 0), x) +#define POSTED_HEADER_CREDITS(x) FIELD_PREP(GENMASK(27, 16), x) +#define PEHR_MISC_78 0x78 +#define COMPLETION_DATA_CREDITS(x) FIELD_PREP(GENMASK(15, 0), x) +#define COMPLETION_HEADER_CREDITS(x) FIELD_PREP(GENMASK(27, 16), x) +#define PEHR_MISC_300 0x300 +#define RC_GEN2 BIT(0) +#define PEHR_MISC_344 0x344 +#define LINK_UP_GEN2 BIT(18) +#define PEHR_MISC_358 0x358 +#define LINK_UP_GEN4 BIT(8) + +/* AST2700 SCU */ +#define SCU_60 0x60 +#define RC_E2M_PATH_EN BIT(0) +#define RC_H2XS_PATH_EN BIT(16) +#define RC_H2XD_PATH_EN BIT(17) +#define RC_H2XX_PATH_EN BIT(18) +#define RC_UPSTREAM_MEM_EN BIT(19) +#define SCU_64 0x64 +#define RC0_DECODE_DMA_BASE(x) FIELD_PREP(GENMASK(7, 0), x) +#define RC0_DECODE_DMA_LIMIT(x) FIELD_PREP(GENMASK(15, 8), x) +#define RC1_DECODE_DMA_BASE(x) FIELD_PREP(GENMASK(23, 16), x) +#define RC1_DECODE_DMA_LIMIT(x) FIELD_PREP(GENMASK(31, 24), x) +#define SCU_70 0x70 +#define DISABLE_EP_FUNC 0 + +/* TLP configuration type 0 and type 1 */ +#define CRG0_READ_FMTTYPE \ + FIELD_PREP(GENMASK(31, 24), PCIE_TLP_FMT_TYPE(PCI_TLP_FMT_3DW_NO_DATA, \ + PCI_TLP_TYPE_CFG0_RD)) +#define CRG0_WRITE_FMTTYPE \ + FIELD_PREP(GENMASK(31, 24), PCIE_TLP_FMT_TYPE(PCI_TLP_FMT_3DW_DATA, \ + PCI_TLP_TYPE_CFG0_WR)) +#define CRG1_READ_FMTTYPE \ + FIELD_PREP(GENMASK(31, 24), PCIE_TLP_FMT_TYPE(PCI_TLP_FMT_3DW_NO_DATA, \ + PCI_TLP_TYPE_CFG1_RD)) +#define CRG1_WRITE_FMTTYPE \ + FIELD_PREP(GENMASK(31, 24), PCIE_TLP_FMT_TYPE(PCI_TLP_FMT_3DW_DATA, \ + PCI_TLP_TYPE_CFG1_WR)) +#define CRG_PAYLOAD_SIZE 0x01 /* 1 DWORD */ +#define TLP_HEADER_BYTE_EN(x, y) ((GENMASK((x) - 1, 0) << ((y) % 4))) +#define TLP_GET_VALUE(x, y, z) (((x) >> ((((z) % 4)) * 8)) & GENMASK((8 * (y)) - 1, 0)) +#define TLP_SET_VALUE(x, y, z) ((((x) & GENMASK((8 * (y)) - 1, 0)) << ((((z) % 4)) * 8))) +#define AST2600_TX_DESC1_VALUE 0x00002000 +#define AST2700_TX_DESC1_VALUE 0x00401000 + +/** + * struct aspeed_pcie_port - PCIe port information + * @list: port list + * @pcie: pointer to PCIe host info + * @clk: pointer to the port clock gate + * @phy: pointer to PHY control block + * @perst: pointer to port reset control + * @slot: port slot + */ +struct aspeed_pcie_port { + struct list_head list; + struct aspeed_pcie *pcie; + struct clk *clk; + struct regmap *pciephy; + struct reset_control *perst; + u32 slot; +}; + +/** + * struct aspeed_pcie - PCIe port information + * @host: pointer to pcie host bridge + * @dev: pointer to device structure + * @reg: PCIe Host register base address + * @ahbc: pointer to AHHC register map + * @cfg: pointer to Aspeed PCIe configuration register map + * @platform: platform specific information + * @ports: list of PCIe ports + * @domain: PCI domain number + * @tx_tag: current TX tag for the port + * @h2xrst: pointer to H2X reset control + * @irq_domain: IRQ domain for INTx interrupts + * @dev_domain: IRQ domain for device interrupts + * @msi_domain: IRQ domain for MSI interrupts + * @lock: mutex to protect MSI bitmap variable + * @msi_irq_in_use: bitmap to track used MSI host IRQs + */ +struct aspeed_pcie { + struct pci_host_bridge *host; + struct device *dev; + void __iomem *reg; + struct regmap *ahbc; + struct regmap *cfg; + const struct aspeed_pcie_rc_platform *platform; + struct list_head ports; + + int domain; + u8 tx_tag; + + struct reset_control *h2xrst; + + struct irq_domain *irq_domain; + struct irq_domain *dev_domain; + struct irq_domain *msi_domain; + struct mutex lock; /* Protect MSI bitmap variable */ + DECLARE_BITMAP(msi_irq_in_use, MAX_MSI_HOST_IRQS); +}; + +/** + * struct aspeed_pcie_rc_platform - Platform information + * @setup: initialization function + * @get_link: port link status function + * @port_init: port initialization function + * @reg_intx_en: INTx enable register offset + * @reg_intx_sts: INTx status register offset + * @reg_msi_en: MSI enable register offset + * @reg_msi_sts: MSI enable register offset + * @msi_address: HW fixed MSI address + */ +struct aspeed_pcie_rc_platform { + int (*setup)(struct platform_device *pdev); + bool (*get_link)(struct aspeed_pcie_port *port); + void (*port_init)(struct aspeed_pcie_port *port); + int reg_intx_en; + int reg_intx_sts; + int reg_msi_en; + int reg_msi_sts; + int msi_address; +}; + +static void aspeed_pcie_intx_irq_ack(struct irq_data *d) +{ + struct aspeed_pcie *pcie = irq_data_get_irq_chip_data(d); + int intx_en = pcie->platform->reg_intx_en; + u32 en; + + en = readl(pcie->reg + intx_en); + en |= BIT(d->hwirq); + writel(en, pcie->reg + intx_en); +} + +static void aspeed_pcie_intx_irq_mask(struct irq_data *d) +{ + struct aspeed_pcie *pcie = irq_data_get_irq_chip_data(d); + int intx_en = pcie->platform->reg_intx_en; + u32 en; + + en = readl(pcie->reg + intx_en); + en |= BIT(d->hwirq); + writel(en, pcie->reg + intx_en); +} + +static void aspeed_pcie_intx_irq_unmask(struct irq_data *d) +{ + struct aspeed_pcie *pcie = irq_data_get_irq_chip_data(d); + int intx_en = pcie->platform->reg_intx_en; + u32 en; + + en = readl(pcie->reg + intx_en); + en |= BIT(d->hwirq); + writel(en, pcie->reg + intx_en); +} + +static struct irq_chip aspeed_intx_irq_chip = { + .name = "IntX", + .irq_ack = aspeed_pcie_intx_irq_ack, + .irq_mask = aspeed_pcie_intx_irq_mask, + .irq_unmask = aspeed_pcie_intx_irq_unmask, +}; + +static int aspeed_pcie_intx_map(struct irq_domain *domain, unsigned int irq, + irq_hw_number_t hwirq) +{ + irq_set_chip_and_handler(irq, &aspeed_intx_irq_chip, handle_level_irq); + irq_set_chip_data(irq, domain->host_data); + irq_set_status_flags(irq, IRQ_LEVEL); + + return 0; +} + +static const struct irq_domain_ops aspeed_intx_domain_ops = { + .map = aspeed_pcie_intx_map, +}; + +static irqreturn_t aspeed_pcie_intr_handler(int irq, void *dev_id) +{ + struct aspeed_pcie *pcie = dev_id; + const struct aspeed_pcie_rc_platform *platform = pcie->platform; + unsigned long status; + unsigned long intx; + u32 bit; + int i; + + intx = readl(pcie->reg + platform->reg_intx_sts) & PCIE_INTX_STS; + for_each_set_bit(bit, &intx, PCI_NUM_INTX) + generic_handle_domain_irq(pcie->irq_domain, bit); + + if (IS_ENABLED(CONFIG_PCI_MSI)) { + for (i = 0; i < 2; i++) { + status = readl(pcie->reg + platform->reg_msi_sts + (i * 4)); + writel(status, pcie->reg + platform->reg_msi_sts + (i * 4)); + + for_each_set_bit(bit, &status, 32) { + bit += (i * 32); + generic_handle_domain_irq(pcie->dev_domain, bit); + } + } + } + + return IRQ_HANDLED; +} + +static u32 aspeed_pcie_get_bdf_offset(struct pci_bus *bus, unsigned int devfn, + int where) +{ + return ((bus->number) << 24) | (PCI_SLOT(devfn) << 19) | + (PCI_FUNC(devfn) << 16) | (where & ~3); +} + +static bool aspeed_ast2600_get_link(struct aspeed_pcie_port *port) +{ + u32 link_sts; + + regmap_read(port->pciephy, PEHR_LINK, &link_sts); + + return !!(link_sts & PCIE_LINK_UP); +} + +static int aspeed_ast2600_conf(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 *val, u32 fmt_type, + bool write) +{ + struct aspeed_pcie *pcie = bus->sysdata; + u32 bdf_offset, cfg_val, isr; + int ret; + + bdf_offset = aspeed_pcie_get_bdf_offset(bus, devfn, where); + + /* Driver may set unlock RX buffer before triggering next TX config */ + writel(PCIE_UNLOCK_RX_BUFF | readl(pcie->reg + H2X_DEV_CTRL), + pcie->reg + H2X_DEV_CTRL); + + cfg_val = fmt_type | CRG_PAYLOAD_SIZE; + regmap_write(pcie->cfg, H2X_TX_DESC0, cfg_val); + + cfg_val = AST2600_TX_DESC1_VALUE | FIELD_PREP(GENMASK(11, 8), pcie->tx_tag) | + TLP_HEADER_BYTE_EN(size, where); + regmap_write(pcie->cfg, H2X_TX_DESC1, cfg_val); + + regmap_write(pcie->cfg, H2X_TX_DESC2, bdf_offset); + regmap_write(pcie->cfg, H2X_TX_DESC3, 0); + if (write) + regmap_write(pcie->cfg, H2X_TX_DESC_DATA, TLP_SET_VALUE(*val, size, where)); + + regmap_write_bits(pcie->cfg, H2X_STS, PCIE_TRIGGER_TX, PCIE_TRIGGER_TX); + + ret = regmap_read_poll_timeout(pcie->cfg, H2X_STS, cfg_val, + (cfg_val & PCIE_TX_IDLE), 0, 50); + if (ret) { + dev_err(pcie->dev, + "%04x:%02x:%02x.%d CR tx timeout sts: 0x%08x\n", + pcie->domain, bus->number, PCI_SLOT(devfn), + PCI_FUNC(devfn), cfg_val); + ret = PCIBIOS_SET_FAILED; + PCI_SET_ERROR_RESPONSE(val); + goto out; + } + + regmap_write_bits(pcie->cfg, H2X_INT_STS, PCIE_TX_IDLE_CLEAR, + PCIE_TX_IDLE_CLEAR); + + regmap_read(pcie->cfg, H2X_STS, &cfg_val); + switch (cfg_val & PCIE_STATUS_OF_TX) { + case PCIE_RC_L_TX_COMPLETE: + case PCIE_RC_H_TX_COMPLETE: + ret = readl_poll_timeout(pcie->reg + H2X_DEV_STS, isr, + (isr & PCIE_RC_RX_DONE_ISR), 0, 50); + if (ret) { + dev_err(pcie->dev, + "%04x:%02x:%02x.%d CR rx timeout sts: 0x%08x\n", + pcie->domain, bus->number, PCI_SLOT(devfn), + PCI_FUNC(devfn), isr); + ret = PCIBIOS_SET_FAILED; + PCI_SET_ERROR_RESPONSE(val); + goto out; + } + if (!write) { + if (readl(pcie->reg + H2X_DEV_RX_DESC1) & BIT(13)) { + ret = PCIBIOS_SET_FAILED; + PCI_SET_ERROR_RESPONSE(val); + goto out; + } else { + *val = readl(pcie->reg + H2X_DEV_RX_DESC_DATA); + } + } + break; + case PCIE_STATUS_OF_TX: + ret = PCIBIOS_SET_FAILED; + PCI_SET_ERROR_RESPONSE(val); + goto out; + default: + regmap_read(pcie->cfg, H2X_DEV_RX_DESC_DATA, &cfg_val); + *val = cfg_val; + break; + } + + writel(PCIE_UNLOCK_RX_BUFF | readl(pcie->reg + H2X_DEV_CTRL), + pcie->reg + H2X_DEV_CTRL); + + *val = TLP_GET_VALUE(*val, size, where); + + ret = PCIBIOS_SUCCESSFUL; +out: + writel(readl(pcie->reg + H2X_DEV_STS), pcie->reg + H2X_DEV_STS); + pcie->tx_tag = (pcie->tx_tag + 1) % 0x8; + return ret; +} + +static int aspeed_ast2600_rd_conf(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 *val) +{ + int slot = PCI_SLOT(devfn); + + if (slot != 0 && slot != 8) + return PCIBIOS_DEVICE_NOT_FOUND; + + return aspeed_ast2600_conf(bus, devfn, where, size, val, CRG0_READ_FMTTYPE, false); +} + +static int aspeed_ast2600_child_rd_conf(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 *val) +{ + return aspeed_ast2600_conf(bus, devfn, where, size, val, CRG1_READ_FMTTYPE, false); +} + +static int aspeed_ast2600_wr_conf(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 val) +{ + int slot = PCI_SLOT(devfn); + + if (slot != 0 && slot != 8) + return PCIBIOS_DEVICE_NOT_FOUND; + + return aspeed_ast2600_conf(bus, devfn, where, size, &val, CRG0_WRITE_FMTTYPE, true); +} + +static int aspeed_ast2600_child_wr_conf(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 val) +{ + return aspeed_ast2600_conf(bus, devfn, where, size, &val, CRG1_WRITE_FMTTYPE, true); +} + +static bool aspeed_ast2700_get_link(struct aspeed_pcie_port *port) +{ + u32 reg; + + /* AST2700 has Gen2 and Gen4 RCs. + * Read register to distinguish between Gen2 or Gen4. + * Then read the corresonding register that is from Aspeed + * design to get whether it linked up or not. + */ + regmap_read(port->pciephy, PEHR_MISC_300, ®); + if (reg & RC_GEN2) { + regmap_read(port->pciephy, PEHR_MISC_344, ®); + return !!(reg & LINK_UP_GEN2); + } + + regmap_read(port->pciephy, PEHR_MISC_358, ®); + return !!(reg & LINK_UP_GEN4); +} + +static int aspeed_ast2700_config(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 *val, bool write) +{ + struct aspeed_pcie *pcie = bus->sysdata; + u32 cfg_val; + + cfg_val = CFGI_BYTE_EN(TLP_HEADER_BYTE_EN(size, where)) | (where & ~3); + if (write) + cfg_val |= CFGI_WRITE; + writel(cfg_val, pcie->reg + H2X_CFGI_TLP); + + writel(TLP_SET_VALUE(*val, size, where), pcie->reg + H2X_CFGI_WR_DATA); + writel(CFGI_TLP_FIRE, pcie->reg + H2X_CFGI_CTRL); + *val = readl(pcie->reg + H2X_CFGI_RET_DATA); + *val = TLP_GET_VALUE(*val, size, where); + + return PCIBIOS_SUCCESSFUL; +} + +static int aspeed_ast2700_child_config(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 *val, + bool write) +{ + struct aspeed_pcie *pcie = bus->sysdata; + u32 bdf_offset, status, cfg_val; + int ret; + + bdf_offset = aspeed_pcie_get_bdf_offset(bus, devfn, where); + + cfg_val = CRG_PAYLOAD_SIZE; + if (write) + cfg_val |= (bus->number == 1) ? CRG0_WRITE_FMTTYPE : CRG1_WRITE_FMTTYPE; + else + cfg_val |= (bus->number == 1) ? CRG0_READ_FMTTYPE : CRG1_READ_FMTTYPE; + writel(cfg_val, pcie->reg + H2X_CFGE_TLP_1ST); + + cfg_val = AST2700_TX_DESC1_VALUE | + FIELD_PREP(GENMASK(11, 8), pcie->tx_tag) | + TLP_HEADER_BYTE_EN(size, where); + writel(cfg_val, pcie->reg + H2X_CFGE_TLP_NEXT); + + writel(bdf_offset, pcie->reg + H2X_CFGE_TLP_NEXT); + if (write) + writel(TLP_SET_VALUE(*val, size, where), pcie->reg + H2X_CFGE_TLP_NEXT); + writel(CFGE_TX_IDLE | CFGE_RX_BUSY, pcie->reg + H2X_CFGE_INT_STS); + writel(CFGE_TLP_FIRE, pcie->reg + H2X_CFGE_CTRL); + + ret = readl_poll_timeout(pcie->reg + H2X_CFGE_INT_STS, status, + (status & CFGE_TX_IDLE), 0, 50); + if (ret) { + dev_err(pcie->dev, + "%04x:%02x:%02x.%d CR tx timeout sts: 0x%08x\n", + pcie->domain, bus->number, PCI_SLOT(devfn), + PCI_FUNC(devfn), status); + ret = PCIBIOS_SET_FAILED; + PCI_SET_ERROR_RESPONSE(val); + goto out; + } + + ret = readl_poll_timeout(pcie->reg + H2X_CFGE_INT_STS, status, + (status & CFGE_RX_BUSY), 0, 50); + if (ret) { + dev_err(pcie->dev, + "%04x:%02x:%02x.%d CR rx timeoutsts: 0x%08x\n", + pcie->domain, bus->number, PCI_SLOT(devfn), + PCI_FUNC(devfn), status); + ret = PCIBIOS_SET_FAILED; + PCI_SET_ERROR_RESPONSE(val); + goto out; + } + *val = readl(pcie->reg + H2X_CFGE_RET_DATA); + *val = TLP_GET_VALUE(*val, size, where); + + ret = PCIBIOS_SUCCESSFUL; +out: + writel(status, pcie->reg + H2X_CFGE_INT_STS); + pcie->tx_tag = (pcie->tx_tag + 1) % 0xF; + return ret; +} + +static int aspeed_ast2700_rd_conf(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 *val) +{ + if (devfn != 0) + return PCIBIOS_DEVICE_NOT_FOUND; + + return aspeed_ast2700_config(bus, devfn, where, size, val, false); +} + +static int aspeed_ast2700_child_rd_conf(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 *val) +{ + return aspeed_ast2700_child_config(bus, devfn, where, size, val, false); +} + +static int aspeed_ast2700_wr_conf(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 val) +{ + if (devfn != 0) + return PCIBIOS_DEVICE_NOT_FOUND; + + return aspeed_ast2700_config(bus, devfn, where, size, &val, true); +} + +static int aspeed_ast2700_child_wr_conf(struct pci_bus *bus, unsigned int devfn, + int where, int size, u32 val) +{ + return aspeed_ast2700_child_config(bus, devfn, where, size, &val, true); +} + +static struct pci_ops aspeed_ast2600_pcie_ops = { + .read = aspeed_ast2600_rd_conf, + .write = aspeed_ast2600_wr_conf, +}; + +static struct pci_ops aspeed_ast2600_pcie_child_ops = { + .read = aspeed_ast2600_child_rd_conf, + .write = aspeed_ast2600_child_wr_conf, +}; + +static struct pci_ops aspeed_ast2700_pcie_ops = { + .read = aspeed_ast2700_rd_conf, + .write = aspeed_ast2700_wr_conf, +}; + +static struct pci_ops aspeed_ast2700_pcie_child_ops = { + .read = aspeed_ast2700_child_rd_conf, + .write = aspeed_ast2700_child_wr_conf, +}; + +#ifdef CONFIG_PCI_MSI +static void aspeed_msi_compose_msi_msg(struct irq_data *data, + struct msi_msg *msg) +{ + struct aspeed_pcie *pcie = irq_data_get_irq_chip_data(data); + + msg->address_hi = 0; + msg->address_lo = pcie->platform->msi_address; + msg->data = data->hwirq; +} + +static int aspeed_msi_set_affinity(struct irq_data *irq_data, + const struct cpumask *mask, bool force) +{ + return -EINVAL; +} + +static struct irq_chip aspeed_msi_bottom_irq_chip = { + .name = "ASPEED MSI", + .irq_compose_msi_msg = aspeed_msi_compose_msi_msg, + .irq_set_affinity = aspeed_msi_set_affinity, +}; + +static int aspeed_irq_msi_domain_alloc(struct irq_domain *domain, + unsigned int virq, unsigned int nr_irqs, + void *args) +{ + struct aspeed_pcie *pcie = domain->host_data; + int bit; + int i; + + mutex_lock(&pcie->lock); + + bit = bitmap_find_free_region(pcie->msi_irq_in_use, MAX_MSI_HOST_IRQS, + get_count_order(nr_irqs)); + + mutex_unlock(&pcie->lock); + + if (bit < 0) + return -ENOSPC; + + for (i = 0; i < nr_irqs; i++) { + irq_domain_set_info(domain, virq + i, bit + i, + &aspeed_msi_bottom_irq_chip, + domain->host_data, handle_simple_irq, NULL, + NULL); + } + + return 0; +} + +static void aspeed_irq_msi_domain_free(struct irq_domain *domain, + unsigned int virq, unsigned int nr_irqs) +{ + struct irq_data *data = irq_domain_get_irq_data(domain, virq); + struct aspeed_pcie *pcie = irq_data_get_irq_chip_data(data); + + mutex_lock(&pcie->lock); + + bitmap_release_region(pcie->msi_irq_in_use, data->hwirq, + get_count_order(nr_irqs)); + + mutex_unlock(&pcie->lock); +} + +static const struct irq_domain_ops aspeed_msi_domain_ops = { + .alloc = aspeed_irq_msi_domain_alloc, + .free = aspeed_irq_msi_domain_free, +}; + +static struct irq_chip aspeed_msi_irq_chip = { + .name = "PCIe MSI", + .irq_enable = pci_msi_unmask_irq, + .irq_disable = pci_msi_mask_irq, + .irq_mask = pci_msi_mask_irq, + .irq_unmask = pci_msi_unmask_irq, +}; + +static struct msi_domain_info aspeed_msi_domain_info = { + .flags = (MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS | + MSI_FLAG_MULTI_PCI_MSI | MSI_FLAG_PCI_MSIX), + .chip = &aspeed_msi_irq_chip, +}; + +static int aspeed_pcie_msi_init(struct aspeed_pcie *pcie) +{ + int ret = 0; + + writel(~0, pcie->reg + pcie->platform->reg_msi_en); + writel(~0, pcie->reg + pcie->platform->reg_msi_en + 0x04); + writel(~0, pcie->reg + pcie->platform->reg_msi_sts); + writel(~0, pcie->reg + pcie->platform->reg_msi_sts + 0x04); + + pcie->dev_domain = + irq_domain_add_linear(NULL, MAX_MSI_HOST_IRQS, &aspeed_msi_domain_ops, pcie); + if (!pcie->dev_domain) + return dev_err_probe(pcie->dev, -ENOMEM, "failed to create IRQ domain\n"); + + pcie->msi_domain = pci_msi_create_irq_domain(dev_fwnode(pcie->dev), &aspeed_msi_domain_info, + pcie->dev_domain); + if (!pcie->msi_domain) + return dev_err_probe(pcie->dev, -ENOMEM, "failed to create MSI domain\n"); + + return ret; +} + +static void aspeed_pcie_msi_free(struct aspeed_pcie *pcie) +{ + if (pcie->msi_domain) { + irq_domain_remove(pcie->msi_domain); + pcie->msi_domain = NULL; + } + + if (pcie->dev_domain) { + irq_domain_remove(pcie->dev_domain); + pcie->dev_domain = NULL; + } +} +#else +static int aspeed_pcie_msi_init(struct aspeed_pcie *pcie) +{ + return 0; +} + +static void aspeed_pcie_msi_free(struct aspeed_pcie *pcie) {} +#endif + +static void aspeed_pcie_irq_domain_free(struct aspeed_pcie *pcie) +{ + if (pcie->irq_domain) { + irq_domain_remove(pcie->irq_domain); + pcie->irq_domain = NULL; + } + aspeed_pcie_msi_free(pcie); +} + +static int aspeed_pcie_init_irq_domain(struct aspeed_pcie *pcie) +{ + struct device *dev = pcie->dev; + struct device_node *node = dev->of_node; + struct device_node *pcie_intc_node; + int ret; + + pcie_intc_node = of_get_next_child(node, NULL); + if (!pcie_intc_node) + return dev_err_probe(dev, -ENODEV, "No PCIe Intc node found\n"); + + pcie->irq_domain = + irq_domain_add_linear(pcie_intc_node, PCI_NUM_INTX, &aspeed_intx_domain_ops, pcie); + of_node_put(pcie_intc_node); + if (!pcie->irq_domain) { + ret = dev_err_probe(dev, -ENOMEM, "failed to get an INTx IRQ domain\n"); + goto err; + } + + writel(0, pcie->reg + pcie->platform->reg_intx_en); + writel(~0, pcie->reg + pcie->platform->reg_intx_sts); + + ret = aspeed_pcie_msi_init(pcie); + if (ret) + goto err; + + return 0; +err: + aspeed_pcie_irq_domain_free(pcie); + return ret; +} + +static void aspeed_ast2600_port_init(struct aspeed_pcie_port *port) +{ + regmap_write(port->pciephy, PEHR_LOCK, PCIE_UNLOCK); + regmap_write(port->pciephy, PEHR_GLOBAL, AST2600_PORT_TYPE(0x3)); +} + +static void aspeed_ast2700_port_init(struct aspeed_pcie_port *port) +{ + u32 cfg_val; + + regmap_write(port->pciephy, PEHR_MISC_70, + POSTED_DATA_CREDITS(0xc0) | POSTED_HEADER_CREDITS(0xa)); + regmap_write(port->pciephy, PEHR_MISC_78, + COMPLETION_DATA_CREDITS(0x30) | COMPLETION_HEADER_CREDITS(0x8)); + regmap_write(port->pciephy, PEHR_MISC_58, LOCAL_SCALE_SUP); + + regmap_write(port->pciephy, PEHR_MISC_5C, CONFIG_RC_DEVICE); + regmap_read(port->pciephy, PEHR_MISC_60, &cfg_val); + cfg_val &= ~AST2700_PORT_TYPE_MASK; + cfg_val |= FIELD_PREP(AST2700_PORT_TYPE_MASK, PORT_TYPE_ROOT); + regmap_write(port->pciephy, PEHR_MISC_60, cfg_val); +} + +static int aspeed_pcie_port_init(struct aspeed_pcie_port *port) +{ + struct aspeed_pcie *pcie = port->pcie; + struct device *dev = pcie->dev; + int ret; + + ret = clk_prepare_enable(port->clk); + if (ret) + return dev_err_probe(dev, ret, "enabling clk pcie%d\n", port->slot); + + pcie->platform->port_init(port); + + reset_control_deassert(port->perst); + mdelay(PCIE_RESET_CONFIG_DEVICE_WAIT_MS); + + if (pcie->platform->get_link(port)) + dev_dbg(dev, "PCIe%d port %d link up\n", pcie->domain, port->slot); + else + dev_dbg(dev, "PCIe%d port %d link down\n", pcie->domain, port->slot); + + return 0; +} + +static int aspeed_pcie_init_ports(struct aspeed_pcie *pcie) +{ + struct device *dev = pcie->dev; + struct aspeed_pcie_port *port, *tmp; + u8 num_enabled = 0; + + list_for_each_entry_safe(port, tmp, &pcie->ports, list) { + u32 slot = port->slot; + int ret; + + ret = aspeed_pcie_port_init(port); + if (ret) { + dev_err(dev, "initializing port %d failed\n", slot); + list_del(&port->list); + } else { + num_enabled++; + } + } + + return (num_enabled > 0) ? 0 : -ENODEV; +} + +static void aspeed_host_reset(struct aspeed_pcie *pcie) +{ + reset_control_assert(pcie->h2xrst); + mdelay(PCIE_RESET_CONFIG_RC_WAIT_MS); + reset_control_deassert(pcie->h2xrst); +} + +static int aspeed_ast2600_setup(struct platform_device *pdev) +{ + struct aspeed_pcie *pcie = platform_get_drvdata(pdev); + struct device *dev = pcie->dev; + + pcie->ahbc = syscon_regmap_lookup_by_phandle(dev->of_node, "aspeed,ahbc"); + if (IS_ERR(pcie->ahbc)) + return dev_err_probe(dev, PTR_ERR(pcie->ahbc), "failed to map ahbc base\n"); + + aspeed_host_reset(pcie); + + regmap_write(pcie->ahbc, AHBC_KEY, AHBC_UNLOCK_KEY); + regmap_update_bits(pcie->ahbc, AHBC_ADDR_MAPPING, PCIE_RC_MEMORY_EN, PCIE_RC_MEMORY_EN); + regmap_write(pcie->ahbc, AHBC_KEY, AHBC_UNLOCK); + + regmap_write(pcie->cfg, H2X_AHB_ADDR_CONFIG0, + AHB_REMAP_LO_ADDR(0x600) | AHB_MASK_LO_ADDR(0xE00)); + regmap_write(pcie->cfg, H2X_AHB_ADDR_CONFIG1, AHB_REMAP_HI_ADDR(0)); + regmap_write(pcie->cfg, H2X_AHB_ADDR_CONFIG2, AHB_MASK_HI_ADDR(~0)); + + regmap_write(pcie->cfg, H2X_CTRL, H2X_BRIDGE_EN); + + writel(PCIE_RX_DMA_EN | PCIE_RX_LINEAR | PCIE_RX_MSI_SEL | PCIE_RX_MSI_EN | + PCIE_Wait_RX_TLP_CLR | PCIE_RC_RX_ENABLE | PCIE_RC_ENABLE, + pcie->reg + H2X_DEV_CTRL); + + writel(0x28, pcie->reg + H2X_DEV_TX_TAG); + + pcie->host->ops = &aspeed_ast2600_pcie_ops; + pcie->host->child_ops = &aspeed_ast2600_pcie_child_ops; + + return 0; +} + +static int aspeed_ast2700_bar_assign(struct aspeed_pcie *pcie) +{ + struct resource_entry *win, *tmp; + struct pci_host_bridge *bridge = pcie->host; + + resource_list_for_each_entry_safe(win, tmp, &bridge->windows) { + struct resource *res = win->res; + + if (resource_type(res) == IORESOURCE_MEM && + !(res->flags & IORESOURCE_MEM_64)) { + writel(REMAP_BAR_BASE(res->start), pcie->reg + H2X_REMAP_DIRECT_ADDR); + return 0; + } + } + + return -ENODEV; +} + +static int aspeed_ast2700_setup(struct platform_device *pdev) +{ + struct aspeed_pcie *pcie = platform_get_drvdata(pdev); + int ret; + + regmap_update_bits(pcie->cfg, SCU_60, + RC_E2M_PATH_EN | RC_H2XS_PATH_EN | RC_H2XD_PATH_EN | RC_H2XX_PATH_EN | + RC_UPSTREAM_MEM_EN, + RC_E2M_PATH_EN | RC_H2XS_PATH_EN | RC_H2XD_PATH_EN | RC_H2XX_PATH_EN | + RC_UPSTREAM_MEM_EN); + regmap_write(pcie->cfg, SCU_64, + RC0_DECODE_DMA_BASE(0) | RC0_DECODE_DMA_LIMIT(0xFF) | RC1_DECODE_DMA_BASE(0) | + RC1_DECODE_DMA_LIMIT(0xFF)); + regmap_write(pcie->cfg, SCU_70, DISABLE_EP_FUNC); + + aspeed_host_reset(pcie); + + writel(0, pcie->reg + H2X_CTRL); + writel(H2X_BRIDGE_EN | H2X_BRIDGE_DIRECT_EN, pcie->reg + H2X_CTRL); + + ret = aspeed_ast2700_bar_assign(pcie); + if (ret) + return dev_err_probe(pcie->dev, ret, "Failed to assign bar\n"); + + /* Prepare for 64-bit BAR pref */ + writel(REMAP_PREF_ADDR_63_32(0x3), pcie->reg + H2X_REMAP_PREF_ADDR); + + pcie->host->ops = &aspeed_ast2700_pcie_ops; + pcie->host->child_ops = &aspeed_ast2700_pcie_child_ops; + + return 0; +} + +static int aspeed_pcie_parse_port(struct aspeed_pcie *pcie, + struct device_node *node, + int slot) +{ + struct aspeed_pcie_port *port; + struct device *dev = pcie->dev; + + port = devm_kzalloc(dev, sizeof(*port), GFP_KERNEL); + if (!port) + return -ENOMEM; + + port->pciephy = syscon_regmap_lookup_by_phandle(node, "aspeed,pciephy"); + if (IS_ERR(port->pciephy)) + return dev_err_probe(dev, PTR_ERR(port->pciephy), + "Failed to map pcie%d pciephy base\n", slot); + + port->clk = devm_get_clk_from_child(dev, node, NULL); + if (IS_ERR(port->clk)) + return dev_err_probe(dev, PTR_ERR(port->clk), + "Failed to get pcie%d clock\n", slot); + + port->perst = of_reset_control_get_exclusive(node, "perst"); + if (IS_ERR(port->perst)) + return dev_err_probe(dev, PTR_ERR(port->perst), + "Failed to get pcie%d reset control\n", slot); + reset_control_assert(port->perst); + + port->slot = slot; + port->pcie = pcie; + + INIT_LIST_HEAD(&port->list); + list_add_tail(&port->list, &pcie->ports); + + return 0; +} + +static int aspeed_pcie_parse_dt(struct aspeed_pcie *pcie) +{ + struct device *dev = pcie->dev; + struct device_node *node = dev->of_node; + int ret; + + for_each_available_child_of_node_scoped(node, child) { + int slot; + const char *type; + + ret = of_property_read_string(child, "device_type", &type); + if (ret || strcmp(type, "pci")) + continue; + + ret = of_pci_get_devfn(child); + if (ret < 0) + return dev_err_probe(dev, ret, "failed to parse devfn\n"); + + slot = PCI_SLOT(ret); + + ret = aspeed_pcie_parse_port(pcie, child, slot); + if (ret) + return ret; + } + + if (list_empty(&pcie->ports)) + return dev_err_probe(dev, -ENODEV, "No PCIe port found in DT\n"); + + return 0; +} + +static int aspeed_pcie_probe(struct platform_device *pdev) +{ + struct device *dev = &pdev->dev; + struct pci_host_bridge *host; + struct aspeed_pcie *pcie; + struct aspeed_pcie_port *port; + struct device_node *node = dev->of_node; + const struct aspeed_pcie_rc_platform *md = of_device_get_match_data(dev); + int irq, ret; + + if (!md) + return -ENODEV; + + host = devm_pci_alloc_host_bridge(dev, sizeof(*pcie)); + if (!host) + return -ENOMEM; + + pcie = pci_host_bridge_priv(host); + pcie->dev = dev; + pcie->tx_tag = 0; + platform_set_drvdata(pdev, pcie); + + pcie->platform = md; + pcie->host = host; + INIT_LIST_HEAD(&pcie->ports); + + pcie->reg = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(pcie->reg)) + return PTR_ERR(pcie->reg); + + of_property_read_u32(node, "linux,pci-domain", &pcie->domain); + + pcie->cfg = syscon_regmap_lookup_by_phandle(dev->of_node, "aspeed,pciecfg"); + if (IS_ERR(pcie->cfg)) + return dev_err_probe(dev, PTR_ERR(pcie->cfg), "Failed to map pciecfg base\n"); + + pcie->h2xrst = devm_reset_control_get_exclusive(dev, "h2x"); + if (IS_ERR(pcie->h2xrst)) + return dev_err_probe(dev, PTR_ERR(pcie->h2xrst), "Failed to get h2x reset\n"); + + ret = devm_mutex_init(dev, &pcie->lock); + if (ret) + return dev_err_probe(dev, ret, "Failed to init mutex\n"); + + ret = pcie->platform->setup(pdev); + if (ret) + return dev_err_probe(dev, ret, "Failed to setup PCIe RC\n"); + + ret = aspeed_pcie_parse_dt(pcie); + if (ret) + return ret; + + ret = aspeed_pcie_init_ports(pcie); + if (ret) + goto err_remove_resets; + + host->sysdata = pcie; + + ret = aspeed_pcie_init_irq_domain(pcie); + if (ret) + goto err_irq_init; + + irq = platform_get_irq(pdev, 0); + if (irq < 0) { + ret = irq; + goto err_irq; + } + + ret = devm_request_irq(dev, irq, aspeed_pcie_intr_handler, IRQF_SHARED, dev_name(dev), + pcie); + if (ret) + goto err_irq; + + ret = pci_host_probe(host); + if (ret) + goto err_irq; + + return 0; +err_irq: + aspeed_pcie_irq_domain_free(pcie); +err_irq_init: +err_remove_resets: + list_for_each_entry(port, &pcie->ports, list) + reset_control_put(port->perst); + dev_err_probe(dev, ret, "Failed to initial RC\n"); + return ret; +} + +const struct aspeed_pcie_rc_platform pcie_rc_ast2600 = { + .setup = aspeed_ast2600_setup, + .get_link = aspeed_ast2600_get_link, + .port_init = aspeed_ast2600_port_init, + .reg_intx_en = 0x04, + .reg_intx_sts = 0x08, + .reg_msi_en = 0x20, + .reg_msi_sts = 0x28, + .msi_address = 0x1e77005c, +}; + +const struct aspeed_pcie_rc_platform pcie_rc_ast2700 = { + .setup = aspeed_ast2700_setup, + .get_link = aspeed_ast2700_get_link, + .port_init = aspeed_ast2700_port_init, + .reg_intx_en = 0x40, + .reg_intx_sts = 0x48, + .reg_msi_en = 0x50, + .reg_msi_sts = 0x58, + .msi_address = 0x000000F0, +}; + +static const struct of_device_id aspeed_pcie_of_match[] = { + { .compatible = "aspeed,ast2600-pcie", .data = &pcie_rc_ast2600 }, + { .compatible = "aspeed,ast2700-pcie", .data = &pcie_rc_ast2700 }, + {} +}; + +static struct platform_driver aspeed_pcie_driver = { + .driver = { + .name = "aspeed-pcie", + .of_match_table = aspeed_pcie_of_match, + }, + .probe = aspeed_pcie_probe, +}; + +module_platform_driver(aspeed_pcie_driver); + +MODULE_AUTHOR("Jacky Chou "); +MODULE_DESCRIPTION("ASPEED PCIe Root Complex"); +MODULE_LICENSE("GPL"); -- 2.43.0 From jacky_chou at aspeedtech.com Tue Jul 15 13:43:20 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Tue, 15 Jul 2025 11:43:20 +0800 Subject: [PATCH v2 10/10] MAINTAINERS: Add ASPEED PCIe RC driver In-Reply-To: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> Message-ID: <20250715034320.2553837-11-jacky_chou@aspeedtech.com> Add maintainer for ASPEED PCIe RC driver. Signed-off-by: Jacky Chou --- MAINTAINERS | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 3ecb44458a7e..e1839dc240bc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3696,6 +3696,16 @@ S: Maintained F: Documentation/devicetree/bindings/media/aspeed,video-engine.yaml F: drivers/media/platform/aspeed/ +ASPEED PCIE CONTROLLER DRIVER +M: Jacky Chou +L: linux-aspeed at lists.ozlabs.org (moderated for non-subscribers) +L: linux-pci at vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/pci/aspeed,ast2600-pcie.yaml +F: Documentation/devicetree/bindings/soc/aspeed/aspeed,pcie-cfg.yaml +F: Documentation/devicetree/bindings/soc/aspeed/aspeed,pcie-phy.yaml +F: drivers/pci/controller/pcie-aspeed.c + ASUS EC HARDWARE MONITOR DRIVER M: Eugene Shalygin L: linux-hwmon at vger.kernel.org -- 2.43.0 From jacky_chou at aspeedtech.com Tue Jul 15 13:43:14 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Tue, 15 Jul 2025 11:43:14 +0800 Subject: [PATCH v2 04/10] dt-bindings: pinctrl: aspeed,ast2600-pinctrl: Add PCIe RC PERST# group In-Reply-To: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> Message-ID: <20250715034320.2553837-5-jacky_chou@aspeedtech.com> Add PCIe PERST# group to support for PCIe RC. Signed-off-by: Jacky Chou --- .../devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yaml index 80974c46f3ef..5d7fbb1c72b7 100644 --- a/Documentation/devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yaml +++ b/Documentation/devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yaml @@ -254,6 +254,7 @@ additionalProperties: - WDTRST2 - WDTRST3 - WDTRST4 + - PCIERC1 groups: enum: @@ -497,6 +498,7 @@ additionalProperties: - WDTRST2 - WDTRST3 - WDTRST4 + - PCIERC1 pins: true bias-disable: true -- 2.43.0 From jacky_chou at aspeedtech.com Tue Jul 15 13:43:13 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Tue, 15 Jul 2025 11:43:13 +0800 Subject: [PATCH v2 03/10] dt-bindings: PCI: Add ASPEED PCIe RC support In-Reply-To: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> Message-ID: <20250715034320.2553837-4-jacky_chou@aspeedtech.com> This binding describes the required and optional properties for configuring the PCIe RC node, including support for syscon phandles, MSI, clocks, resets, and interrupt mapping. The schema enforces strict property validation and provides a comprehensive example for reference. Signed-off-by: Jacky Chou --- .../bindings/pci/aspeed,ast2600-pcie.yaml | 198 ++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 Documentation/devicetree/bindings/pci/aspeed,ast2600-pcie.yaml diff --git a/Documentation/devicetree/bindings/pci/aspeed,ast2600-pcie.yaml b/Documentation/devicetree/bindings/pci/aspeed,ast2600-pcie.yaml new file mode 100644 index 000000000000..6fb6cf59c230 --- /dev/null +++ b/Documentation/devicetree/bindings/pci/aspeed,ast2600-pcie.yaml @@ -0,0 +1,198 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/pci/aspeed,ast2600-pcie.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ASPEED PCIe Root Complex Controller + +maintainers: + - Jacky Chou + +description: + The ASPEED PCIe Root Complex controller provides PCI Express Root Complex + functionality for ASPEED SoCs, such as the AST2600 and AST2700. + This controller enables connectivity to PCIe endpoint devices, supporting + memory and I/O windows, MSI and legacy interrupts, and integration with + the SoC's clock, reset, and pinctrl subsystems. + +properties: + compatible: + enum: + - aspeed,ast2600-pcie + - aspeed,ast2700-pcie + + reg: + maxItems: 1 + + ranges: + minItems: 2 + maxItems: 2 + + interrupts: + maxItems: 1 + description: IntX and MSI interrupt + + resets: + items: + - description: PCIe controller reset + + reset-names: + items: + - const: h2x + + msi-parent: true + + aspeed,ahbc: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the ASPEED AHB Controller (AHBC) syscon node. + This reference is used by the PCIe controller to access + system-level configuration registers related to the AHB bus. + To enable AHB access for the PCIe controller. + + aspeed,pciecfg: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the ASPEED PCIe configuration syscon node. + This reference allows the PCIe controller to access + SoC-specific PCIe configuration registers. There are the others + functions such PCIe RC and PCIe EP will use this common register + to configure the SoC interfaces. + + aspeed,pciephy: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the ASPEED PCIe PHY syscon node. + This property provides access to the PCIe PHY control + registers required for link initialization and management. + The other functions such PCIe RC and PCIe EP will use this + common register to configure the PHY interfaces and get some + information from the PHY. + + interrupt-controller: + description: Interrupt controller node for handling legacy PCI interrupts. + type: object + properties: + '#address-cells': + const: 0 + '#interrupt-cells': + const: 1 + interrupt-controller: true + + required: + - '#address-cells' + - '#interrupt-cells' + - interrupt-controller + + additionalProperties: false + +allOf: + - $ref: /schemas/pci/pci-bus-common.yaml# + - $ref: /schemas/pci/pci-host-bridge.yaml# + - $ref: /schemas/interrupt-controller/msi-controller.yaml# + - if: + properties: + compatible: + contains: + const: aspeed,ast2600-pcie + then: + required: + - aspeed,ahbc + else: + properties: + aspeed,ahbc: false + +required: + - reg + - interrupts + - bus-range + - ranges + - resets + - reset-names + - msi-parent + - msi-controller + - aspeed,pciecfg + - interrupt-map-mask + - interrupt-map + - interrupt-controller + +unevaluatedProperties: false + +patternProperties: + "^pcie@[0-9a-f,]+$": + type: object + properties: + resets: + items: + - description: PCIe PERST + reset-names: + items: + - const: perst + clocks: + maxItems: 1 + description: PCIe BUS clock + required: + - resets + - reset-names + - clocks + - aspeed,pciephy + +examples: + - | + #include + #include + + apb { + #address-cells = <1>; + #size-cells = <1>; + + pcie0: pcie at 1e7700c0 { + compatible = "aspeed,ast2600-pcie"; + device_type = "pci"; + reg = <0x1e7700c0 0x40>; + linux,pci-domain = <0>; + #address-cells = <3>; + #size-cells = <2>; + interrupts = ; + bus-range = <0x80 0xff>; + + ranges = <0x01000000 0x0 0x00018000 0x00018000 0x0 0x00008000 + 0x02000000 0x0 0x70000000 0x70000000 0x0 0x10000000>; + + resets = <&syscon ASPEED_RESET_H2X>; + reset-names = "h2x"; + + #interrupt-cells = <1>; + msi-parent = <&pcie0>; + msi-controller; + + aspeed,ahbc = <&ahbc>; + aspeed,pciecfg = <&pcie_cfg>; + + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc0 0>, + <0 0 0 2 &pcie_intc0 1>, + <0 0 0 3 &pcie_intc0 2>, + <0 0 0 4 &pcie_intc0 3>; + pcie_intc0: interrupt-controller { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + }; + + pcie at 8,0 { + reg = <0x804000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + resets = <&syscon ASPEED_RESET_PCIE_RC_O>; + reset-names = "perst"; + clocks = <&syscon ASPEED_CLK_GATE_BCLK>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pcierc1_default>; + aspeed,pciephy = <&pcie_phy1>; + ranges; + }; + }; + }; -- 2.43.0 From jacky_chou at aspeedtech.com Tue Jul 15 13:43:16 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Tue, 15 Jul 2025 11:43:16 +0800 Subject: [PATCH v2 06/10] ARM: dts: aspeed-g6: Add PCIe RC node In-Reply-To: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> Message-ID: <20250715034320.2553837-7-jacky_chou@aspeedtech.com> The AST2600 has one PCIe RC, and add the relative configure regmap. Signed-off-by: Jacky Chou --- arch/arm/boot/dts/aspeed/aspeed-g6.dtsi | 61 +++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi b/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi index 8ed715bd53aa..ed99780b6860 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi +++ b/arch/arm/boot/dts/aspeed/aspeed-g6.dtsi @@ -379,6 +379,67 @@ rng: hwrng at 1e6e2524 { quality = <100>; }; + pcie_phy1: syscon at 1e6ed200 { + compatible = "aspeed,pcie-phy", "syscon"; + reg = <0x1e6ed200 0x100>; + }; + + pcie_cfg: syscon at 1e770000 { + compatible = "aspeed,pcie-cfg", "syscon"; + reg = <0x1e770000 0x80>; + }; + + pcie0: pcie at 1e7700c0 { + compatible = "aspeed,ast2600-pcie"; + device_type = "pci"; + reg = <0x1e7700c0 0x40>; + linux,pci-domain = <0>; + #address-cells = <3>; + #size-cells = <2>; + interrupts = ; + bus-range = <0x80 0xff>; + + ranges = <0x01000000 0x0 0x00018000 0x00018000 0x0 0x00008000 + 0x02000000 0x0 0x70000000 0x70000000 0x0 0x10000000>; + + status = "disabled"; + + resets = <&syscon ASPEED_RESET_H2X>; + reset-names = "h2x"; + + #interrupt-cells = <1>; + msi-parent = <&pcie0>; + msi-controller; + + aspeed,ahbc = <&ahbc>; + aspeed,pciecfg = <&pcie_cfg>; + + interrupt-map-mask = <0 0 0 7>; + interrupt-map = <0 0 0 1 &pcie_intc0 0>, + <0 0 0 2 &pcie_intc0 1>, + <0 0 0 3 &pcie_intc0 2>, + <0 0 0 4 &pcie_intc0 3>; + pcie_intc0: interrupt-controller { + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <1>; + }; + + pcie at 8,0 { + reg = <0x804000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + device_type = "pci"; + resets = <&syscon ASPEED_RESET_PCIE_RC_O>; + reset-names = "perst"; + clocks = <&syscon ASPEED_CLK_GATE_BCLK>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pcierc1_default>; + aspeed,pciephy = <&pcie_phy1>; + ranges; + }; + }; + gfx: display at 1e6e6000 { compatible = "aspeed,ast2600-gfx", "syscon"; reg = <0x1e6e6000 0x1000>; -- 2.43.0 From jacky_chou at aspeedtech.com Tue Jul 15 13:43:15 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Tue, 15 Jul 2025 11:43:15 +0800 Subject: [PATCH v2 05/10] ARM: dts: aspeed-g6: Add AST2600 PCIe RC PERST# In-Reply-To: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> Message-ID: <20250715034320.2553837-6-jacky_chou@aspeedtech.com> Add pinctrl support for PCIe RC PERST#. Signed-off-by: Jacky Chou --- arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi b/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi index 289668f051eb..ea879f086c25 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi +++ b/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi @@ -2,6 +2,11 @@ // Copyright 2019 IBM Corp. &pinctrl { + pinctrl_pcierc1_default: pcierc1-default { + function = "PCIERC1"; + groups = "PCIERC1"; + }; + pinctrl_adc0_default: adc0_default { function = "ADC0"; groups = "ADC0"; -- 2.43.0 From jacky_chou at aspeedtech.com Tue Jul 15 13:43:11 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Tue, 15 Jul 2025 11:43:11 +0800 Subject: [PATCH v2 01/10] dt-bindings: soc: aspeed: Add ASPEED PCIe Config support In-Reply-To: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> Message-ID: <20250715034320.2553837-2-jacky_chou@aspeedtech.com> Add the ASPEED PCIe configuration syscon block. This shared register space is used by multiple PCIe-related devices to coordinate and manage common PCIe settings. The binding describes the required compatible strings and register space for the configuration node. Signed-off-by: Jacky Chou --- .../bindings/soc/aspeed/aspeed,pcie-cfg.yaml | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/aspeed/aspeed,pcie-cfg.yaml diff --git a/Documentation/devicetree/bindings/soc/aspeed/aspeed,pcie-cfg.yaml b/Documentation/devicetree/bindings/soc/aspeed/aspeed,pcie-cfg.yaml new file mode 100644 index 000000000000..6b282f06b914 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/aspeed/aspeed,pcie-cfg.yaml @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/aspeed/aspeed,pcie-cfg.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ASPEED PCIe Configuration + +maintainers: + - Jacky Chou + +description: | + The ASPEED PCIe configuration syscon block provides a set of registers shared + by multiple PCIe-related devices within the SoC. This node represents the + common configuration space that allows these devices to coordinate and manage + shared PCIe settings, including address mapping, control, and status + registers. The syscon interface enables for various PCIe devices to access + and modify these shared registers in a consistent and centralized manner. + +properties: + compatible: + items: + - enum: + - aspeed,pcie-cfg + - const: syscon + + reg: + maxItems: 1 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + syscon at 1e770000 { + compatible = "aspeed,pcie-cfg", "syscon"; + reg = <0x1e770000 0x80>; + }; -- 2.43.0 From jacky_chou at aspeedtech.com Tue Jul 15 13:43:10 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Tue, 15 Jul 2025 11:43:10 +0800 Subject: [PATCH v2 00/10] Add ASPEED PCIe Root Complex support Message-ID: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> This patch series adds support for the ASPEED PCIe Root Complex, including device tree bindings, pinctrl support, and the PCIe host controller driver. The patches introduce the necessary device tree nodes, pinmux groups, and driver implementation to enable PCIe functionality on ASPEED platforms. Currently, the ASPEED PCIe Root Complex only supports a single port. Summary of changes: - Add device tree binding documents for ASPEED PCIe PHY, PCIe Config, and PCIe RC - Update MAINTAINERS for new bindings and driver - Add PCIe RC node and PERST control pin to aspeed-g6 device tree - Add PCIe RC PERST pin group to aspeed-g6 pinctrl - Implement ASPEED PCIe Root Complex host controller driver This series has been tested on AST2600/AST2700 platforms and enables PCIe device enumeration and operation. Jacky Chou (10): dt-bindings: soc: aspeed: Add ASPEED PCIe Config support dt-bindings: soc: aspeed: Add ASPEED PCIe PHY support dt-bindings: PCI: Add ASPEED PCIe RC support dt-bindings: pinctrl: aspeed,ast2600-pinctrl: Add PCIe RC PERST# group ARM: dts: aspeed-g6: Add AST2600 PCIe RC PERST# ARM: dts: aspeed-g6: Add PCIe RC node pinctrl: aspeed-g6: Add PCIe RC PERST pin group PCI: Add FMT and TYPE definition for TLP header PCI: aspeed: Add ASPEED PCIe RC driver MAINTAINERS: Add ASPEED PCIe RC driver .../bindings/pci/aspeed,ast2600-pcie.yaml | 198 +++ .../pinctrl/aspeed,ast2600-pinctrl.yaml | 2 + .../bindings/soc/aspeed/aspeed,pcie-cfg.yaml | 41 + .../bindings/soc/aspeed/aspeed,pcie-phy.yaml | 44 + MAINTAINERS | 10 + .../boot/dts/aspeed/aspeed-g6-pinctrl.dtsi | 5 + arch/arm/boot/dts/aspeed/aspeed-g6.dtsi | 61 + drivers/pci/controller/Kconfig | 13 + drivers/pci/controller/Makefile | 1 + drivers/pci/controller/pcie-aspeed.c | 1137 +++++++++++++++++ drivers/pinctrl/aspeed/pinctrl-aspeed-g6.c | 12 +- include/uapi/linux/pci_regs.h | 32 + 12 files changed, 1555 insertions(+), 1 deletion(-) create mode 100644 Documentation/devicetree/bindings/pci/aspeed,ast2600-pcie.yaml create mode 100644 Documentation/devicetree/bindings/soc/aspeed/aspeed,pcie-cfg.yaml create mode 100644 Documentation/devicetree/bindings/soc/aspeed/aspeed,pcie-phy.yaml create mode 100644 drivers/pci/controller/pcie-aspeed.c --- v2: - Moved ASPEED PCIe PHY yaml binding to `soc/aspeed` directory and changed it as syscon - Added `MAINTAINERS` entry for the new PCIe RC driver - Updated device tree bindings to reflect the new structure - Refactored configuration read and write functions to main bus and child bus ops - Refactored initialization to implement multiple ports support - Added PCIe FMT and TYPE definitions for TLP header in `include/uapi/linux/pci_regs.h` - Updated from reviewer comments --- -- 2.43.0 From jacky_chou at aspeedtech.com Tue Jul 15 13:43:12 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Tue, 15 Jul 2025 11:43:12 +0800 Subject: [PATCH v2 02/10] dt-bindings: soc: aspeed: Add ASPEED PCIe PHY support In-Reply-To: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> Message-ID: <20250715034320.2553837-3-jacky_chou@aspeedtech.com> This PHY is used by many modules. In our design, our PCIe has RC and EP funcitons. On the different function, each driver will use configure and get some information from the PHY interface to do somting that it wants to. Getting link status, setting syscon credits and so on. Therefore, define it as syscon for all modules. Signed-off-by: Jacky Chou --- .../bindings/soc/aspeed/aspeed,pcie-phy.yaml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Documentation/devicetree/bindings/soc/aspeed/aspeed,pcie-phy.yaml diff --git a/Documentation/devicetree/bindings/soc/aspeed/aspeed,pcie-phy.yaml b/Documentation/devicetree/bindings/soc/aspeed/aspeed,pcie-phy.yaml new file mode 100644 index 000000000000..5fa585d63ca6 --- /dev/null +++ b/Documentation/devicetree/bindings/soc/aspeed/aspeed,pcie-phy.yaml @@ -0,0 +1,44 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/soc/aspeed/aspeed,pcie-phy.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ASPEED PCIe PHY + +maintainers: + - Jacky Chou + +description: + The ASPEED PCIe PHY provides the physical layer interface for PCIe + controllers in the SoC. This node represents the register block for the PCIe + PHY, which is typically accessed by PCIe Root Complex or Endpoint drivers + via syscon. It is used to configure and get the status of the PCIe PHY + hardware, including power management, link training, and other PHY-specific + operations. + +properties: + compatible: + items: + - enum: + - aspeed,pcie-phy + - const: syscon + + reg: + maxItems: 1 + + "#phy-cells": + const: 0 + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + syscon at 1e6ed200 { + compatible = "aspeed,pcie-phy", "syscon"; + reg = <0x1e6ed200 0x100>; + }; -- 2.43.0 From krzk at kernel.org Wed Jul 16 18:21:42 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Wed, 16 Jul 2025 10:21:42 +0200 Subject: [PATCH v2] dt-bindings: interrupt-controller: aspeed: Add parent node compatibles and refine documentation In-Reply-To: <20250715024258.2304665-1-ryan_chen@aspeedtech.com> References: <20250715024258.2304665-1-ryan_chen@aspeedtech.com> Message-ID: <20250716-spotted-spirited-axolotl-c94e0b@krzk-bin> On Tue, Jul 15, 2025 at 10:42:58AM +0800, Ryan Chen wrote: > - Add 'aspeed,ast2700-intc0' and 'aspeed,ast2700-intc1' compatible > strings for parent interrupt controller nodes, in addition to the > existing 'aspeed,ast2700-intc-ic' for child nodes. > - Clarify the relationship and function of INTC0, INTC1, and the GIC. > - Update and clarify documentation, block diagram, and examples > to reflect the hierarchy and compatible usage. > - Documentation and example refine. So 7 lines describing obvious - what you did and three lines below describing non-obvious, why you did it. It should be reversed. > > This change allows the device tree and driver to distinguish between Why driver needs would matter here? > parent (top-level) and child (group) interrupt controller nodes, > enabling more precise driver matching SOC register space allocation. This just does not make sense. You do not change "precise driver matching" via bindings. You fix driver. Especially that there is no driver patch here at all and aspeed,ast2700-intc0 are totally unused! Don't add ABI which has no users. Again, you need to start describing the hardware and the REASONS BEHIND from the hardware point of view. Not drivers. This change alone based on above explanation makes no sense at all. Best regards, Krzysztof From krzk at kernel.org Wed Jul 16 18:23:36 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Wed, 16 Jul 2025 10:23:36 +0200 Subject: [PATCH v2 02/10] dt-bindings: soc: aspeed: Add ASPEED PCIe PHY support In-Reply-To: <20250715034320.2553837-3-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> <20250715034320.2553837-3-jacky_chou@aspeedtech.com> Message-ID: <20250716-innocent-satisfied-pug-9ecc15@krzk-bin> On Tue, Jul 15, 2025 at 11:43:12AM +0800, Jacky Chou wrote: > This PHY is used by many modules. In our design, our > PCIe has RC and EP funcitons. On the different function, > each driver will use configure and get some information > from the PHY interface to do somting that it wants to. > Getting link status, setting syscon credits and so on. > Therefore, define it as syscon for all modules. > > Signed-off-by: Jacky Chou > --- > .../bindings/soc/aspeed/aspeed,pcie-phy.yaml | 44 +++++++++++++++++++ > 1 file changed, 44 insertions(+) > create mode 100644 Documentation/devicetree/bindings/soc/aspeed/aspeed,pcie-phy.yaml Phys go to phy, not soc directory. Soc is not a dumping ground. > > diff --git a/Documentation/devicetree/bindings/soc/aspeed/aspeed,pcie-phy.yaml b/Documentation/devicetree/bindings/soc/aspeed/aspeed,pcie-phy.yaml > new file mode 100644 > index 000000000000..5fa585d63ca6 > --- /dev/null > +++ b/Documentation/devicetree/bindings/soc/aspeed/aspeed,pcie-phy.yaml > @@ -0,0 +1,44 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/soc/aspeed/aspeed,pcie-phy.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: ASPEED PCIe PHY > + > +maintainers: > + - Jacky Chou > + > +description: > + The ASPEED PCIe PHY provides the physical layer interface for PCIe > + controllers in the SoC. This node represents the register block for the PCIe > + PHY, which is typically accessed by PCIe Root Complex or Endpoint drivers > + via syscon. It is used to configure and get the status of the PCIe PHY > + hardware, including power management, link training, and other PHY-specific > + operations. > + > +properties: > + compatible: > + items: > + - enum: > + - aspeed,pcie-phy No, see writing bindings. > + - const: syscon It's not a syscon, but phy. I don't think you understood previous feedback. Go back to v1. You just send something to pass the review instead of reworking to make it correct. > + > + reg: > + maxItems: 1 > + > + "#phy-cells": > + const: 0 > + > +required: > + - compatible > + - reg > + > +additionalProperties: false > + > +examples: > + - | > + syscon at 1e6ed200 { wrong name, that's a phy > + compatible = "aspeed,pcie-phy", "syscon"; > + reg = <0x1e6ed200 0x100>; Incomplete > + }; > -- > 2.43.0 > From krzk at kernel.org Wed Jul 16 18:24:27 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Wed, 16 Jul 2025 10:24:27 +0200 Subject: [PATCH v2 01/10] dt-bindings: soc: aspeed: Add ASPEED PCIe Config support In-Reply-To: <20250715034320.2553837-2-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> <20250715034320.2553837-2-jacky_chou@aspeedtech.com> Message-ID: <20250716-wine-partridge-of-wonder-af10a6@krzk-bin> On Tue, Jul 15, 2025 at 11:43:11AM +0800, Jacky Chou wrote: > +maintainers: > + - Jacky Chou > + > +description: | Drop | > + The ASPEED PCIe configuration syscon block provides a set of registers shared > + by multiple PCIe-related devices within the SoC. This node represents the > + common configuration space that allows these devices to coordinate and manage > + shared PCIe settings, including address mapping, control, and status > + registers. The syscon interface enables for various PCIe devices to access > + and modify these shared registers in a consistent and centralized manner. > + > +properties: > + compatible: > + items: > + - enum: > + - aspeed,pcie-cfg NAK, see writing bindings. You already received comments about generic compatible in the past. Best regards, Krzysztof From krzk at kernel.org Wed Jul 16 18:27:16 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Wed, 16 Jul 2025 10:27:16 +0200 Subject: [PATCH v2 03/10] dt-bindings: PCI: Add ASPEED PCIe RC support In-Reply-To: <20250715034320.2553837-4-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> <20250715034320.2553837-4-jacky_chou@aspeedtech.com> Message-ID: <20250716-watchful-enigmatic-condor-0fc6b3@krzk-bin> On Tue, Jul 15, 2025 at 11:43:13AM +0800, Jacky Chou wrote: > This binding describes the required and optional properties for No, describe the hardware, not "this binding". > configuring the PCIe RC node, including support for syscon phandles, > MSI, clocks, resets, and interrupt mapping. The schema enforces strict > property validation and provides a comprehensive example for reference. Don't say what schema does or does not. It's completely redundant. Describe the hardware. Your entire commit is redundantn and not helpful at all. > ... > + > + aspeed,ahbc: > + $ref: /schemas/types.yaml#/definitions/phandle > + description: > + Phandle to the ASPEED AHB Controller (AHBC) syscon node. > + This reference is used by the PCIe controller to access > + system-level configuration registers related to the AHB bus. > + To enable AHB access for the PCIe controller. > + > + aspeed,pciecfg: > + $ref: /schemas/types.yaml#/definitions/phandle > + description: > + Phandle to the ASPEED PCIe configuration syscon node. > + This reference allows the PCIe controller to access > + SoC-specific PCIe configuration registers. There are the others > + functions such PCIe RC and PCIe EP will use this common register > + to configure the SoC interfaces. > + > + aspeed,pciephy: No, phys are not syscons. I already told you that in v1. > + $ref: /schemas/types.yaml#/definitions/phandle > + description: > + Phandle to the ASPEED PCIe PHY syscon node. > + This property provides access to the PCIe PHY control > + registers required for link initialization and management. > + The other functions such PCIe RC and PCIe EP will use this > + common register to configure the PHY interfaces and get some > + information from the PHY. > + > + interrupt-controller: > + description: Interrupt controller node for handling legacy PCI interrupts. > + type: object > + properties: > + '#address-cells': > + const: 0 > + '#interrupt-cells': > + const: 1 > + interrupt-controller: true > + > + required: > + - '#address-cells' > + - '#interrupt-cells' > + - interrupt-controller > + > + additionalProperties: false > + > +allOf: > + - $ref: /schemas/pci/pci-bus-common.yaml# No other binding references this. Don't write completely different code than all other SoCs. This entire binding is written such way. > + - $ref: /schemas/pci/pci-host-bridge.yaml# > + - $ref: /schemas/interrupt-controller/msi-controller.yaml# > + - if: > + properties: > + compatible: > + contains: > + const: aspeed,ast2600-pcie > + then: > + required: > + - aspeed,ahbc > + else: > + properties: > + aspeed,ahbc: false > + > +required: > + - reg > + - interrupts > + - bus-range > + - ranges > + - resets > + - reset-names > + - msi-parent > + - msi-controller > + - aspeed,pciecfg > + - interrupt-map-mask > + - interrupt-map > + - interrupt-controller > + > +unevaluatedProperties: false > + > +patternProperties: > + "^pcie@[0-9a-f,]+$": Why do you need it? Also, order things according to example schema. Best regards, Krzysztof From krzk at kernel.org Wed Jul 16 18:27:56 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Wed, 16 Jul 2025 10:27:56 +0200 Subject: [PATCH v2 04/10] dt-bindings: pinctrl: aspeed,ast2600-pinctrl: Add PCIe RC PERST# group In-Reply-To: <20250715034320.2553837-5-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> <20250715034320.2553837-5-jacky_chou@aspeedtech.com> Message-ID: <20250716-provocative-worm-of-gallantry-3797f8@krzk-bin> On Tue, Jul 15, 2025 at 11:43:14AM +0800, Jacky Chou wrote: > Add PCIe PERST# group to support for PCIe RC. > > Signed-off-by: Jacky Chou > --- > .../devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yaml | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/Documentation/devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yaml > index 80974c46f3ef..5d7fbb1c72b7 100644 > --- a/Documentation/devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yaml > +++ b/Documentation/devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yaml > @@ -254,6 +254,7 @@ additionalProperties: > - WDTRST2 > - WDTRST3 > - WDTRST4 > + - PCIERC1 What feedback Aspeed received about ordering lists? More than once? Best regards, Krzysztof From krzk at kernel.org Wed Jul 16 19:48:27 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Wed, 16 Jul 2025 11:48:27 +0200 Subject: [PATCH v9 1/2] dt-bindings: arm: aspeed: add Meta Ventura board In-Reply-To: <20250716094329.1069203-2-pkleequanta@gmail.com> References: <20250716094329.1069203-1-pkleequanta@gmail.com> <20250716094329.1069203-2-pkleequanta@gmail.com> Message-ID: <6077ec05-87f3-4bd2-904d-db9b451d2490@kernel.org> On 16/07/2025 11:43, P.K. Lee wrote: > Document the new compatibles used on Meta Ventura. > > Signed-off-by: P.K. Lee > --- > Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + > 1 file changed, 1 insertion(+) Acked-by: Krzysztof Kozlowski ---
This is an automated instruction, just in case, because many review tags are being ignored. If you know the process, you can skip it (please do not feel offended by me posting it here - no bad intentions intended). If you do not know the process, here is a short explanation: Please add Acked-by/Reviewed-by/Tested-by tags when posting new versions of patchset, under or above your Signed-off-by tag, unless patch changed significantly (e.g. new properties added to the DT bindings). Tag is "received", when provided in a message replied to you on the mailing list. Tools like b4 can help here. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for tags received on the version they apply. Full context and explanation: https://elixir.bootlin.com/linux/v6.12-rc3/source/Documentation/process/submitting-patches.rst#L577
Best regards, Krzysztof From andrew at lunn.ch Thu Jul 17 06:03:44 2025 From: andrew at lunn.ch (Andrew Lunn) Date: Wed, 16 Jul 2025 22:03:44 +0200 Subject: [PATCH v2 4/4] ARM: dts: aspeed: nvidia: gb200nvl: Enable MAC0 for BMC network In-Reply-To: <20250716-update-gb200nvl-dts-for-new-hardware-v2-4-9a1a916f461d@nvidia.com> References: <20250716-update-gb200nvl-dts-for-new-hardware-v2-0-9a1a916f461d@nvidia.com> <20250716-update-gb200nvl-dts-for-new-hardware-v2-4-9a1a916f461d@nvidia.com> Message-ID: <17cd5195-29d7-44db-8f3c-474dc5c3486b@lunn.ch> > +&mac0 { > + status = "okay"; > + pinctrl-names = "default"; > + phy-mode = "rgmii-id"; > + max-speed = <1000>; The MAC is using rgmii. How can it do more than 1G? Andrew From wthai at nvidia.com Thu Jul 17 04:21:58 2025 From: wthai at nvidia.com (Willie Thai) Date: Wed, 16 Jul 2025 18:21:58 +0000 Subject: [PATCH v2 4/4] ARM: dts: aspeed: nvidia: gb200nvl: Enable MAC0 for BMC network In-Reply-To: <20250716-update-gb200nvl-dts-for-new-hardware-v2-0-9a1a916f461d@nvidia.com> References: <20250716-update-gb200nvl-dts-for-new-hardware-v2-0-9a1a916f461d@nvidia.com> Message-ID: <20250716-update-gb200nvl-dts-for-new-hardware-v2-4-9a1a916f461d@nvidia.com> Upstream-Status: Inappropriate Bad devices Signed-off-by: Deepak Kodihalli Signed-off-by: Ed Tanous Signed-off-by: Willie Thai --- .../dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts index dd2a02a6d1d40cd3fe99af83123a7a3a67149a69..7ce4f5fedc6f45960d45108c62f2039f65811b76 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts @@ -227,6 +227,31 @@ &uart_routing { status = "okay"; }; +&mdio0 { + status = "okay"; + ethphy0: ethernet-phy at 0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + }; +}; + +&mdio3 { + status = "okay"; + ethphy3: ethernet-phy at 2 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <2>; + }; +}; + +&mac0 { + status = "okay"; + pinctrl-names = "default"; + phy-mode = "rgmii-id"; + max-speed = <1000>; + phy-handle = <ðphy3>; + pinctrl-0 = <&pinctrl_rgmii1_default>; +}; + &mac2 { status = "okay"; phy-mode = "rmii"; -- 2.25.1 From wthai at nvidia.com Thu Jul 17 04:21:55 2025 From: wthai at nvidia.com (Willie Thai) Date: Wed, 16 Jul 2025 18:21:55 +0000 Subject: [PATCH v2 1/4] ARM: dts: aspeed: nvidia: gb200nvl: Add VCC Supply In-Reply-To: <20250716-update-gb200nvl-dts-for-new-hardware-v2-0-9a1a916f461d@nvidia.com> References: <20250716-update-gb200nvl-dts-for-new-hardware-v2-0-9a1a916f461d@nvidia.com> Message-ID: <20250716-update-gb200nvl-dts-for-new-hardware-v2-1-9a1a916f461d@nvidia.com> Add Vcc supply to avoid probing the devices before they have power. Signed-off-by: Deepak Kodihalli Signed-off-by: Ed Tanous Signed-off-by: Willie Thai --- Changes v1 -> v2: - Fix unevaluated vcc-supply properties [Rob Herring] --- --- .../dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts index 41e3e9dd85f571254a08d40e68c0d8f8f049256b..bd9395a194137ea70d184665ad6cb659541ef175 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts @@ -126,6 +126,17 @@ button-uid { gpio = <&sgpiom0 154 GPIO_ACTIVE_LOW>; }; }; + + standby_power_regulator: standby-power-regulator { + status = "okay"; + compatible = "regulator-fixed"; + regulator-name = "standby_power"; + gpio = <&gpio0 ASPEED_GPIO(M, 3) GPIO_ACTIVE_HIGH>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + enable-active-high; + regulator-always-on; + }; }; // Enable Primary flash on FMC for bring up activity @@ -431,6 +442,7 @@ exp4: gpio at 21 { #interrupt-cells = <2>; interrupt-parent = <&gpio1>; interrupts = ; + vcc-supply = <&standby_power_regulator>; gpio-line-names = "RTC_MUX_SEL-O", "PCI_MUX_SEL-O", @@ -464,6 +476,7 @@ i2c-mux at 71 { #size-cells = <0>; reg = <0x71>; i2c-mux-idle-disconnect; + vdd-supply = <&standby_power_regulator>; imux16: i2c at 0 { #address-cells = <1>; @@ -528,6 +541,7 @@ i2c-mux at 72 { #size-cells = <0>; reg = <0x72>; i2c-mux-idle-disconnect; + vdd-supply = <&standby_power_regulator>; imux20: i2c at 0 { #address-cells = <1>; @@ -545,6 +559,7 @@ gpio at 21 { reg = <0x21>; gpio-controller; #gpio-cells = <2>; + vcc-supply = <&standby_power_regulator>; gpio-line-names = "RST_CX_0_L-O", "RST_CX_1_L-O", @@ -584,6 +599,7 @@ i2c-mux at 73 { #size-cells = <0>; reg = <0x73>; i2c-mux-idle-disconnect; + vdd-supply = <&standby_power_regulator>; imux24: i2c at 0 { #address-cells = <1>; @@ -602,6 +618,7 @@ i2c-mux at 70 { #size-cells = <0>; reg = <0x70>; i2c-mux-idle-disconnect; + vdd-supply = <&standby_power_regulator>; i2c25mux0: i2c at 0 { #address-cells = <1>; @@ -648,6 +665,7 @@ i2c-mux at 75 { #size-cells = <0>; reg = <0x75>; i2c-mux-idle-disconnect; + vdd-supply = <&standby_power_regulator>; imux28: i2c at 0 { #address-cells = <1>; @@ -712,6 +730,7 @@ i2c-mux at 76 { #size-cells = <0>; reg = <0x76>; i2c-mux-idle-disconnect; + vdd-supply = <&standby_power_regulator>; imux32: i2c at 0 { #address-cells = <1>; @@ -729,6 +748,7 @@ gpio at 21 { reg = <0x21>; gpio-controller; #gpio-cells = <2>; + vcc-supply = <&standby_power_regulator>; gpio-line-names = "SEC_RST_CX_0_L-O", "SEC_RST_CX_1_L-O", @@ -768,6 +788,7 @@ i2c-mux at 77 { #size-cells = <0>; reg = <0x77>; i2c-mux-idle-disconnect; + vdd-supply = <&standby_power_regulator>; imux36: i2c at 0 { #address-cells = <1>; @@ -862,6 +883,7 @@ exp0: gpio at 20 { #interrupt-cells = <2>; interrupt-parent = <&gpio1>; interrupts = ; + vcc-supply = <&standby_power_regulator>; gpio-line-names = "FPGA_THERM_OVERT_L-I", "FPGA_READY_BMC-I", @@ -891,6 +913,7 @@ exp1: gpio at 21 { #interrupt-cells = <2>; interrupt-parent = <&gpio1>; interrupts = ; + vcc-supply = <&standby_power_regulator>; gpio-line-names = "SEC_FPGA_THERM_OVERT_L-I", "SEC_FPGA_READY_BMC-I", @@ -949,6 +972,7 @@ exp3: gpio at 74 { #interrupt-cells = <2>; interrupt-parent = <&gpio1>; interrupts = ; + vcc-supply = <&standby_power_regulator>; gpio-line-names = "IOB_PRSNT_L", "IOB_DP_HPD", @@ -1014,6 +1038,7 @@ i2c-mux at 77 { #size-cells = <0>; reg = <0x77>; i2c-mux-idle-disconnect; + vdd-supply = <&standby_power_regulator>; e1si2c0: i2c at 0 { #address-cells = <1>; @@ -1054,6 +1079,7 @@ i2c-mux at 77 { #size-cells = <0>; reg = <0x77>; i2c-mux-idle-disconnect; + vdd-supply = <&standby_power_regulator>; e1si2c4: i2c at 0 { #address-cells = <1>; -- 2.25.1 From wthai at nvidia.com Thu Jul 17 04:21:56 2025 From: wthai at nvidia.com (Willie Thai) Date: Wed, 16 Jul 2025 18:21:56 +0000 Subject: [PATCH v2 2/4] ARM: dts: aspeed: nvidia: gb200nvl: Enable i2c3 bus In-Reply-To: <20250716-update-gb200nvl-dts-for-new-hardware-v2-0-9a1a916f461d@nvidia.com> References: <20250716-update-gb200nvl-dts-for-new-hardware-v2-0-9a1a916f461d@nvidia.com> Message-ID: <20250716-update-gb200nvl-dts-for-new-hardware-v2-2-9a1a916f461d@nvidia.com> Enable i2c3 bus for telemetry fetching purpose. Signed-off-by: Deepak Kodihalli Signed-off-by: Ed Tanous Signed-off-by: Willie Thai --- Changes v1 -> v2: - Fix unevaluated vcc-supply properties [Rob Herring] --- --- arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts index bd9395a194137ea70d184665ad6cb659541ef175..f0a18adc328759e290bc354ad8ef703f28c1ffe8 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts @@ -422,7 +422,7 @@ &i2c2 { // I2C4 &i2c3 { - status = "disabled"; + status = "okay"; }; // I2C5 -- 2.25.1 From wthai at nvidia.com Thu Jul 17 04:21:57 2025 From: wthai at nvidia.com (Willie Thai) Date: Wed, 16 Jul 2025 18:21:57 +0000 Subject: [PATCH v2 3/4] ARM: dts: aspeed: nvidia: gb200nvl: Repurpose the HMC gpio pin In-Reply-To: <20250716-update-gb200nvl-dts-for-new-hardware-v2-0-9a1a916f461d@nvidia.com> References: <20250716-update-gb200nvl-dts-for-new-hardware-v2-0-9a1a916f461d@nvidia.com> Message-ID: <20250716-update-gb200nvl-dts-for-new-hardware-v2-3-9a1a916f461d@nvidia.com> Repurpose the HMC reset pin to FPGA reset pin. This change is according to hardware change. Signed-off-by: Deepak Kodihalli Signed-off-by: Ed Tanous Signed-off-by: Willie Thai --- arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts index f0a18adc328759e290bc354ad8ef703f28c1ffe8..dd2a02a6d1d40cd3fe99af83123a7a3a67149a69 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts @@ -1126,7 +1126,7 @@ &gpio0 { /*J0-J7*/ "", "", "", "", "", "", "", "", /*K0-K7*/ "", "", "", "", "", "", "", "", /*L0-L7*/ "", "", "", "", "", "", "", "", - /*M0-M7*/ "PCIE_EP_RST_EN-O", "BMC_FRU_WP-O", "HMC_RESET_L-O", "STBY_POWER_EN-O", + /*M0-M7*/ "PCIE_EP_RST_EN-O", "BMC_FRU_WP-O", "FPGA_RST_L-O", "STBY_POWER_EN-O", "STBY_POWER_PG-I", "PCIE_EP_RST_L-O", "", "", /*N0-N7*/ "", "", "", "", "", "", "", "", /*O0-O7*/ "", "", "", "", "", "", "", "", -- 2.25.1 From wthai at nvidia.com Thu Jul 17 04:21:54 2025 From: wthai at nvidia.com (Willie Thai) Date: Wed, 16 Jul 2025 18:21:54 +0000 Subject: [PATCH v2 0/4] ARM: dts: aspeed: nvidia: Update DTS to support GB200NVL hardware Message-ID: <20250716-update-gb200nvl-dts-for-new-hardware-v2-0-9a1a916f461d@nvidia.com> Update the DTS file for the GB200NVL hardware change. Signed-off-by: Deepak Kodihalli Signed-off-by: Ed Tanous Signed-off-by: Leo Huang Signed-off-by: Willie Thai --- Changes v1 -> v2: - Fix unevaluated vcc-supply properties [Rob Herring] - Add MAC0 [Deepak Kodihalli] --- --- Willie Thai (4): ARM: dts: aspeed: nvidia: gb200nvl: Add VCC Supply ARM: dts: aspeed: nvidia: gb200nvl: Enable i2c3 bus ARM: dts: aspeed: nvidia: gb200nvl: Repurpose the HMC gpio pin ARM: dts: aspeed: nvidia: gb200nvl: Enable MAC0 for BMC network .../dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts | 55 +++++++++++++++++++++- 1 file changed, 53 insertions(+), 2 deletions(-) --- base-commit: 13c9c6eabf033ed4f369ad4d29bdc58ed4a411e3 change-id: 20250716-update-gb200nvl-dts-for-new-hardware-b130d390c93c Best regards, -- Willie Thai From pkleequanta at gmail.com Wed Jul 16 19:43:29 2025 From: pkleequanta at gmail.com (P.K. Lee) Date: Wed, 16 Jul 2025 17:43:29 +0800 Subject: [PATCH v9 2/2] ARM: dts: aspeed: ventura: add Meta Ventura BMC In-Reply-To: <20250716094329.1069203-1-pkleequanta@gmail.com> References: <20250716094329.1069203-1-pkleequanta@gmail.com> Message-ID: <20250716094329.1069203-3-pkleequanta@gmail.com> Add Linux device tree related to Meta (Facebook) Ventura specific devices connected to the BMC (AST2600) SoC. The purpose of Ventura is to detect liquid leakage from all compute trays, switch trays and rack sensors within the rack, log the events, and take necessary actions accordingly. Signed-off-by: P.K. Lee --- arch/arm/boot/dts/aspeed/Makefile | 1 + .../aspeed/aspeed-bmc-facebook-ventura.dts | 1553 +++++++++++++++++ 2 files changed, 1554 insertions(+) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-ventura.dts diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile index c4f064e4b073..5ed6042eea97 100644 --- a/arch/arm/boot/dts/aspeed/Makefile +++ b/arch/arm/boot/dts/aspeed/Makefile @@ -27,6 +27,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ aspeed-bmc-facebook-minerva.dtb \ aspeed-bmc-facebook-minipack.dtb \ aspeed-bmc-facebook-tiogapass.dtb \ + aspeed-bmc-facebook-ventura.dtb \ aspeed-bmc-facebook-wedge40.dtb \ aspeed-bmc-facebook-wedge100.dtb \ aspeed-bmc-facebook-wedge400.dtb \ diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-ventura.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-ventura.dts new file mode 100644 index 000000000000..9aece8f56030 --- /dev/null +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-ventura.dts @@ -0,0 +1,1553 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Copyright (c) 2023 Facebook Inc. +/dts-v1/; + +#include "aspeed-g6.dtsi" +#include +#include + +/ { + model = "Facebook ventura RMC"; + compatible = "facebook,ventura-rmc", "aspeed,ast2600"; + + aliases { + serial4 = &uart5; + i2c16 = &i2c3mux0ch3; + i2c17 = &i2c3mux0ch4; + i2c18 = &i2c3mux0ch5; + i2c19 = &i2c3mux0ch6; + i2c20 = &i2c3mux0ch0; + i2c21 = &i2c3mux0ch1; + i2c22 = &i2c3mux0ch2; + i2c23 = &i2c3mux0ch7; + i2c24 = &i2c0mux0ch0; + i2c25 = &i2c0mux0ch1; + i2c26 = &i2c0mux0ch2; + i2c27 = &i2c0mux0ch3; + i2c28 = &i2c0mux0ch4; + i2c29 = &i2c0mux0ch5; + i2c30 = &i2c0mux0ch6; + i2c31 = &i2c0mux0ch7; + i2c32 = &i2c1mux0ch0; + i2c33 = &i2c1mux0ch1; + i2c34 = &i2c1mux0ch2; + i2c35 = &i2c1mux0ch3; + i2c36 = &i2c1mux0ch4; + i2c37 = &i2c1mux0ch5; + i2c38 = &i2c1mux0ch6; + i2c39 = &i2c1mux0ch7; + i2c40 = &i2c2mux0ch0; + i2c41 = &i2c2mux0ch1; + i2c42 = &i2c2mux0ch2; + i2c43 = &i2c2mux0ch3; + i2c44 = &i2c2mux0ch4; + i2c45 = &i2c2mux0ch5; + i2c46 = &i2c2mux0ch6; + i2c47 = &i2c2mux0ch7; + }; + + chosen { + stdout-path = "serial4:57600n8"; + }; + + iio-hwmon { + compatible = "iio-hwmon"; + io-channels = <&adc0 0>, <&adc0 1>, <&adc0 2>, <&adc0 3>, + <&adc0 4>, <&adc0 5>, <&adc0 6>, <&adc0 7>, + <&adc1 2>; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + label = "bmc_heartbeat_amber"; + gpios = <&gpio0 ASPEED_GPIO(P, 7) GPIO_ACTIVE_LOW>; + linux,default-trigger = "heartbeat"; + }; + + led-1 { + label = "fp_id_amber"; + default-state = "off"; + gpios = <&gpio0 ASPEED_GPIO(B, 5) GPIO_ACTIVE_HIGH>; + }; + + led-2 { + label = "bmc_ready_noled"; + default-state = "on"; + gpios = <&gpio0 ASPEED_GPIO(B, 3) (GPIO_ACTIVE_HIGH|GPIO_TRANSITORY)>; + }; + + led-3 { + label = "power_blue"; + default-state = "off"; + gpios = <&gpio0 ASPEED_GPIO(P, 4) GPIO_ACTIVE_HIGH>; + }; + + led-4 { + label = "compute1_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g5_gpio 0 GPIO_ACTIVE_LOW>; + }; + + led-5 { + label = "compute1_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g2_gpio 15 GPIO_ACTIVE_LOW>; + }; + + led-6 { + label = "compute1_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g2_gpio 14 GPIO_ACTIVE_LOW>; + }; + + led-7 { + label = "compute2_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g1_gpio 11 GPIO_ACTIVE_LOW>; + }; + + led-8 { + label = "compute2_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g1_gpio 10 GPIO_ACTIVE_LOW>; + }; + + led-9 { + label = "compute2_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g1_gpio 9 GPIO_ACTIVE_LOW>; + }; + + led-10 { + label = "compute3_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g1_gpio 8 GPIO_ACTIVE_LOW>; + }; + + led-11 { + label = "compute3_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g1_gpio 7 GPIO_ACTIVE_LOW>; + }; + + led-12 { + label = "compute3_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g1_gpio 6 GPIO_ACTIVE_LOW>; + }; + + led-13 { + label = "compute4_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g4_gpio 1 GPIO_ACTIVE_LOW>; + }; + + led-14 { + label = "compute4_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g4_gpio 0 GPIO_ACTIVE_LOW>; + }; + + led-15 { + label = "compute4_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g1_gpio 15 GPIO_ACTIVE_LOW>; + }; + + led-16 { + label = "compute5_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g1_gpio 14 GPIO_ACTIVE_LOW>; + }; + + led-17 { + label = "compute5_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g1_gpio 13 GPIO_ACTIVE_LOW>; + }; + + led-18 { + label = "compute5_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g1_gpio 12 GPIO_ACTIVE_LOW>; + }; + + led-19 { + label = "compute6_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g4_gpio 7 GPIO_ACTIVE_LOW>; + }; + + led-20 { + label = "compute6_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g4_gpio 6 GPIO_ACTIVE_LOW>; + }; + + led-21 { + label = "compute6_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g4_gpio 5 GPIO_ACTIVE_LOW>; + }; + + led-22 { + label = "compute7_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g4_gpio 4 GPIO_ACTIVE_LOW>; + }; + + led-23 { + label = "compute7_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g4_gpio 3 GPIO_ACTIVE_LOW>; + }; + + led-24 { + label = "compute7_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g4_gpio 2 GPIO_ACTIVE_LOW>; + }; + + led-25 { + label = "compute8_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g4_gpio 13 GPIO_ACTIVE_LOW>; + }; + + led-26 { + label = "compute8_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g4_gpio 12 GPIO_ACTIVE_LOW>; + }; + + led-27 { + label = "compute8_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g4_gpio 11 GPIO_ACTIVE_LOW>; + }; + + led-28 { + label = "nvs1_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g4_gpio 10 GPIO_ACTIVE_LOW>; + }; + + led-29 { + label = "nvs1_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g4_gpio 9 GPIO_ACTIVE_LOW>; + }; + + led-30 { + label = "nvs1_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g4_gpio 8 GPIO_ACTIVE_LOW>; + }; + + led-31 { + label = "nvs2_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g3_gpio 3 GPIO_ACTIVE_LOW>; + }; + + led-32 { + label = "nvs2_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g3_gpio 2 GPIO_ACTIVE_LOW>; + }; + + led-33 { + label = "nvs2_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g3_gpio 1 GPIO_ACTIVE_LOW>; + }; + + led-34 { + label = "nvs3_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g3_gpio 0 GPIO_ACTIVE_LOW>; + }; + + led-35 { + label = "nvs3_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g4_gpio 15 GPIO_ACTIVE_LOW>; + }; + + led-36 { + label = "nvs3_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g4_gpio 14 GPIO_ACTIVE_LOW>; + }; + + led-37 { + label = "nvs4_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g3_gpio 9 GPIO_ACTIVE_LOW>; + }; + + led-38 { + label = "nvs4_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g3_gpio 8 GPIO_ACTIVE_LOW>; + }; + + led-39 { + label = "nvs4_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g3_gpio 7 GPIO_ACTIVE_LOW>; + }; + + led-40 { + label = "nvs5_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g3_gpio 6 GPIO_ACTIVE_LOW>; + }; + + led-41 { + label = "nvs5_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g3_gpio 5 GPIO_ACTIVE_LOW>; + }; + + led-42 { + label = "nvs5_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g3_gpio 4 GPIO_ACTIVE_LOW>; + }; + + led-43 { + label = "nvs6_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g3_gpio 15 GPIO_ACTIVE_LOW>; + }; + + led-44 { + label = "nvs6_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g3_gpio 14 GPIO_ACTIVE_LOW>; + }; + + led-45 { + label = "nvs6_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g3_gpio 13 GPIO_ACTIVE_LOW>; + }; + + led-46 { + label = "nvs7_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g3_gpio 12 GPIO_ACTIVE_LOW>; + }; + + led-47 { + label = "nvs7_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g3_gpio 11 GPIO_ACTIVE_LOW>; + }; + + led-48 { + label = "nvs7_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g3_gpio 10 GPIO_ACTIVE_LOW>; + }; + + led-49 { + label = "nvs8_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g6_gpio 5 GPIO_ACTIVE_LOW>; + }; + + led-50 { + label = "nvs8_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g6_gpio 4 GPIO_ACTIVE_LOW>; + }; + + led-51 { + label = "nvs8_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g6_gpio 3 GPIO_ACTIVE_LOW>; + }; + + led-52 { + label = "nvs9_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g6_gpio 2 GPIO_ACTIVE_LOW>; + }; + + led-53 { + label = "nvs9_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g6_gpio 1 GPIO_ACTIVE_LOW>; + }; + + led-54 { + label = "nvs9_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g6_gpio 0 GPIO_ACTIVE_LOW>; + }; + + led-55 { + label = "compute9_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g6_gpio 11 GPIO_ACTIVE_LOW>; + }; + + led-56 { + label = "compute9_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g6_gpio 10 GPIO_ACTIVE_LOW>; + }; + + led-57 { + label = "compute9_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g6_gpio 9 GPIO_ACTIVE_LOW>; + }; + + led-58 { + label = "compute10_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g6_gpio 8 GPIO_ACTIVE_LOW>; + }; + + led-59 { + label = "compute10_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g6_gpio 7 GPIO_ACTIVE_LOW>; + }; + + led-60 { + label = "compute10_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g6_gpio 6 GPIO_ACTIVE_LOW>; + }; + + led-61 { + label = "compute11_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g2_gpio 1 GPIO_ACTIVE_LOW>; + }; + + led-62 { + label = "compute11_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g2_gpio 0 GPIO_ACTIVE_LOW>; + }; + + led-63 { + label = "compute11_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g6_gpio 15 GPIO_ACTIVE_LOW>; + }; + + led-64 { + label = "compute12_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g6_gpio 14 GPIO_ACTIVE_LOW>; + }; + + led-65 { + label = "compute12_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g6_gpio 13 GPIO_ACTIVE_LOW>; + }; + + led-66 { + label = "compute12_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g6_gpio 12 GPIO_ACTIVE_LOW>; + }; + + led-67 { + label = "compute13_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g2_gpio 7 GPIO_ACTIVE_LOW>; + }; + + led-68 { + label = "compute13_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g2_gpio 6 GPIO_ACTIVE_LOW>; + }; + + led-69 { + label = "compute13_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g2_gpio 5 GPIO_ACTIVE_LOW>; + }; + + led-70 { + label = "compute14_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g2_gpio 4 GPIO_ACTIVE_LOW>; + }; + + led-71 { + label = "compute14_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g2_gpio 3 GPIO_ACTIVE_LOW>; + }; + + led-72 { + label = "compute14_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g2_gpio 2 GPIO_ACTIVE_LOW>; + }; + + led-73 { + label = "compute15_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g2_gpio 13 GPIO_ACTIVE_LOW>; + }; + + led-74 { + label = "compute15_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g2_gpio 12 GPIO_ACTIVE_LOW>; + }; + + led-75 { + label = "compute15_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g2_gpio 11 GPIO_ACTIVE_LOW>; + }; + + led-76 { + label = "compute16_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g2_gpio 10 GPIO_ACTIVE_LOW>; + }; + + led-77 { + label = "compute16_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g2_gpio 9 GPIO_ACTIVE_LOW>; + }; + + led-78 { + label = "compute16_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g2_gpio 8 GPIO_ACTIVE_LOW>; + }; + + led-79 { + label = "compute17_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g1_gpio 5 GPIO_ACTIVE_LOW>; + }; + + led-80 { + label = "compute17_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g1_gpio 4 GPIO_ACTIVE_LOW>; + }; + + led-81 { + label = "compute17_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g1_gpio 3 GPIO_ACTIVE_LOW>; + }; + + led-82 { + label = "compute18_led_switch"; + default-state = "off"; + gpios = <&tray_leds_g1_gpio 2 GPIO_ACTIVE_LOW>; + }; + + led-83 { + label = "compute18_led_blue"; + default-state = "off"; + gpios = <&tray_leds_g1_gpio 1 GPIO_ACTIVE_LOW>; + }; + + led-84 { + label = "compute18_led_amber"; + default-state = "off"; + gpios = <&tray_leds_g1_gpio 0 GPIO_ACTIVE_LOW>; + }; + + led-85 { + label = "fan0_ledd1_blue"; + default-state = "off"; + gpios = <&fan_leds_g1_gpio 0 GPIO_ACTIVE_LOW>; + }; + + led-86 { + label = "fan0_ledd2_blue"; + default-state = "off"; + gpios = <&fan_leds_g1_gpio 1 GPIO_ACTIVE_LOW>; + }; + + led-87 { + label = "fan0_ledd1_amber"; + default-state = "off"; + gpios = <&fan_leds_g1_gpio 4 GPIO_ACTIVE_LOW>; + }; + + led-88 { + label = "fan0_ledd2_amber"; + default-state = "off"; + gpios = <&fan_leds_g1_gpio 5 GPIO_ACTIVE_LOW>; + }; + + led-89 { + label = "fan1_ledd1_blue"; + default-state = "off"; + gpios = <&fan_leds_g2_gpio 0 GPIO_ACTIVE_LOW>; + }; + + led-90 { + label = "fan1_ledd2_blue"; + default-state = "off"; + gpios = <&fan_leds_g2_gpio 1 GPIO_ACTIVE_LOW>; + }; + + led-91 { + label = "fan1_ledd1_amber"; + default-state = "off"; + gpios = <&fan_leds_g2_gpio 4 GPIO_ACTIVE_LOW>; + }; + + led-92 { + label = "fan1_ledd2_amber"; + default-state = "off"; + gpios = <&fan_leds_g2_gpio 5 GPIO_ACTIVE_LOW>; + }; + }; + + memory at 80000000 { + device_type = "memory"; + reg = <0x80000000 0x80000000>; + }; + + p1v8_bmc_aux: regulator-p1v8-bmc-aux { + compatible = "regulator-fixed"; + regulator-name = "p1v8_bmc_aux"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + + p2v5_bmc_aux: regulator-p2v5-bmc-aux { + compatible = "regulator-fixed"; + regulator-name = "p2v5_bmc_aux"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + regulator-always-on; + }; + + spi1_gpio: spi { + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + sck-gpios = <&gpio0 ASPEED_GPIO(Z, 3) GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio0 ASPEED_GPIO(Z, 4) GPIO_ACTIVE_HIGH>; + miso-gpios = <&gpio0 ASPEED_GPIO(Z, 5) GPIO_ACTIVE_HIGH>; + cs-gpios = <&gpio0 ASPEED_GPIO(Z, 0) GPIO_ACTIVE_LOW>; + num-chipselects = <1>; + + tpm at 0 { + compatible = "infineon,slb9670", "tcg,tpm_tis-spi"; + spi-max-frequency = <33000000>; + reg = <0>; + }; + }; +}; + +&adc0 { + vref-supply = <&p1v8_bmc_aux>; + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_adc0_default &pinctrl_adc1_default + &pinctrl_adc2_default &pinctrl_adc3_default + &pinctrl_adc4_default &pinctrl_adc5_default + &pinctrl_adc6_default &pinctrl_adc7_default>; + +}; + +&adc1 { + vref-supply = <&p2v5_bmc_aux>; + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_adc10_default>; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&fmc { + status = "okay"; + flash at 0 { + status = "okay"; + m25p,fast-read; + label = "bmc"; + spi-max-frequency = <50000000>; +#include "openbmc-flash-layout-128.dtsi" + }; + flash at 1 { + status = "okay"; + m25p,fast-read; + label = "alt-bmc"; + spi-max-frequency = <50000000>; + }; +}; + +&i2c0 { + status = "okay"; + + i2c-mux at 77 { + compatible = "nxp,pca9548"; + reg = <0x77>; + #address-cells = <1>; + #size-cells = <0>; + + i2c0mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + status = "okay"; + }; + + i2c0mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + status = "okay"; + }; + + i2c0mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + status = "okay"; + }; + + i2c0mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + status = "okay"; + }; + + i2c0mux0ch4: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + status = "okay"; + }; + + i2c0mux0ch5: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + status = "okay"; + }; + + i2c0mux0ch6: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + status = "okay"; + }; + + i2c0mux0ch7: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + status = "okay"; + }; + }; +}; + +&i2c1 { + status = "okay"; + + i2c-mux at 77 { + compatible = "nxp,pca9548"; + reg = <0x77>; + #address-cells = <1>; + #size-cells = <0>; + + i2c1mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + status = "okay"; + }; + + i2c1mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + status = "okay"; + }; + + i2c1mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + status = "okay"; + }; + + i2c1mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + status = "okay"; + }; + + i2c1mux0ch4: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + status = "okay"; + }; + + i2c1mux0ch5: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + status = "okay"; + }; + + i2c1mux0ch6: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + status = "okay"; + }; + + i2c1mux0ch7: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + status = "okay"; + }; + }; +}; + +&i2c2 { + status = "okay"; + + i2c-mux at 77 { + compatible = "nxp,pca9548"; + reg = <0x77>; + #address-cells = <1>; + #size-cells = <0>; + + i2c2mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + status = "okay"; + }; + + i2c2mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + status = "okay"; + }; + + i2c2mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + status = "okay"; + }; + + i2c2mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + status = "okay"; + }; + + i2c2mux0ch4: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + status = "okay"; + }; + + i2c2mux0ch5: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + status = "okay"; + }; + + i2c2mux0ch6: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + status = "okay"; + }; + + i2c2mux0ch7: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + status = "okay"; + }; + }; +}; + +&i2c3 { + status = "okay"; + + i2c-mux at 77 { + compatible = "nxp,pca9548"; + reg = <0x77>; + #address-cells = <1>; + #size-cells = <0>; + + i2c3mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + status = "okay"; + }; + + i2c3mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + status = "okay"; + }; + + i2c3mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + status = "okay"; + }; + + i2c3mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + + // Fan Board 0 FRU + eeprom at 56 { + compatible = "atmel,24c128"; + reg = <0x56>; + }; + + fan_leds_g1_gpio: gpio at 21 { + compatible = "nxp,pca9555"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + + gpio-line-names = + "", "", + "", "", + "", "", + "", "", + "FAN0_PRSNT", "FAN1_PRSNT", + "", "", + "", "", + "", ""; + }; + + adc at 1f { + compatible = "ti,adc128d818"; + reg = <0x1f>; + ti,mode = /bits/ 8 <1>; + }; + + adc at 35 { + compatible = "maxim,max11617"; + reg = <0x35>; + }; + }; + + i2c3mux0ch4: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + + // Fan Board 1 FRU + eeprom at 56 { + compatible = "atmel,24c128"; + reg = <0x56>; + }; + + fan_leds_g2_gpio: gpio at 21 { + compatible = "nxp,pca9555"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + + gpio-line-names = + "", "", + "", "", + "", "", + "", "", + "FAN2_PRSNT", "FAN3_PRSNT", + "", "", + "", "", + "", ""; + }; + + adc at 1f { + compatible = "ti,adc128d818"; + reg = <0x1f>; + ti,mode = /bits/ 8 <1>; + }; + + adc at 35 { + compatible = "maxim,max11617"; + reg = <0x35>; + }; + }; + + i2c3mux0ch5: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + + pwm at 20 { + compatible = "max31790"; + reg = <0x20>; + #address-cells = <1>; + #size-cells = <0>; + channel at 2 { + reg = <2>; + sensor-type = "TACH"; + }; + channel at 5 { + reg = <5>; + sensor-type = "TACH"; + }; + }; + + hwmon: hwmon at 23 { + compatible = "nuvoton,nct7363"; + reg = <0x23>; + #pwm-cells = <2>; + + //fan 0 IL + fan-0 { + pwms = <&hwmon 0 20000>; + tach-ch = /bits/ 8 <0x09>; + }; + + //fan 0 OL + fan-1 { + pwms = <&hwmon 0 20000>; + tach-ch = /bits/ 8 <0x0B>; + }; + + //fan 1 IL + fan-2 { + pwms = <&hwmon 4 20000>; + tach-ch = /bits/ 8 <0x0A>; + }; + + //fan 1 OL + fan-3 { + pwms = <&hwmon 4 20000>; + tach-ch = /bits/ 8 <0x0D>; + }; + + //fan 2 IL + fan-4 { + pwms = <&hwmon 6 20000>; + tach-ch = /bits/ 8 <0x0F>; + }; + + //fan 2 OL + fan-5 { + pwms = <&hwmon 6 20000>; + tach-ch = /bits/ 8 <0x01>; + }; + + //fan 3 IL + fan-6 { + pwms = <&hwmon 10 20000>; + tach-ch = /bits/ 8 <0x00>; + }; + + //fan 3 OL + fan-7 { + pwms = <&hwmon 10 20000>; + tach-ch = /bits/ 8 <0x03>; + }; + }; + }; + + i2c3mux0ch6: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + // REAR-IO Board FRU + eeprom at 56 { + compatible = "atmel,24c128"; + reg = <0x56>; + }; + }; + + i2c3mux0ch7: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + status = "okay"; + }; + }; +}; + +&i2c4 { + status = "okay"; +}; + +&i2c5 { + status = "okay"; + + // VR TEMP U399 + temperature-sensor at 4c { + compatible = "ti,tmp75"; + reg = <0x4c>; + }; + + // VR TEMP U397 + temperature-sensor at 4d { + compatible = "ti,tmp75"; + reg = <0x4d>; + }; + + // BRICK TEMP U398 + temperature-sensor at 4e { + compatible = "ti,tmp75"; + reg = <0x4e>; + }; + + temperature-sensor at 4f { + compatible = "ti,tmp75"; + reg = <0x4f>; + }; + + // RMC FRU + eeprom at 54 { + compatible = "atmel,24c128"; + reg = <0x54>; + }; +}; + +&i2c6 { + status = "okay"; + + gpio at 20 { + compatible = "nxp,pca9555"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpio at 21 { + compatible = "nxp,pca9555"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + }; + + gpio at 22 { + compatible = "nxp,pca9555"; + reg = <0x22>; + gpio-controller; + #gpio-cells = <2>; + }; + + rtc at 51 { + compatible = "nxp,pcf8563"; + reg = <0x51>; + }; +}; + +&i2c7 { + status = "okay"; + multi-master; + + //USB Debug Connector + ipmb at 10 { + compatible = "ipmb-dev"; + reg = <(0x10 | I2C_OWN_SLAVE_ADDRESS)>; + i2c-protocol; + }; +}; + +&i2c9 { + status = "okay"; + + // SCM TEMP SENSOR + temperature-sensor at 4b { + compatible = "ti,tmp75"; + reg = <0x4b>; + }; + + // SCM FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c128"; + reg = <0x50>; + }; + + // BSM FRU EEPROM + eeprom at 56 { + compatible = "atmel,24c64"; + reg = <0x56>; + }; +}; + +&i2c10 { + status = "okay"; + + power-monitor at 14 { + compatible = "infineon,xdp710"; + reg = <0x14>; + }; + + power-monitor at 44 { + compatible = "lltc,ltc4286"; + reg = <0x44>; + }; + + power-monitor at 69 { + compatible = "pmbus"; + reg = <0x69>; + }; + + gpio at 19 { + compatible = "nxp,pca9555"; + reg = <0x19>; + gpio-controller; + #gpio-cells = <2>; + + gpio-line-names = + "", "", + "", "", + "", "", + "", "", + "wIT_GEAR_RPU_2_LINK_PRSNT_SPARE_N_R", "wIT_GEAR_RPU_2_LINK_PRSNT_N_R", + "wIT_GEAR_RPU_LINK_PRSNT_SPARE_N_R", "wIT_GEAR_RPU_LINK_PRSNT_N_R", + "", "", + "", ""; + }; + + gpio at 1a { + compatible = "nxp,pca9555"; + reg = <0x1a>; + gpio-controller; + #gpio-cells = <2>; + + gpio-line-names = + "wPRSNT_LEAK1_SENSOR_R_PLD_N", "wPRSNT_LEAK0_SENSOR_R_PLD_N", + "", "", + "", "", + "", "", + "", "", + "", "", + "", "", + "", "wPRSNT_LEAK2_SENSOR_R_PLD_N"; + }; + + gpio at 1b { + compatible = "nxp,pca9555"; + reg = <0x1b>; + gpio-controller; + #gpio-cells = <2>; + + gpio-line-names = + "", "", + "", "", + "", "wPRSNT_LEAK4_SENSOR_R_PLD_N", + "wPRSNT_LEAK3_SENSOR_R_PLD_N", "", + "", "", + "", "", + "", "", + "", ""; + }; +}; + +&i2c14 { + status = "okay"; +}; + +&i2c15 { + status = "okay"; + + tray_leds_g1_gpio: gpio at 20 { + compatible = "nxp,pca9555"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + }; + + tray_leds_g2_gpio: gpio at 21 { + compatible = "nxp,pca9555"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + }; + + tray_leds_g3_gpio: gpio at 22 { + compatible = "nxp,pca9555"; + reg = <0x22>; + gpio-controller; + #gpio-cells = <2>; + }; + + tray_leds_g4_gpio: gpio at 24 { + compatible = "nxp,pca9555"; + reg = <0x24>; + gpio-controller; + #gpio-cells = <2>; + }; + + tray_leds_g5_gpio: gpio at 25 { + compatible = "nxp,pca9555"; + reg = <0x25>; + gpio-controller; + #gpio-cells = <2>; + }; + + tray_leds_g6_gpio: gpio at 26 { + compatible = "nxp,pca9555"; + reg = <0x26>; + gpio-controller; + #gpio-cells = <2>; + }; + + // LED Board FRU + eeprom at 56 { + compatible = "atmel,24c128"; + reg = <0x56>; + }; +}; + +&mdio0 { + status = "okay"; +}; + +&mac3 { + status = "okay"; + phy-mode = "rmii"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_rmii4_default>; + fixed-link { + speed = <100>; + full-duplex; + }; +}; + +&uhci { + status = "okay"; +}; + +&gpio0 { + gpio-line-names = + /*A0-A7*/ "","","","","","","","", + /*B0-B7*/ "BATTERY_DETECT","","","BMC_READY","","","","", + /*C0-C7*/ "","","","","","","","", + /*D0-D7*/ "","","","","","","","", + /*E0-E7*/ "","","","","","","","", + /*F0-F7*/ "","","","","","","","", + /*G0-G7*/ "","","","","","","","", + /*H0-H7*/ "","","","","","","","", + /*I0-I7*/ "","","","","","","","", + /*J0-J7*/ "","","","","","","","", + /*K0-K7*/ "","","","","","","","", + /*L0-L7*/ "","","","","","","","", + /*M0-M7*/ "","","","","","","","", + /*N0-N7*/ "","","","","","","","", + /*O0-O7*/ "","","","","","","","USBDBG_IPMI_EN_L", + /*P0-P7*/ "","","","","","","","", + /*Q0-Q7*/ "","","","","","FM_MDIO_SW_SEL","","", + /*R0-R7*/ "","","","","","","","", + /*S0-S7*/ "","","","","","","","", + /*T0-T7*/ "","","","","","","","", + /*U0-U7*/ "","","","","","","","", + /*V0-V7*/ "","","","","","","","", + /*W0-W7*/ "","","","","","","","", + /*X0-X7*/ "","","","","","","","", + /*Y0-Y7*/ "","","","","","","","", + /*Z0-Z7*/ "","","","","","","",""; +}; + +&sgpiom0 { + status = "okay"; + ngpios = <128>; + bus-frequency = <2000000>; +}; + +&sgpiom0 { + gpio-line-names = + /*"input pin","output pin"*/ + /*A0 - A7*/ + "power-chassis-good","power-chassis-control", + "host0-ready","WATER_VALVE_CLOSED_N", + "wPRSNT_RETURN_PLD_R_N","FM_MDIO_SW_SEL_PLD", + "wPRSNT_SUPPLY_PLD_R_N","FM_88E6393X_BIN_UPDATE_EN_N", + "LEAK3_DETECT","", + "LEAK4_DETECT","", + "RETURN_CNTL_FB_D_R","", + "SUPPLY_CNTL_FB_D_R","", + /*B0 - B7*/ + "IT_STOP_PUMP_SPARE_2","", + "IT_STOP_PUMP_2","", + "IT_STOP_PUMP_SPARE","", + "IT_STOP_PUMP","", + "RPU_2_READY_SPARE_PLD_R","", + "RPU_2_READY_PLD_R","", + "RPU_READY_SPARE_PLD_R","", + "RPU_READY_PLD_R","", + /*C0 - C7*/ + "wAALC_RPU_READY","", + "LEAK0_DETECT","", + "LEAK1_DETECT","", + "LEAK2_DETECT","", + "PRSNT_COMPUTE_TRAY1_N","", + "PRSNT_COMPUTE_TRAY2_N","", + "PRSNT_COMPUTE_TRAY3_N","", + "PRSNT_COMPUTE_TRAY4_N","", + /*D0 - D7*/ + "PRSNT_COMPUTE_TRAY5_N","", + "PRSNT_COMPUTE_TRAY6_N","", + "PRSNT_COMPUTE_TRAY7_N","", + "PRSNT_COMPUTE_TRAY8_N","", + "PRSNT_NVS_TRAY1_N","", + "PRSNT_NVS_TRAY2_N","", + "PRSNT_COMPUTE_TRAY11_N","", + "PRSNT_COMPUTE_TRAY12_N","", + /*E0 - E7*/ + "PRSNT_COMPUTE_TRAY13_N","", + "PRSNT_COMPUTE_TRAY14_N","", + "PRSNT_COMPUTE_TRAY15_N","", + "PRSNT_COMPUTE_TRAY16_N","", + "PRSNT_COMPUTE_TRAY17_N","", + "PRSNT_COMPUTE_TRAY18_N","", + "PRSNT_NVS_TRAY3_N","", + "PRSNT_NVS_TRAY4_N","", + /*F0 - F7*/ + "PRSNT_NVS_TRAY5_N","", + "PRSNT_NVS_TRAY6_N","", + "PRSNT_NVS_TRAY7_N","", + "PRSNT_NVS_TRAY8_N","", + "PRSNT_NVS_TRAY9_N","", + "PRSNT_COMPUTE_TRAY9_N","", + "PRSNT_COMPUTE_TRAY10_N","", + "SMALL_LEAK_COMPUTE_TRAY1_N","", + /*G0 - G7*/ + "SMALL_LEAK_COMPUTE_TRAY2_N","", + "SMALL_LEAK_COMPUTE_TRAY3_N","", + "SMALL_LEAK_COMPUTE_TRAY4_N","", + "SMALL_LEAK_COMPUTE_TRAY5_N","", + "SMALL_LEAK_COMPUTE_TRAY6_N","", + "SMALL_LEAK_COMPUTE_TRAY7_N","", + "SMALL_LEAK_COMPUTE_TRAY8_N","", + "SMALL_LEAK_NVS_TRAY1_N","", + /*H0 - H7*/ + "SMALL_LEAK_NVS_TRAY2_N","", + "SMALL_LEAK_COMPUTE_TRAY11_N","", + "SMALL_LEAK_COMPUTE_TRAY12_N","", + "SMALL_LEAK_COMPUTE_TRAY13_N","", + "SMALL_LEAK_COMPUTE_TRAY14_N","", + "SMALL_LEAK_COMPUTE_TRAY15_N","", + "SMALL_LEAK_COMPUTE_TRAY16_N","", + "SMALL_LEAK_COMPUTE_TRAY17_N","", + /*I0 - I7*/ + "SMALL_LEAK_COMPUTE_TRAY18_N","", + "SMALL_LEAK_NVS_TRAY3_N","", + "SMALL_LEAK_NVS_TRAY4_N","", + "SMALL_LEAK_NVS_TRAY5_N","", + "SMALL_LEAK_NVS_TRAY6_N","", + "SMALL_LEAK_NVS_TRAY7_N","", + "SMALL_LEAK_NVS_TRAY8_N","", + "SMALL_LEAK_NVS_TRAY9_N","", + /*J0 - J7*/ + "SMALL_LEAK_COMPUTE_TRAY9_N","", + "SMALL_LEAK_COMPUTE_TRAY10_N","", + "PWRGD_COMPUTE_TRAY1_N","", + "PWRGD_COMPUTE_TRAY2_N","", + "PWRGD_COMPUTE_TRAY3_N","", + "PWRGD_COMPUTE_TRAY4_N","", + "PWRGD_COMPUTE_TRAY5_N","", + "PWRGD_COMPUTE_TRAY6_N","", + /*K0 - K7*/ + "PWRGD_COMPUTE_TRAY7_N","", + "PWRGD_COMPUTE_TRAY8_N","", + "PWRGD_NVS_TRAY1_PWROK_N","", + "PWRGD_NVS_TRAY2_PWROK_N","", + "PWRGD_COMPUTE_TRAY11_N","", + "PWRGD_COMPUTE_TRAY12_N","", + "PWRGD_COMPUTE_TRAY13_N","", + "PWRGD_COMPUTE_TRAY14_N","", + /*L0 - L7*/ + "PWRGD_COMPUTE_TRAY15_N","", + "PWRGD_COMPUTE_TRAY16_N","", + "PWRGD_COMPUTE_TRAY17_N","", + "PWRGD_COMPUTE_TRAY18_N","", + "PWRGD_NVS_TRAY3_PWROK_N","", + "PWRGD_NVS_TRAY4_PWROK_N","", + "PWRGD_NVS_TRAY5_PWROK_N","", + "PWRGD_NVS_TRAY6_PWROK_N","", + /*M0 - M7*/ + "PWRGD_NVS_TRAY7_PWROK_N","", + "PWRGD_NVS_TRAY8_PWROK_N","", + "PWRGD_NVS_TRAY9_PWROK_N","", + "PWRGD_COMPUTE_TRAY9_N","", + "PWRGD_COMPUTE_TRAY10_N","", + "LEAK_DETECT_COMPUTE_TRAY1_N","", + "LEAK_DETECT_COMPUTE_TRAY2_N","", + "LEAK_DETECT_COMPUTE_TRAY3_N","", + /*N0 - N7*/ + "LEAK_DETECT_COMPUTE_TRAY4_N","", + "LEAK_DETECT_COMPUTE_TRAY5_N","", + "LEAK_DETECT_COMPUTE_TRAY6_N","", + "LEAK_DETECT_COMPUTE_TRAY7_N","", + "LEAK_DETECT_COMPUTE_TRAY8_N","", + "LEAK_DETECT_NVS_TRAY1_N","", + "LEAK_DETECT_NVS_TRAY2_N","", + "LEAK_DETECT_COMPUTE_TRAY11_N","", + /*O0 - O7*/ + "LEAK_DETECT_COMPUTE_TRAY12_N","", + "LEAK_DETECT_COMPUTE_TRAY13_N","", + "LEAK_DETECT_COMPUTE_TRAY14_N","", + "LEAK_DETECT_COMPUTE_TRAY15_N","", + "LEAK_DETECT_COMPUTE_TRAY16_N","", + "LEAK_DETECT_COMPUTE_TRAY17_N","", + "LEAK_DETECT_COMPUTE_TRAY18_N","", + "LEAK_DETECT_NVS_TRAY3_N","", + /*P0 - P7*/ + "LEAK_DETECT_NVS_TRAY4_N","", + "LEAK_DETECT_NVS_TRAY5_N","", + "LEAK_DETECT_NVS_TRAY6_N","", + "LEAK_DETECT_NVS_TRAY7_N","", + "LEAK_DETECT_NVS_TRAY8_N","", + "LEAK_DETECT_NVS_TRAY9_N","", + "LEAK_DETECT_COMPUTE_TRAY9_N","", + "LEAK_DETECT_COMPUTE_TRAY10_N",""; +}; + +&wdt1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_wdtrst1_default>; + aspeed,reset-type = "soc"; + aspeed,external-signal; + aspeed,ext-push-pull; + aspeed,ext-active-high; + aspeed,ext-pulse-duration = <256>; +}; -- 2.43.0 From pkleequanta at gmail.com Wed Jul 16 19:43:28 2025 From: pkleequanta at gmail.com (P.K. Lee) Date: Wed, 16 Jul 2025 17:43:28 +0800 Subject: [PATCH v9 1/2] dt-bindings: arm: aspeed: add Meta Ventura board In-Reply-To: <20250716094329.1069203-1-pkleequanta@gmail.com> References: <20250716094329.1069203-1-pkleequanta@gmail.com> Message-ID: <20250716094329.1069203-2-pkleequanta@gmail.com> Document the new compatibles used on Meta Ventura. Signed-off-by: P.K. Lee --- Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml index 2f92b8ab08fa..98ea2b3e0eb1 100644 --- a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml +++ b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml @@ -86,6 +86,7 @@ properties: - facebook,greatlakes-bmc - facebook,harma-bmc - facebook,minerva-cmc + - facebook,ventura-rmc - facebook,yosemite4-bmc - ibm,blueridge-bmc - ibm,everest-bmc -- 2.43.0 From pkleequanta at gmail.com Wed Jul 16 19:43:27 2025 From: pkleequanta at gmail.com (P.K. Lee) Date: Wed, 16 Jul 2025 17:43:27 +0800 Subject: [PATCH v9 0/2] Add Meta (Facebook) Ventura BMC (AST2600) Message-ID: <20250716094329.1069203-1-pkleequanta@gmail.com> Add Linux device tree entry related to Meta (Facebook) Ventura specific devices connected to the BMC (AST2600) SoC. The purpose of Ventura is to detect liquid leakage from all compute trays, switch trays and rack sensors within the rack, log the events, and take necessary actions accordingly. --- v1: 1. Create ventura dts file. 2. Add commit msg. 3. Use format-patch to generate patch. 4. Add subject prefixes matching the subsystem. --- v2: 1. Modify email content. --- v3: 1. Add mail list. --- v4: 1. Apply git send-email --thread option. 2. Sort nodes in the dts alphanumerically. --- v5: 1. Run scripts/checkpatch.pl and fix reported warnings. 2. Remove unnecessary 88E6393X CONFIG FRU. --- v6: 1. Add a new stage for the DTS change. 2. Run scripts/checkpatch.pl and fix reported error. 3. Fix the issue in a separate patch. --- v7: 1. Fix broken indentation in the device tree file. 2. Sort nodes alphabetically, then by address if equal. 3. Rename fan sensor nodes from 'hwmon' to 'fan-controller'. --- v8: 1. This patch series has significant changes compared to previous versions, and quite some time has passed since the last submission.Therefore, previously received Acked-by/Reviewed-by/Tested-by tags are not included in this version. If needed, tags can be added again after review of thisnew version. --- v9: 1. Reordered the node sequence under i2c5. 2. Added a description of the platform's intended use to the commit messages. 3. Added 3 GPIO expanders to i2c10 and defined the necessary GPIO line names. --- P.K. Lee (2): dt-bindings: arm: aspeed: add Meta Ventura board ARM: dts: aspeed: ventura: add Meta Ventura BMC .../bindings/arm/aspeed/aspeed.yaml | 1 + arch/arm/boot/dts/aspeed/Makefile | 1 + .../aspeed/aspeed-bmc-facebook-ventura.dts | 1553 +++++++++++++++++ 3 files changed, 1555 insertions(+) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-ventura.dts -- 2.43.0 From leo.jt.wang at gmail.com Wed Jul 16 16:24:15 2025 From: leo.jt.wang at gmail.com (Leo Wang) Date: Wed, 16 Jul 2025 14:24:15 +0800 Subject: [PATCH v7 2/2] ARM: dts: aspeed: clemente: add Meta Clemente BMC In-Reply-To: <20250716-add-support-for-meta-clemente-bmc-v7-0-d5bb7459c5aa@fii-foxconn.com> References: <20250716-add-support-for-meta-clemente-bmc-v7-0-d5bb7459c5aa@fii-foxconn.com> Message-ID: <20250716-add-support-for-meta-clemente-bmc-v7-2-d5bb7459c5aa@fii-foxconn.com> From: Leo Wang Add linux device tree entry for Meta Clemente compute-tray BMC using AST2600 SoC. Signed-off-by: Leo Wang --- arch/arm/boot/dts/aspeed/Makefile | 1 + .../dts/aspeed/aspeed-bmc-facebook-clemente.dts | 1297 ++++++++++++++++++++ arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi | 11 + 3 files changed, 1309 insertions(+) diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile index 2e5f4833a073b6c25190fd4b6e89a11f9636fc84..904503f78f960d7bc14cad7cb455bb8bb3138ccd 100644 --- a/arch/arm/boot/dts/aspeed/Makefile +++ b/arch/arm/boot/dts/aspeed/Makefile @@ -19,6 +19,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ aspeed-bmc-delta-ahe50dc.dtb \ aspeed-bmc-facebook-bletchley.dtb \ aspeed-bmc-facebook-catalina.dtb \ + aspeed-bmc-facebook-clemente.dtb \ aspeed-bmc-facebook-cmm.dtb \ aspeed-bmc-facebook-elbert.dtb \ aspeed-bmc-facebook-fuji.dtb \ diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dts new file mode 100644 index 0000000000000000000000000000000000000000..6adbc3275be32a8dba18f7ee6fe8088d5627c80e --- /dev/null +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dts @@ -0,0 +1,1297 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Copyright (c) 2021 Facebook Inc. +/dts-v1/; + +#include "aspeed-g6.dtsi" +#include +#include +#include +#include +#include + +/ { + model = "Facebook Clemente BMC"; + compatible = "facebook,clemente-bmc", "aspeed,ast2600"; + + aliases { + serial0 = &uart1; + serial2 = &uart3; + serial3 = &uart4; + serial4 = &uart5; + i2c16 = &i2c1mux0ch0; + i2c17 = &i2c1mux0ch1; + i2c18 = &i2c1mux0ch2; + i2c19 = &i2c1mux0ch3; + i2c20 = &i2c1mux0ch4; + i2c21 = &i2c1mux0ch5; + i2c22 = &i2c1mux0ch6; + i2c23 = &i2c1mux0ch7; + i2c24 = &i2c0mux0ch0; + i2c25 = &i2c0mux0ch1; + i2c26 = &i2c0mux0ch2; + i2c27 = &i2c0mux0ch3; + i2c28 = &i2c0mux1ch0; + i2c29 = &i2c0mux1ch1; + i2c30 = &i2c0mux1ch2; + i2c31 = &i2c0mux1ch3; + i2c32 = &i2c0mux2ch0; + i2c33 = &i2c0mux2ch1; + i2c34 = &i2c0mux2ch2; + i2c35 = &i2c0mux2ch3; + i2c36 = &i2c0mux3ch0; + i2c37 = &i2c0mux3ch1; + i2c38 = &i2c0mux3ch2; + i2c39 = &i2c0mux3ch3; + i2c40 = &i2c0mux4ch0; + i2c41 = &i2c0mux4ch1; + i2c42 = &i2c0mux4ch2; + i2c43 = &i2c0mux4ch3; + i2c44 = &i2c0mux5ch0; + i2c45 = &i2c0mux5ch1; + i2c46 = &i2c0mux5ch2; + i2c47 = &i2c0mux5ch3; + i2c48 = &i2c0mux0ch1mux0ch0; + i2c49 = &i2c0mux0ch1mux0ch1; + i2c50 = &i2c0mux0ch1mux0ch2; + i2c51 = &i2c0mux0ch1mux0ch3; + i2c52 = &i2c0mux3ch1mux0ch0; + i2c53 = &i2c0mux3ch1mux0ch1; + i2c54 = &i2c0mux3ch1mux0ch2; + i2c55 = &i2c0mux3ch1mux0ch3; + }; + + chosen { + stdout-path = "serial4:57600n8"; + }; + + memory at 80000000 { + device_type = "memory"; + reg = <0x80000000 0x80000000>; + }; + + iio-hwmon { + compatible = "iio-hwmon"; + io-channels = <&adc0 0>, <&adc0 1>, <&adc0 2>, <&adc0 3>, + <&adc0 4>, <&adc0 5>, <&adc0 6>, <&adc0 7>, + <&adc1 2>; + }; + + spi1_gpio: spi { + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + sck-gpios = <&gpio0 ASPEED_GPIO(Z, 3) GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio0 ASPEED_GPIO(Z, 4) GPIO_ACTIVE_HIGH>; + miso-gpios = <&gpio0 ASPEED_GPIO(Z, 5) GPIO_ACTIVE_HIGH>; + cs-gpios = <&gpio0 ASPEED_GPIO(Z, 0) GPIO_ACTIVE_LOW>; + num-chipselects = <1>; + + tpm at 0 { + compatible = "infineon,slb9670", "tcg,tpm_tis-spi"; + spi-max-frequency = <33000000>; + reg = <0>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + label = "bmc_heartbeat_amber"; + gpios = <&gpio0 ASPEED_GPIO(P, 7) GPIO_ACTIVE_LOW>; + linux,default-trigger = "heartbeat"; + }; + + led-1 { + label = "fp_id_amber"; + default-state = "off"; + gpios = <&gpio0 ASPEED_GPIO(B, 5) GPIO_ACTIVE_HIGH>; + }; + + led-2 { + label = "bmc_ready_noled"; + gpios = <&gpio0 ASPEED_GPIO(B, 3) (GPIO_ACTIVE_HIGH|GPIO_TRANSITORY)>; + }; + + led-3 { + label = "bmc_ready_cpld_noled"; + gpios = <&gpio0 ASPEED_GPIO(P, 5) (GPIO_ACTIVE_HIGH|GPIO_TRANSITORY)>; + }; + }; + + p1v8_bmc_aux: regulator-p1v8-bmc-aux { + compatible = "regulator-fixed"; + regulator-name = "p1v8_bmc_aux"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + + p2v5_bmc_aux: regulator-p2v5-bmc-aux { + compatible = "regulator-fixed"; + regulator-name = "p2v5_bmc_aux"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + regulator-always-on; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + ramoops at b3e00000 { + compatible = "ramoops"; + reg = <0xbb000000 0x200000>; /* 16 * (4 * 0x8000) */ + record-size = <0x8000>; + console-size = <0x8000>; + ftrace-size = <0x8000>; + pmsg-size = <0x8000>; + max-reason = <3>; + }; + }; + +}; + +&adc0 { + vref-supply = <&p1v8_bmc_aux>; + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_adc0_default &pinctrl_adc1_default + &pinctrl_adc2_default &pinctrl_adc3_default + &pinctrl_adc4_default &pinctrl_adc5_default + &pinctrl_adc6_default &pinctrl_adc7_default>; +}; + +&adc1 { + vref-supply = <&p2v5_bmc_aux>; + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_adc10_default>; +}; + +&ehci0 { + status = "okay"; +}; + +&fmc { + status = "okay"; + flash at 0 { + status = "okay"; + m25p,fast-read; + label = "bmc"; + spi-max-frequency = <50000000>; +#include "openbmc-flash-layout-128.dtsi" + }; + flash at 1 { + status = "okay"; + m25p,fast-read; + label = "alt-bmc"; + spi-max-frequency = <50000000>; + }; +}; + +&gpio0 { + gpio-line-names = + /*A0-A7*/ "","","","","","","","", + /*B0-B7*/ "BATTERY_DETECT","PRSNT1_HPM_SCM_N", + "BMC_I2C1_FPGA_ALERT_L","BMC_READY", + "IOEXP_INT_L","FM_ID_LED", + "","", + /*C0-C7*/ "BMC_GPIOC0","","","", + "PMBUS_REQ_N","PSU_FW_UPDATE_REQ_N", + "","BMC_I2C_SSIF_ALERT_L", + /*D0-D7*/ "","","","","BMC_GPIOD4","","","", + /*E0-E7*/ "BMC_GPIOE0","BMC_GPIOE1","","","","","","", + /*F0-F7*/ "","","","","","","","", + /*G0-G7*/ "","","","","","", + "FM_DEBUG_PORT_PRSNT_N","FM_BMC_DBP_PRESENT_N", + /*H0-H7*/ "PWR_BRAKE_L","RUN_POWER_EN", + "SHDN_FORCE_L","SHDN_REQ_L", + "","","","", + /*I0-I7*/ "","","","", + "","FLASH_WP_STATUS", + "FM_PDB_HEALTH_N","RUN_POWER_PG", + /*J0-J7*/ "","","","","","","","", + /*K0-K7*/ "","","","","","","","", + /*L0-L7*/ "","","","","","","","", + /*M0-M7*/ "PCIE_EP_RST_EN","BMC_FRU_WP", + "SCM_HPM_STBY_RST_N","SCM_HPM_STBY_EN", + "STBY_POWER_PG_3V3","TH500_SHDN_OK_L","","", + /*N0-N7*/ "LED_POSTCODE_0","LED_POSTCODE_1", + "LED_POSTCODE_2","LED_POSTCODE_3", + "LED_POSTCODE_4","LED_POSTCODE_5", + "LED_POSTCODE_6","LED_POSTCODE_7", + /*O0-O7*/ "HMC_I2C3_FPGA_ALERT_L","FPGA_READY_HMC", + "CHASSIS_AC_LOSS_L","BSM_PRSNT_R_N", + "PSU_SMB_ALERT_L","FM_TPM_PRSNT_0_N", + "","USBDBG_IPMI_EN_L", + /*P0-P7*/ "PWR_BTN_BMC_N","IPEX_CABLE_PRSNT_L", + "ID_RST_BTN_BMC_N","RST_BMC_RSTBTN_OUT_N", + "host0-ready","BMC_READY_CPLD","BMC_GPIOP6","BMC_HEARTBEAT_N", + /*Q0-Q7*/ "IRQ_PCH_TPM_SPI_N","USB_OC0_REAR_R_N", + "UART_MUX_SEL","I2C_MUX_RESET_L", + "RSVD_NV_PLT_DETECT","SPI_TPM_INT_L", + "CPU_JTAG_MUX_SELECT","THERM_BB_OVERT_L", + /*R0-R7*/ "THERM_BB_WARN_L","SPI_BMC_FPGA_INT_L", + "CPU_BOOT_DONE","PMBUS_GNT_L", + "CHASSIS_PWR_BRK_L","PCIE_WAKE_L", + "PDB_THERM_OVERT_L","HMC_I2C2_FPGA_ALERT_L", + /*S0-S7*/ "","","SYS_BMC_PWRBTN_R_N","FM_TPM_PRSNT_1_N", + "FM_BMC_DEBUG_SW_N","UID_LED_N", + "SYS_FAULT_LED_N","RUN_POWER_FAULT_L", + /*T0-T7*/ "","","","","","","","", + /*U0-U7*/ "","","","","","","","", + /*V0-V7*/ "L2_RST_REQ_OUT_L","L0L1_RST_REQ_OUT_L", + "BMC_ID_BEEP_SEL","BMC_I2C0_FPGA_ALERT_L", + "SMB_BMC_TMP_ALERT","PWR_LED_N", + "SYS_RST_OUT_L","IRQ_TPM_SPI_N", + /*W0-W7*/ "","","","","","","","", + /*X0-X7*/ "","","","","","","","", + /*Y0-Y7*/ "","RST_BMC_SELF_HW", + "FM_FLASH_LATCH_N","BMC_EMMC_RST_N", + "BMC_GPIOY4","BMC_GPIOY5","","", + /*Z0-Z7*/ "","","","","","","BMC_GPIOZ6","BMC_GPIOZ7"; +}; + +&gpio1 { + gpio-line-names = + /*18A0-18A7*/ "","","","","","","","", + /*18B0-18B3*/ "","","","", + /*18B4-18B7*/ "FM_BOARD_BMC_REV_ID0","FM_BOARD_BMC_REV_ID1","FM_BOARD_BMC_REV_ID2","", + /*18C0-18C7*/ "","","PI_BMC_BIOS_ROM_IRQ0_N","","","","","", + /*18D0-18D7*/ "","","","","","","","", + /*18E0-18E3*/ "","","","AC_PWR_BMC_BTN_N","","","",""; +}; + +&i2c0 { + status = "okay"; + + i2c-mux at 71 { + compatible = "nxp,pca9546"; + reg = <0x71>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + // IOB0 NIC0 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + }; + i2c0mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + // HDD FRU EEPROM + eeprom at 56 { + compatible = "atmel,24c128"; + reg = <0x56>; + }; + + // E1.S Backplane + i2c0mux0ch1mux0: i2c-mux at 74 { + compatible = "nxp,pca9546"; + reg = <0x74>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux0ch1mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux0ch1mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + i2c0mux0ch1mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux0ch1mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + }; + i2c0mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + + // IOB0 NIC1 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + }; + i2c0mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 72 { + compatible = "nxp,pca9546"; + reg = <0x72>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux1ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux1ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + // IO Mezz 0 IOEXP + io_expander7: gpio at 20 { + compatible = "nxp,pca9535"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "RST_CX7_0", + "RST_CX7_1", + "CX0_SSD0_PRSNT_L", + "CX1_SSD1_PRSNT_L", + "CX_BOOT_CMPLT_CX0", + "CX_BOOT_CMPLT_CX1", + "CX_TWARN_CX0_L", + "CX_TWARN_CX1_L", + "CX_OVT_SHDN_CX0", + "CX_OVT_SHDN_CX1", + "FNP_L_CX0", + "FNP_L_CX1", + "", + "MCU_GPIO", + "MCU_RST_N", + "MCU_RECOVERY_N"; + }; + + // IO Mezz 0 FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + + // OSFP 0 FRU EEPROM + eeprom at 52 { + compatible = "atmel,24c128"; + reg = <0x52>; + }; + }; + i2c0mux1ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux1ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 73 { + compatible = "nxp,pca9546"; + reg = <0x73>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux2ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux2ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + i2c0mux2ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux2ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 75 { + compatible = "nxp,pca9546"; + reg = <0x75>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux3ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + // IOB1 NIC0 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + }; + i2c0mux3ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + // E1.S Backplane HDD FRU EEPROM + eeprom at 56 { + compatible = "atmel,24c128"; + reg = <0x56>; + }; + + // E1.S Backplane MUX + i2c0mux3ch1mux0: i2c-mux at 74 { + compatible = "nxp,pca9546"; + reg = <0x74>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux3ch1mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux3ch1mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + i2c0mux3ch1mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux3ch1mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + }; + i2c0mux3ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + + // IOB1 NIC1 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + }; + i2c0mux3ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 76 { + compatible = "nxp,pca9546"; + reg = <0x76>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux4ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux4ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + // IO Mezz 1 IOEXP + io_expander8: gpio at 21 { + compatible = "nxp,pca9535"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "SEC_RST_CX7_0", + "SEC_RST_CX7_1", + "SEC_CX0_SSD0_PRSNT_L", + "SEC_CX1_SSD1_PRSNT_L", + "SEC_CX_BOOT_CMPLT_CX0", + "SEC_CX_BOOT_CMPLT_CX1", + "SEC_CX_TWARN_CX0_L", + "SEC_CX_TWARN_CX1_L", + "SEC_CX_OVT_SHDN_CX0", + "SEC_CX_OVT_SHDN_CX1", + "SEC_FNP_L_CX0", + "SEC_FNP_L_CX1", + "", + "SEC_MCU_GPIO", + "SEC_MCU_RST_N", + "SEC_MCU_RECOVERY_N"; + }; + + // IO Mezz 1 FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + + // OSFP 1 FRU EEPROM + eeprom at 52 { + compatible = "atmel,24c128"; + reg = <0x52>; + }; + }; + i2c0mux4ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux4ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 77 { + compatible = "nxp,pca9546"; + reg = <0x77>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux5ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux5ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + i2c0mux5ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux5ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; +}; + +&i2c1 { + status = "okay"; + + // PDB + power-monitor at 12 { + compatible = "ti,lm5066i"; + reg = <0x12>; + }; + + // PDB + power-monitor at 14 { + compatible = "ti,lm5066i"; + reg = <0x14>; + }; + + // Module 0 + fanctl0: fan-controller at 20{ + compatible = "maxim,max31790"; + reg = <0x20>; + }; + + // Module 0 + fanctl1: fan-controller at 23{ + compatible = "maxim,max31790"; + reg = <0x23>; + }; + + // Module 1 + fanctl2: fan-controller at 2c{ + compatible = "maxim,max31790"; + reg = <0x2c>; + }; + + // Module 1 + fanctl3: fan-controller at 2f{ + compatible = "maxim,max31790"; + reg = <0x2f>; + }; + + // Module 0 Leak Sensor + adc at 34 { + compatible = "maxim,max1363"; + reg = <0x34>; + #address-cells = <1>; + #size-cells = <0>; + + channel at 0 { + reg = <0>; + ti,gain = <2>; + }; + + channel at 1 { + reg = <1>; + ti,gain = <2>; + }; + + channel at 2 { + reg = <2>; + ti,gain = <2>; + }; + + channel at 3 { + reg = <3>; + ti,gain = <2>; + }; + }; + + // Module 1 Leak Sensor + adc at 35 { + compatible = "maxim,max1363"; + reg = <0x35>; + #address-cells = <1>; + #size-cells = <0>; + + channel at 0 { + reg = <0>; + ti,gain = <2>; + }; + + channel at 1 { + reg = <1>; + ti,gain = <2>; + }; + + channel at 2 { + reg = <2>; + ti,gain = <2>; + }; + + channel at 3 { + reg = <3>; + ti,gain = <2>; + }; + }; + +// PDB TEMP SENSOR + temperature-sensor at 4e { + compatible = "ti,tmp1075"; + reg = <0x4e>; + }; + + // PDB FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c02"; + reg = <0x50>; + }; + + // PDB + vrm at 60 { + compatible = "renesas,raa228004"; + reg = <0x60>; + }; + + // PDB + vrm at 61 { + compatible = "renesas,raa228004"; + reg = <0x61>; + }; + + // Interposer + i2c-mux at 70 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x70>; + i2c-mux-idle-disconnect; + + i2c1mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0>; + }; + i2c1mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x1>; + }; + i2c1mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x2>; + }; + i2c1mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x3>; + }; + i2c1mux0ch4: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x4>; + }; + i2c1mux0ch5: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x5>; + + // Interposer TEMP SENSOR + temperature-sensor at 4f { + compatible = "ti,tmp75"; + reg = <0x4f>; + }; + + // Interposer FRU EEPROM + eeprom at 54 { + compatible = "atmel,24c64"; + reg = <0x54>; + }; + }; + i2c1mux0ch6: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x6>; + + // Interposer IOEXP + io_expander5: gpio at 27 { + compatible = "nxp,pca9554"; + reg = <0x27>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "JTAG_MUX_SEL", + "IOX_BMC_RESET", + "RTC_CLR_L", + "RTC_U77_ALRT_N", + "", + "PSU_ALERT_N", + "", + "RST_P12V_STBY_N"; + }; + }; + i2c1mux0ch7: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x7>; + + // FIO TEMP SENSOR + temperature-sensor at 4b { + compatible = "ti,tmp75"; + reg = <0x4b>; + }; + + // FIO FRU EEPROM + eeprom at 51 { + compatible = "atmel,24c64"; + reg = <0x51>; + }; + }; + }; +}; + +&i2c2 { + status = "okay"; + // Module 0, Expander @0x20 + io_expander0: gpio at 20 { + compatible = "nxp,pca9555"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "FPGA_THERM_OVERT_L-I", + "FPGA_READY_BMC-I", + "HMC_BMC_DETECT-O", + "HMC_PGOOD-O", + "", + "BMC_STBY_CYCLE-O", + "FPGA_EROT_FATAL_ERROR_L-I", + "WP_HW_EXT_CTRL_L-O", + "EROT_FPGA_RST_L-O", + "FPGA_EROT_RECOVERY_L-O", + "BMC_EROT_FPGA_SPI_MUX_SEL-O", + "USB2_HUB_RST_L-O", + "", + "SGPIO_EN_L-O", + "B2B_IOEXP_INT_L-I", + "I2C_BUS_MUX_RESET_L-O"; + }; + + // Module 1, Expander @0x21 + io_expander1: gpio at 21 { + compatible = "nxp,pca9555"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "SEC_FPGA_THERM_OVERT_L", + "SEC_FPGA_READY_BMC", + "SEC_HMC_BMC_DETECT", + "SEC_HMC_PGOOD", + "", + "SEC_BMC_SELF_POWER_CYCLE", + "SEC_SEC_FPGA_EROT_FATAL_ERROR_L", + "SEC_WP_HW_EXT_CTRL_L", + "SEC_EROT_FPGA_RST_L", + "SEC_FPGA_EROT_RECOVERY_L", + "SEC_BMC_EROT_FPGA_SPI_MUX_SEL", + "SEC_USB2_HUB_RST_L", + "", + "SEC_SGPIO_EN_L", + "SEC_IOB_IOEXP_INT_L", + "SEC_I2C_BUS_MUX_RESET_L"; + }; + + // HMC Expander @0x27 + io_expander2: gpio at 27 { + compatible = "nxp,pca9555"; + reg = <0x27>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "HMC_PRSNT_L-I", + "HMC_READY-I", + "HMC_EROT_FATAL_ERROR_L-I", + "I2C_MUX_SEL-O", + "HMC_EROT_SPI_MUX_SEL-O", + "HMC_EROT_RECOVERY_L-O", + "HMC_EROT_RST_L-O", + "GLOBAL_WP_HMC-O", + "FPGA_RST_L-O", + "USB2_HUB_RST-O", + "CPU_UART_MUX_SEL-O", + "", + "", + "", + "", + ""; + }; + + // Module 0 Aux EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + + // Module 1 Aux EEPROM + eeprom at 51 { + compatible = "atmel,24c64"; + reg = <0x51>; + }; +}; + +&i2c3 { + status = "okay"; +}; + +&i2c4 { + status = "okay"; +}; + +&i2c5 { + status = "okay"; +}; + +&i2c6 { + status = "okay"; + io_expander3: gpio at 21 { + compatible = "nxp,pca9555"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "RTC_MUX_SEL", + "PCI_MUX_SEL", + "TPM_MUX_SEL", + "FAN_MUX-SEL", + "SGMII_MUX_SEL", + "DP_MUX_SEL", + "UPHY3_USB_SEL", + "NCSI_MUX_SEL", + "BMC_PHY_RST", + "RTC_CLR_L", + "BMC_12V_CTRL", + "PS_RUN_IO0_PG", + "", + "", + "", + ""; + }; + + rtc at 6f { + compatible = "nuvoton,nct3018y"; + reg = <0x6f>; + }; +}; + +&i2c7 { + status = "okay"; +}; + +&i2c8 { + status = "okay"; +}; + +&i2c9 { + status = "okay"; + // SCM TEMP SENSOR BOARD + temperature-sensor at 4b { + compatible = "national,lm75b"; + reg = <0x4b>; + }; + + // SCM CPLD IOEXP + io_expander4: gpio at 4f { + compatible = "nxp,pca9555"; + reg = <0x4f>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "stby_power_en_cpld", + "stby_power_gd_cpld", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + ""; + }; + + // SCM FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + + // BSM FRU EEPROM + eeprom at 56 { + compatible = "atmel,24c64"; + reg = <0x56>; + }; +}; + +&i2c10 { + status = "okay"; + multi-master; + mctp-controller; + mctp at 10 { + compatible = "mctp-i2c-controller"; + reg = <(0x10 | I2C_OWN_SLAVE_ADDRESS)>; + }; + + // OCP NIC0 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + + // OCP NIC0 FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; +}; + +&i2c11 { + status = "okay"; + ssif-bmc at 10 { + compatible = "ssif-bmc"; + reg = <0x10>; + }; +}; + +&i2c12 { + status = "okay"; + multi-master; + + // HPM 1 FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + // CBC 2 FRU + eeprom at 54 { + compatible = "atmel,24c02"; + reg = <0x54>; + }; + // CBC 3 FRU + eeprom at 55 { + compatible = "atmel,24c02"; + reg = <0x55>; + }; +}; + +&i2c13 { + status = "okay"; + multi-master; + + // HPM FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + // CBC 0 FRU + eeprom at 54 { + compatible = "atmel,24c02"; + reg = <0x54>; + }; + // CBC 1 FRU + eeprom at 55 { + compatible = "atmel,24c02"; + reg = <0x55>; + }; + // HMC FRU EEPROM + eeprom at 57 { + compatible = "atmel,24c02"; + reg = <0x57>; + }; +}; + +&i2c14 { + status = "okay"; + + // PDB CPLD IOEXP 0x10 + io_expander9: gpio at 10 { + compatible = "nxp,pca9555"; + interrupt-parent = <&gpio0>; + interrupts = ; + reg = <0x10>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "wSequence_Latch_State_N", + "wP12V_N1N2_RUNTIME_FLT_N", + "wP12V_FAN_RUNTIME_FLT_N", + "wP12V_AUX_RUNTIME_FLT_N", + "wHost_PERST_SEQPWR_FLT_N", + "wP12V_N1N2_SEQPWR_FLT_N", + "wP12V_FAN_SEQPWR_FLT_N", + "wP12V_AUX_SEQPWR_FLT_N", + "wP12V_RUNTIME_FLT_NIC1_N", + "wAUX_RUNTIME_FLT_NIC1_N", + "wP12V_SEQPWR_FLT_NIC1_N", + "wAUX_SEQPWR_FLT_NIC1_N", + "wP12V_RUNTIME_FLT_NIC0_N", + "wAUX_RUNTIME_FLT_NIC0_N", + "wP12V_SEQPWR_FLT_NIC0_N", + "wAUX_SEQPWR_FLT_NIC0_N"; + }; + + // PDB CPLD IOEXP 0x11 + io_expander10: gpio at 11 { + compatible = "nxp,pca9555"; + interrupt-parent = <&gpio0>; + interrupts = ; + reg = <0x11>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "FM_P12V_NIC1_FLTB_R_N", + "FM_P3V3_NIC1_FAULT_R_N", + "FM_P12V_NIC0_FLTB_R_N", + "FM_P3V3_NIC0_FAULT_R_N", + "P48V_HS2_FAULT_N_PLD", + "P48V_HS1_FAULT_N_PLD", + "P12V_AUX_FAN_OC_PLD_N", + "P12V_AUX_FAN_FAULT_PLD_N", + "", + "", + "", + "", + "", + "FM_SYS_THROTTLE_N", + "OCP_V3_2_PWRBRK_FROM_HOST_ISO_PLD_N", + "OCP_SFF_PWRBRK_FROM_HOST_ISO_PLD_N"; + }; + + // PDB CPLD IOEXP 0x12 + io_expander11: gpio at 12 { + compatible = "nxp,pca9555"; + interrupt-parent = <&gpio0>; + interrupts = ; + reg = <0x12>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "P12V_AUX_PSU_SMB_ALERT_R_L", + "P12V_SCM_SENSE_ALERT_R_N", + "P12V_AUX_NIC1_SENSE_ALERT_R_N", + "P12V_AUX_NIC0_SENSE_ALERT_R_N", + "NODEB_PSU_SMB_ALERT_R_L", + "NODEA_PSU_SMB_ALERT_R_L", + "P12V_AUX_FAN_ALERT_PLD_N", + "P52V_SENSE_ALERT_PLD_N", + "PRSNT_RJ45_FIO_N_R", + "FM_MAIN_PWREN_RMC_EN_ISO_R", + "CHASSIS3_LEAK_Q_N_PLD", + "CHASSIS2_LEAK_Q_N_PLD", + "CHASSIS1_LEAK_Q_N_PLD", + "CHASSIS0_LEAK_Q_N_PLD", + "", + "SMB_RJ45_FIO_TMP_ALERT"; + }; + + // PDB CPLD IOEXP 0x13 + io_expander12: gpio at 13 { + compatible = "nxp,pca9555"; + interrupt-parent = <&gpio0>; + interrupts = ; + reg = <0x13>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "FAN_7_PRESENT_N", + "FAN_6_PRESENT_N", + "FAN_5_PRESENT_N", + "FAN_4_PRESENT_N", + "FAN_3_PRESENT_N", + "FAN_2_PRESENT_N", + "FAN_1_PRESENT_N", + "FAN_0_PRESENT_N", + "HP_LVC3_OCP_V3_2_PRSNT2_PLD_N", + "HP_LVC3_OCP_V3_1_PRSNT2_PLD_N", + "PRSNT_HDDBD_POWER_CABLE_N", + "PRSNT_OSFP0_POWER_CABLE_N", + "PRSNT_CHASSIS3_LEAK_CABLE_R_N", + "PRSNT_CHASSIS2_LEAK_CABLE_R_N", + "PRSNT_CHASSIS1_LEAK_CABLE_R_N", + "PRSNT_CHASSIS0_LEAK_CABLE_R_N"; + }; + + // PDB CPLD IOEXP 0x14 + io_expander13: gpio at 14 { + compatible = "nxp,pca9555"; + reg = <0x14>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "rmc_en_dc_pwr_on", + "", + "", + "", + "", + "", + "", + "", + "leak_config_0", + "leak_config_1", + "leak_config_2", + "leak_config_3", + "mfg_led_test_mode_l", + "small_leak_err_inj", + "large_leak_err_inj", + ""; + }; +}; + +&i2c15 { + status = "okay"; + multi-master; + mctp-controller; + mctp at 10 { + compatible = "mctp-i2c-controller"; + reg = <(0x10 | I2C_OWN_SLAVE_ADDRESS)>; + }; + + // OCP NIC1 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + + // OCP NIC1 FRU EEPROM + eeprom at 52 { + compatible = "atmel,24c64"; + reg = <0x52>; + }; +}; + +&mac2 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ncsi3_default>; + use-ncsi; +}; + +&mac3 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ncsi4_default>; + use-ncsi; +}; + +&udma { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; + +&uart3 { + status = "okay"; +}; + +&uart4 { + status = "okay"; +}; + +&uart5 { + status = "okay"; +}; + +&wdt1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_wdtrst1_default>; + aspeed,reset-type = "soc"; + aspeed,external-signal; + aspeed,ext-push-pull; + aspeed,ext-active-high; + aspeed,ext-pulse-duration = <256>; +}; + diff --git a/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi b/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi index 289668f051eb4271ac48ae3ce9b82587911548ee..61b1d1c5040c820f8c995132739becde80e069bb 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi +++ b/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi @@ -412,6 +412,16 @@ pinctrl_mdio4_default: mdio4_default { groups = "MDIO4"; }; + pinctrl_ncsi3_default: ncsi3_default { + function = "RMII3"; + groups = "NCSI3"; + }; + + pinctrl_ncsi4_default: ncsi4_default { + function = "RMII4"; + groups = "NCSI4"; + }; + pinctrl_ncts1_default: ncts1_default { function = "NCTS1"; groups = "NCTS1"; @@ -1192,3 +1202,4 @@ pinctrl_wdtrst4_default: wdtrst4_default { groups = "WDTRST4"; }; }; + -- 2.43.0 From leo.jt.wang at gmail.com Wed Jul 16 16:24:14 2025 From: leo.jt.wang at gmail.com (Leo Wang) Date: Wed, 16 Jul 2025 14:24:14 +0800 Subject: [PATCH v7 1/2] dt-bindings: arm: aspeed: add Meta Clemente board In-Reply-To: <20250716-add-support-for-meta-clemente-bmc-v7-0-d5bb7459c5aa@fii-foxconn.com> References: <20250716-add-support-for-meta-clemente-bmc-v7-0-d5bb7459c5aa@fii-foxconn.com> Message-ID: <20250716-add-support-for-meta-clemente-bmc-v7-1-d5bb7459c5aa@fii-foxconn.com> From: Leo Wang Document the new compatibles used on Meta Clemente. Acked-by: Conor Dooley Signed-off-by: Leo Wang --- Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml index 01333ac111fbb076582a6c0e801903c3500b459f..ff3fea63cecd99ec2dc56d3cf71403f897681a98 100644 --- a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml +++ b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml @@ -81,6 +81,7 @@ properties: - asus,x4tf-bmc - facebook,bletchley-bmc - facebook,catalina-bmc + - facebook,clemente-bmc - facebook,cloudripper-bmc - facebook,elbert-bmc - facebook,fuji-bmc -- 2.43.0 From leo.jt.wang at gmail.com Wed Jul 16 16:24:13 2025 From: leo.jt.wang at gmail.com (Leo Wang) Date: Wed, 16 Jul 2025 14:24:13 +0800 Subject: [PATCH v7 0/2] ARM: dts: Add support for Meta Clemente BMC Message-ID: <20250716-add-support-for-meta-clemente-bmc-v7-0-d5bb7459c5aa@fii-foxconn.com> This series adds initial support for the Meta Clemente BMC based on the ASPEED AST2600 SoC. Patch 1 documents the compatible string. Patch 2 adds the device tree for the board. Signed-off-by: Leo Wang --- Changes in v7: - Relocate CBC FRU EEPROMs from i2c13 to i2c12. - Link to v6: https://lore.kernel.org/r/20250708-add-support-for-meta-clemente-bmc-v6-0-7f3e57bd0336 at fii-foxconn.com Changes in v6: - Correct Author email to match Signed-off-by email address. - Link to v5: https://lore.kernel.org/r/20250627-add-support-for-meta-clemente-bmc-v5-0-038ed6f1cb9f at fii-foxconn.com Changes in v5: - Remove accidentally pasted texts. - Link to v4: https://lore.kernel.org/r/20250627-add-support-for-meta-clemente-bmc-v4-0-ce7ff23460c4 at fii-foxconn.com Changes in v4: - Move properties of nodes defined in the same file from label ref back to where they belong. - Move pinctrl default configs for ncsi3 and ncsi4 to aspeed-g6-pinctrl.dtsi. - Add properties to i2c10 and i2c15 to enable MCTP. - Link to v3: https://lore.kernel.org/r/20250623-add-support-for-meta-clemente-bmc-v3-0-c223ffcf46cf at fii-foxconn.com Changes in v3: - Modify leakage sensor to reflect current design. - Link to v2: https://lore.kernel.org/r/20250621-add-support-for-meta-clemente-bmc-v2-0-6c5ef059149c at fii-foxconn.com Changes in v2: - Fix patch 1/2 subject line to match dt-bindings convention. - Reorder device tree nodes in patch 2/2 to follow upstream DTS style. - Link to v1: https://lore.kernel.org/r/20250618-add-support-for-meta-clemente-bmc-v1-0-e5ca669ee47b at fii-foxconn.com --- Leo Wang (2): dt-bindings: arm: aspeed: add Meta Clemente board ARM: dts: aspeed: clemente: add Meta Clemente BMC .../devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + arch/arm/boot/dts/aspeed/Makefile | 1 + .../dts/aspeed/aspeed-bmc-facebook-clemente.dts | 1297 ++++++++++++++++++++ arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi | 11 + 4 files changed, 1310 insertions(+) --- base-commit: 52da431bf03b5506203bca27fe14a97895c80faf change-id: 20250618-add-support-for-meta-clemente-bmc-941a469bc523 Best regards, -- Leo Wang From jacky_chou at aspeedtech.com Wed Jul 16 13:51:11 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Wed, 16 Jul 2025 03:51:11 +0000 Subject: [PATCH v2 06/10] ARM: dts: aspeed-g6: Add PCIe RC node In-Reply-To: References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> <20250715034320.2553837-7-jacky_chou@aspeedtech.com> Message-ID: Hi Rob, Thank you for your reply. > > quality = <100>; > > }; > > > > + pcie_phy1: syscon at 1e6ed200 { > > + compatible = "aspeed,pcie-phy", > "syscon"; > > + reg = <0x1e6ed200 0x100>; > > This looks like part of something else? It should be a child of that. > > If this is the controls for the PCIe PHY, then use the PHY binding instead of your > own custom phandle property. > Our PCIe design has multiple functions. And the series of patches are submitted for PCIe RC. The other PCIe functions also use this phy node. I traced the PHY driver interface, it cannot meet our usage. Therefore, the RC driver uses the phandle property to configure. And this syscon also is used by the other PCIe functions. > > + }; > > + > > + pcie_cfg: syscon at 1e770000 { > > + compatible = "aspeed,pcie-cfg", > "syscon"; > > + reg = <0x1e770000 0x80>; > > Looks like this is really part of the PCIe block as a h/w block isn't going to start > at offset 0xc0. > > Actually. There are two PCIe bus in AST2600 We use the other one PCIe to EP mode, here I call PCIe A. I call the pcie0 node as PCIe B. We do not provide PCIe A to RC mode for usage, just EP mode. But, when PCIe A is used as RC, it reg mapping is starting from 0x1e770080. I list there mapping. 0x1e77_0000 ~ 0x1e77_007f : common usage 0x1e77_0080 ~ 0x1e77_00bf : PCIE A 0x1e77_00C0 ~ 0x1e77_00ff : PCIE B So, it is why we create one node to describe common usage for PCIe A and B. And, why the pcie0 reg mapping is starting from 0x1e77_00c0. > > + }; > > + > > + pcie0: pcie at 1e7700c0 { > > + compatible = "aspeed,ast2600-pcie"; > > + device_type = "pci"; > > + reg = <0x1e7700c0 0x40>; > > + linux,pci-domain = <0>; > > No need for this. You only have 1 PCI host. > Agreed. We only provide one RC. > > + #address-cells = <3>; > > + #size-cells = <2>; > > + interrupts = IRQ_TYPE_LEVEL_HIGH>; > > + bus-range = <0x80 0xff>; > > Does this h/w not support bus 0-0x7f for some reason? > List: PCIE A: 0-0x7f PCIE B: 0x80-0xff It is our design on PCIe B to use bus-range 0x80-0xff. > > + > > + ranges = <0x01000000 0x0 > 0x00018000 0x00018000 0x0 0x00008000 > > + 0x02000000 0x0 > 0x70000000 > > + 0x70000000 0x0 0x10000000>; > > + > > + status = "disabled"; > > + > > + resets = <&syscon > ASPEED_RESET_H2X>; > > + reset-names = "h2x"; > > + > > + #interrupt-cells = <1>; > > + msi-parent = <&pcie0>; > > + msi-controller; > > + > > + aspeed,ahbc = <&ahbc>; > > + aspeed,pciecfg = <&pcie_cfg>; > > + > > + interrupt-map-mask = <0 0 0 7>; > > + interrupt-map = <0 0 0 1 &pcie_intc0 > 0>, > > + <0 0 0 2 > &pcie_intc0 1>, > > + <0 0 0 3 > &pcie_intc0 2>, > > + <0 0 0 4 > &pcie_intc0 3>; > > + pcie_intc0: interrupt-controller { > > + interrupt-controller; > > + #address-cells = <0>; > > + #interrupt-cells = <1>; > > + }; > > + > > + pcie at 8,0 { > > + reg = <0x804000 0 0 0 0>; > > + #address-cells = <3>; > > + #size-cells = <2>; > > + device_type = "pci"; > > + resets = <&syscon > ASPEED_RESET_PCIE_RC_O>; > > + reset-names = "perst"; > > + clocks = <&syscon > ASPEED_CLK_GATE_BCLK>; > > + pinctrl-names = "default"; > > + pinctrl-0 = > <&pinctrl_pcierc1_default>; > > + aspeed,pciephy = > <&pcie_phy1>; > > + ranges; > > + }; > > + }; > > + > > gfx: display at 1e6e6000 { > > compatible = "aspeed,ast2600-gfx", > "syscon"; > > reg = <0x1e6e6000 0x1000>; > > -- > > 2.43.0 > > From ryan_chen at aspeedtech.com Thu Jul 17 12:25:38 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Thu, 17 Jul 2025 02:25:38 +0000 Subject: [PATCH v2] dt-bindings: interrupt-controller: aspeed: Add parent node compatibles and refine documentation In-Reply-To: <20250716-spotted-spirited-axolotl-c94e0b@krzk-bin> References: <20250715024258.2304665-1-ryan_chen@aspeedtech.com> <20250716-spotted-spirited-axolotl-c94e0b@krzk-bin> Message-ID: > Subject: Re: [PATCH v2] dt-bindings: interrupt-controller: aspeed: Add parent > node compatibles and refine documentation > > On Tue, Jul 15, 2025 at 10:42:58AM +0800, Ryan Chen wrote: > > - Add 'aspeed,ast2700-intc0' and 'aspeed,ast2700-intc1' compatible > > strings for parent interrupt controller nodes, in addition to the > > existing 'aspeed,ast2700-intc-ic' for child nodes. > > - Clarify the relationship and function of INTC0, INTC1, and the GIC. > > - Update and clarify documentation, block diagram, and examples to > > reflect the hierarchy and compatible usage. > > - Documentation and example refine. > > So 7 lines describing obvious - what you did and three lines below describing > non-obvious, why you did it. It should be reversed. Thanks your feedback. How about following description? The AST2700 SoC contains two independent top-level interrupt controllers (INTC0 and INTC1), each responsible for handling different peripheral groups and occupying separate register spaces. Above them, a GIC controller acts as the global interrupt aggregator. Accurately describing this hierarchical hardware structure in the device tree requires distinct compatible strings for the parent nodes of INTC0 and INTC1. - Adds 'aspeed,ast2700-intc0' and 'aspeed,ast2700-intc1' compatible strings for parent interrupt controller nodes (in addition to the existing 'aspeed,ast2700-intc-ic' for child nodes) - Clarifies the relationship and function of INTC0 parent (intc0_0~x: child), INTC1 parent (intc1_0~x: child), and the GIC in the documentation - Updates block diagrams and device tree examples to illustrate the hierarchy and compatible usage - Refines documentation and example formatting > > > > > This change allows the device tree and driver to distinguish between > > Why driver needs would matter here? > > > parent (top-level) and child (group) interrupt controller nodes, > > enabling more precise driver matching SOC register space allocation. > > This just does not make sense. You do not change "precise driver matching" via > bindings. You fix driver. Especially that there is no driver patch here at all and > aspeed,ast2700-intc0 are totally unused! > Don't add ABI which has no users. > > Again, you need to start describing the hardware and the REASONS BEHIND > from the hardware point of view. Not drivers. > > This change alone based on above explanation makes no sense at all. Next version, I will move the addition of aspeed,ast2700-intc0 and aspeed,ast2700-intc1 compatible strings into the driver patch, so they are added together with actual driver support. Thank you for your guidance. > > Best regards, > Krzysztof From robh at kernel.org Fri Jul 18 01:56:02 2025 From: robh at kernel.org (Rob Herring (Arm)) Date: Thu, 17 Jul 2025 10:56:02 -0500 Subject: [PATCH v7 0/2] ARM: dts: Add support for Meta Clemente BMC In-Reply-To: <20250716-add-support-for-meta-clemente-bmc-v7-0-d5bb7459c5aa@fii-foxconn.com> References: <20250716-add-support-for-meta-clemente-bmc-v7-0-d5bb7459c5aa@fii-foxconn.com> Message-ID: <175276729762.3490946.6491929182740244284.robh@kernel.org> On Wed, 16 Jul 2025 14:24:13 +0800, Leo Wang wrote: > This series adds initial support for the Meta Clemente BMC based on the > ASPEED AST2600 SoC. > > Patch 1 documents the compatible string. > Patch 2 adds the device tree for the board. > > Signed-off-by: Leo Wang > --- > Changes in v7: > - Relocate CBC FRU EEPROMs from i2c13 to i2c12. > - Link to v6: https://lore.kernel.org/r/20250708-add-support-for-meta-clemente-bmc-v6-0-7f3e57bd0336 at fii-foxconn.com > > Changes in v6: > - Correct Author email to match Signed-off-by email address. > - Link to v5: https://lore.kernel.org/r/20250627-add-support-for-meta-clemente-bmc-v5-0-038ed6f1cb9f at fii-foxconn.com > > Changes in v5: > - Remove accidentally pasted texts. > - Link to v4: https://lore.kernel.org/r/20250627-add-support-for-meta-clemente-bmc-v4-0-ce7ff23460c4 at fii-foxconn.com > > Changes in v4: > - Move properties of nodes defined in the same file from label ref back to where they belong. > - Move pinctrl default configs for ncsi3 and ncsi4 to aspeed-g6-pinctrl.dtsi. > - Add properties to i2c10 and i2c15 to enable MCTP. > - Link to v3: https://lore.kernel.org/r/20250623-add-support-for-meta-clemente-bmc-v3-0-c223ffcf46cf at fii-foxconn.com > > Changes in v3: > - Modify leakage sensor to reflect current design. > - Link to v2: https://lore.kernel.org/r/20250621-add-support-for-meta-clemente-bmc-v2-0-6c5ef059149c at fii-foxconn.com > > Changes in v2: > - Fix patch 1/2 subject line to match dt-bindings convention. > - Reorder device tree nodes in patch 2/2 to follow upstream DTS style. > - Link to v1: https://lore.kernel.org/r/20250618-add-support-for-meta-clemente-bmc-v1-0-e5ca669ee47b at fii-foxconn.com > > --- > Leo Wang (2): > dt-bindings: arm: aspeed: add Meta Clemente board > ARM: dts: aspeed: clemente: add Meta Clemente BMC > > .../devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + > arch/arm/boot/dts/aspeed/Makefile | 1 + > .../dts/aspeed/aspeed-bmc-facebook-clemente.dts | 1297 ++++++++++++++++++++ > arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi | 11 + > 4 files changed, 1310 insertions(+) > --- > base-commit: 52da431bf03b5506203bca27fe14a97895c80faf > change-id: 20250618-add-support-for-meta-clemente-bmc-941a469bc523 > > Best regards, > -- > Leo Wang > > > My bot found new DTB warnings on the .dts files added or changed in this series. Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments. If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date: pip3 install dtschema --upgrade This patch series was applied (using b4) to base: Base: using specified base-commit 52da431bf03b5506203bca27fe14a97895c80faf If this is not the correct base, please add 'base-commit' tag (or use b4 which does this automatically) New warnings running 'make CHECK_DTBS=y for arch/arm/boot/dts/aspeed/' for 20250716-add-support-for-meta-clemente-bmc-v7-0-d5bb7459c5aa at fii-foxconn.com: arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: timer (arm,armv7-timer): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/timer/arm,arch_timer.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /sdram at 1e6e0000: failed to match any schema with compatible: ['aspeed,ast2600-sdram-edac', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: bus at 1e600000 (aspeed,ast2600-ahbc): compatible: ['aspeed,ast2600-ahbc', 'syscon'] is too long from schema $id: http://devicetree.org/schemas/bus/aspeed,ast2600-ahbc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: syscon at 1e6e2000 (aspeed,ast2600-scu): 'smp-memram at 180' does not match any of the regexes: '^interrupt-controller@[0-9a-f]+$', '^p2a-control@[0-9a-f]+$', '^pinctrl(@[0-9a-f]+)?$', '^pinctrl-[0-9]+$', '^silicon-id@[0-9a-f]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed,ast2x00-scu.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/syscon at 1e6e2000/smp-memram at 180: failed to match any schema with compatible: ['aspeed,ast2600-smpmem'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/display at 1e6e6000: failed to match any schema with compatible: ['aspeed,ast2600-gfx', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: adc at 1e6e9000 (aspeed,ast2600-adc0): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: adc at 1e6e9100 (aspeed,ast2600-adc1): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: crypto at 1e6fa000 (aspeed,ast2600-acry): 'aspeed,ahbc' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/crypto/aspeed,ast2600-acry.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/timer at 1e782000: failed to match any schema with compatible: ['aspeed,ast2600-timer'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): reg-io-width: 4 is not of type 'object' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): lpc-snoop at 80: 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: kcs at 24 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: kcs at 28 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: kcs at 2c (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: kcs at 114 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/lpc at 1e789000/lhc at a0: failed to match any schema with compatible: ['aspeed,ast2600-lhc'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/lpc at 1e789000/ibt at 140: failed to match any schema with compatible: ['aspeed,ast2600-ibt-bmc'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740100:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740200:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740100: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740200: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dtb: syscon at 1e6e2000 (aspeed,ast2600-scu): 'smp-memram at 180' does not match any of the regexes: '^interrupt-controller@[0-9a-f]+$', '^p2a-control@[0-9a-f]+$', '^pinctrl(@[0-9a-f]+)?$', '^pinctrl-[0-9]+$', '^silicon-id@[0-9a-f]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed,ast2x00-scu.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: adc at 34 (maxim,max1363): '#address-cells', '#size-cells', 'channel at 0', 'channel at 1', 'channel at 2', 'channel at 3' do not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/maxim,max1363.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: adc at 35 (maxim,max1363): '#address-cells', '#size-cells', 'channel at 0', 'channel at 1', 'channel at 2', 'channel at 3' do not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/maxim,max1363.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-qcom-dc-scm-v1.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740200: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-ufispace-ncplite.dtb: pca9535 at 20 (nxp,pca9535): '#address-cells', '#size-cells' do not match any of the regexes: '^(hog-[0-9]+|.+-hog(-[0-9]+)?)$', '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/gpio/gpio-pca95xx.yaml#arch/arm/boot/dts/aspeed/aspeed-bmc-opp-zaius.dtb: /gpio-fsi/cfam at 0,0/hub at 3400: failed to match any schema with compatible: ['fsi-master-hub'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: fsi at 1e79b000 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/fsi at 1e79b000: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: fsi at 1e79b100 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/fsi at 1e79b100: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/dma-controller at 1e79e000: failed to match any schema with compatible: ['aspeed,ast2600-udma'] From andrew at lunn.ch Fri Jul 18 03:00:28 2025 From: andrew at lunn.ch (Andrew Lunn) Date: Thu, 17 Jul 2025 19:00:28 +0200 Subject: [PATCH v3 4/4] ARM: dts: aspeed: nvidia: gb200nvl: Enable MAC0 for BMC network In-Reply-To: <20250717-update-gb200nvl-dts-for-new-hardware-v3-4-f28145c55c98@nvidia.com> References: <20250717-update-gb200nvl-dts-for-new-hardware-v3-0-f28145c55c98@nvidia.com> <20250717-update-gb200nvl-dts-for-new-hardware-v3-4-f28145c55c98@nvidia.com> Message-ID: On Thu, Jul 17, 2025 at 09:52:13AM +0000, Willie Thai wrote: > Upstream-Status: Inappropriate Bad devices > > Signed-off-by: Deepak Kodihalli > Signed-off-by: Ed Tanous > Signed-off-by: Willie Thai Reviewed-by: Andrew Lunn Andrew From leo.jt.wang at gmail.com Fri Jul 18 00:59:00 2025 From: leo.jt.wang at gmail.com (Leo Wang) Date: Thu, 17 Jul 2025 22:59:00 +0800 Subject: [PATCH v8 2/2] ARM: dts: aspeed: clemente: add Meta Clemente BMC In-Reply-To: <20250717-add-support-for-meta-clemente-bmc-v8-0-2ff6afb36b0e@fii-foxconn.com> References: <20250717-add-support-for-meta-clemente-bmc-v8-0-2ff6afb36b0e@fii-foxconn.com> Message-ID: <20250717-add-support-for-meta-clemente-bmc-v8-2-2ff6afb36b0e@fii-foxconn.com> From: Leo Wang Add linux device tree entry for Meta Clemente compute-tray BMC using AST2600 SoC. Signed-off-by: Leo Wang --- arch/arm/boot/dts/aspeed/Makefile | 1 + .../dts/aspeed/aspeed-bmc-facebook-clemente.dts | 1295 ++++++++++++++++++++ arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi | 11 + 3 files changed, 1307 insertions(+) diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile index 2e5f4833a073b6c25190fd4b6e89a11f9636fc84..904503f78f960d7bc14cad7cb455bb8bb3138ccd 100644 --- a/arch/arm/boot/dts/aspeed/Makefile +++ b/arch/arm/boot/dts/aspeed/Makefile @@ -19,6 +19,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ aspeed-bmc-delta-ahe50dc.dtb \ aspeed-bmc-facebook-bletchley.dtb \ aspeed-bmc-facebook-catalina.dtb \ + aspeed-bmc-facebook-clemente.dtb \ aspeed-bmc-facebook-cmm.dtb \ aspeed-bmc-facebook-elbert.dtb \ aspeed-bmc-facebook-fuji.dtb \ diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dts new file mode 100644 index 0000000000000000000000000000000000000000..e6cf472630c1fc271c1505b9c13385444ed3bf8d --- /dev/null +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dts @@ -0,0 +1,1295 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Copyright (c) 2021 Facebook Inc. +/dts-v1/; + +#include "aspeed-g6.dtsi" +#include +#include +#include +#include +#include + +/ { + model = "Facebook Clemente BMC"; + compatible = "facebook,clemente-bmc", "aspeed,ast2600"; + + aliases { + serial0 = &uart1; + serial2 = &uart3; + serial3 = &uart4; + serial4 = &uart5; + i2c16 = &i2c1mux0ch0; + i2c17 = &i2c1mux0ch1; + i2c18 = &i2c1mux0ch2; + i2c19 = &i2c1mux0ch3; + i2c20 = &i2c1mux0ch4; + i2c21 = &i2c1mux0ch5; + i2c22 = &i2c1mux0ch6; + i2c23 = &i2c1mux0ch7; + i2c24 = &i2c0mux0ch0; + i2c25 = &i2c0mux0ch1; + i2c26 = &i2c0mux0ch2; + i2c27 = &i2c0mux0ch3; + i2c28 = &i2c0mux1ch0; + i2c29 = &i2c0mux1ch1; + i2c30 = &i2c0mux1ch2; + i2c31 = &i2c0mux1ch3; + i2c32 = &i2c0mux2ch0; + i2c33 = &i2c0mux2ch1; + i2c34 = &i2c0mux2ch2; + i2c35 = &i2c0mux2ch3; + i2c36 = &i2c0mux3ch0; + i2c37 = &i2c0mux3ch1; + i2c38 = &i2c0mux3ch2; + i2c39 = &i2c0mux3ch3; + i2c40 = &i2c0mux4ch0; + i2c41 = &i2c0mux4ch1; + i2c42 = &i2c0mux4ch2; + i2c43 = &i2c0mux4ch3; + i2c44 = &i2c0mux5ch0; + i2c45 = &i2c0mux5ch1; + i2c46 = &i2c0mux5ch2; + i2c47 = &i2c0mux5ch3; + i2c48 = &i2c0mux0ch1mux0ch0; + i2c49 = &i2c0mux0ch1mux0ch1; + i2c50 = &i2c0mux0ch1mux0ch2; + i2c51 = &i2c0mux0ch1mux0ch3; + i2c52 = &i2c0mux3ch1mux0ch0; + i2c53 = &i2c0mux3ch1mux0ch1; + i2c54 = &i2c0mux3ch1mux0ch2; + i2c55 = &i2c0mux3ch1mux0ch3; + }; + + chosen { + stdout-path = "serial4:57600n8"; + }; + + memory at 80000000 { + device_type = "memory"; + reg = <0x80000000 0x80000000>; + }; + + iio-hwmon { + compatible = "iio-hwmon"; + io-channels = <&adc0 0>, <&adc0 1>, <&adc0 2>, <&adc0 3>, + <&adc0 4>, <&adc0 5>, <&adc0 6>, <&adc0 7>, + <&adc1 2>; + }; + + spi1_gpio: spi { + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + sck-gpios = <&gpio0 ASPEED_GPIO(Z, 3) GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio0 ASPEED_GPIO(Z, 4) GPIO_ACTIVE_HIGH>; + miso-gpios = <&gpio0 ASPEED_GPIO(Z, 5) GPIO_ACTIVE_HIGH>; + cs-gpios = <&gpio0 ASPEED_GPIO(Z, 0) GPIO_ACTIVE_LOW>; + num-chipselects = <1>; + + tpm at 0 { + compatible = "infineon,slb9670", "tcg,tpm_tis-spi"; + spi-max-frequency = <33000000>; + reg = <0>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + label = "bmc_heartbeat_amber"; + gpios = <&gpio0 ASPEED_GPIO(P, 7) GPIO_ACTIVE_LOW>; + linux,default-trigger = "heartbeat"; + }; + + led-1 { + label = "fp_id_amber"; + default-state = "off"; + gpios = <&gpio0 ASPEED_GPIO(B, 5) GPIO_ACTIVE_HIGH>; + }; + + led-2 { + label = "bmc_ready_noled"; + gpios = <&gpio0 ASPEED_GPIO(B, 3) (GPIO_ACTIVE_HIGH|GPIO_TRANSITORY)>; + }; + + led-3 { + label = "bmc_ready_cpld_noled"; + gpios = <&gpio0 ASPEED_GPIO(P, 5) (GPIO_ACTIVE_HIGH|GPIO_TRANSITORY)>; + }; + }; + + p1v8_bmc_aux: regulator-p1v8-bmc-aux { + compatible = "regulator-fixed"; + regulator-name = "p1v8_bmc_aux"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + + p2v5_bmc_aux: regulator-p2v5-bmc-aux { + compatible = "regulator-fixed"; + regulator-name = "p2v5_bmc_aux"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + regulator-always-on; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + ramoops at b3e00000 { + compatible = "ramoops"; + reg = <0xbb000000 0x200000>; /* 16 * (4 * 0x8000) */ + record-size = <0x8000>; + console-size = <0x8000>; + ftrace-size = <0x8000>; + pmsg-size = <0x8000>; + max-reason = <3>; + }; + }; + +}; + +&adc0 { + vref-supply = <&p1v8_bmc_aux>; + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_adc0_default &pinctrl_adc1_default + &pinctrl_adc2_default &pinctrl_adc3_default + &pinctrl_adc4_default &pinctrl_adc5_default + &pinctrl_adc6_default &pinctrl_adc7_default>; +}; + +&adc1 { + vref-supply = <&p2v5_bmc_aux>; + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_adc10_default>; +}; + +&ehci0 { + status = "okay"; +}; + +&fmc { + status = "okay"; + flash at 0 { + status = "okay"; + m25p,fast-read; + label = "bmc"; + spi-max-frequency = <50000000>; +#include "openbmc-flash-layout-128.dtsi" + }; + flash at 1 { + status = "okay"; + m25p,fast-read; + label = "alt-bmc"; + spi-max-frequency = <50000000>; + }; +}; + +&gpio0 { + gpio-line-names = + /*A0-A7*/ "","","","","","","","", + /*B0-B7*/ "BATTERY_DETECT","PRSNT1_HPM_SCM_N", + "BMC_I2C1_FPGA_ALERT_L","BMC_READY", + "IOEXP_INT_L","FM_ID_LED", + "","", + /*C0-C7*/ "BMC_GPIOC0","","","", + "PMBUS_REQ_N","PSU_FW_UPDATE_REQ_N", + "","BMC_I2C_SSIF_ALERT_L", + /*D0-D7*/ "","","","","BMC_GPIOD4","","","", + /*E0-E7*/ "BMC_GPIOE0","BMC_GPIOE1","","","","","","", + /*F0-F7*/ "","","","","","","","", + /*G0-G7*/ "","","","","","", + "FM_DEBUG_PORT_PRSNT_N","FM_BMC_DBP_PRESENT_N", + /*H0-H7*/ "PWR_BRAKE_L","RUN_POWER_EN", + "SHDN_FORCE_L","SHDN_REQ_L", + "","","","", + /*I0-I7*/ "","","","", + "","FLASH_WP_STATUS", + "FM_PDB_HEALTH_N","RUN_POWER_PG", + /*J0-J7*/ "","","","","","","","", + /*K0-K7*/ "","","","","","","","", + /*L0-L7*/ "","","","","","","","", + /*M0-M7*/ "PCIE_EP_RST_EN","BMC_FRU_WP", + "SCM_HPM_STBY_RST_N","SCM_HPM_STBY_EN", + "STBY_POWER_PG_3V3","TH500_SHDN_OK_L","","", + /*N0-N7*/ "LED_POSTCODE_0","LED_POSTCODE_1", + "LED_POSTCODE_2","LED_POSTCODE_3", + "LED_POSTCODE_4","LED_POSTCODE_5", + "LED_POSTCODE_6","LED_POSTCODE_7", + /*O0-O7*/ "HMC_I2C3_FPGA_ALERT_L","FPGA_READY_HMC", + "CHASSIS_AC_LOSS_L","BSM_PRSNT_R_N", + "PSU_SMB_ALERT_L","FM_TPM_PRSNT_0_N", + "","USBDBG_IPMI_EN_L", + /*P0-P7*/ "PWR_BTN_BMC_N","IPEX_CABLE_PRSNT_L", + "ID_RST_BTN_BMC_N","RST_BMC_RSTBTN_OUT_N", + "host0-ready","BMC_READY_CPLD","BMC_GPIOP6","BMC_HEARTBEAT_N", + /*Q0-Q7*/ "IRQ_PCH_TPM_SPI_N","USB_OC0_REAR_R_N", + "UART_MUX_SEL","I2C_MUX_RESET_L", + "RSVD_NV_PLT_DETECT","SPI_TPM_INT_L", + "CPU_JTAG_MUX_SELECT","THERM_BB_OVERT_L", + /*R0-R7*/ "THERM_BB_WARN_L","SPI_BMC_FPGA_INT_L", + "CPU_BOOT_DONE","PMBUS_GNT_L", + "CHASSIS_PWR_BRK_L","PCIE_WAKE_L", + "PDB_THERM_OVERT_L","HMC_I2C2_FPGA_ALERT_L", + /*S0-S7*/ "","","SYS_BMC_PWRBTN_R_N","FM_TPM_PRSNT_1_N", + "FM_BMC_DEBUG_SW_N","UID_LED_N", + "SYS_FAULT_LED_N","RUN_POWER_FAULT_L", + /*T0-T7*/ "","","","","","","","", + /*U0-U7*/ "","","","","","","","", + /*V0-V7*/ "L2_RST_REQ_OUT_L","L0L1_RST_REQ_OUT_L", + "BMC_ID_BEEP_SEL","BMC_I2C0_FPGA_ALERT_L", + "SMB_BMC_TMP_ALERT","PWR_LED_N", + "SYS_RST_OUT_L","IRQ_TPM_SPI_N", + /*W0-W7*/ "","","","","","","","", + /*X0-X7*/ "","","","","","","","", + /*Y0-Y7*/ "","RST_BMC_SELF_HW", + "FM_FLASH_LATCH_N","BMC_EMMC_RST_N", + "BMC_GPIOY4","BMC_GPIOY5","","", + /*Z0-Z7*/ "","","","","","","BMC_GPIOZ6","BMC_GPIOZ7"; +}; + +&gpio1 { + gpio-line-names = + /*18A0-18A7*/ "","","","","","","","", + /*18B0-18B3*/ "","","","", + /*18B4-18B7*/ "FM_BOARD_BMC_REV_ID0","FM_BOARD_BMC_REV_ID1","FM_BOARD_BMC_REV_ID2","", + /*18C0-18C7*/ "","","PI_BMC_BIOS_ROM_IRQ0_N","","","","","", + /*18D0-18D7*/ "","","","","","","","", + /*18E0-18E3*/ "","","","AC_PWR_BMC_BTN_N","","","",""; +}; + +&i2c0 { + status = "okay"; + + i2c-mux at 71 { + compatible = "nxp,pca9546"; + reg = <0x71>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + // HDD FRU EEPROM + eeprom at 56 { + compatible = "atmel,24c128"; + reg = <0x56>; + }; + + // E1.S Backplane + i2c0mux0ch1mux0: i2c-mux at 74 { + compatible = "nxp,pca9546"; + reg = <0x74>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux0ch1mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux0ch1mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + i2c0mux0ch1mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux0ch1mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + }; + i2c0mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 72 { + compatible = "nxp,pca9546"; + reg = <0x72>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux1ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux1ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + // IO Mezz 0 IOEXP + io_expander7: gpio at 20 { + compatible = "nxp,pca9535"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "RST_CX7_0", + "RST_CX7_1", + "CX0_SSD0_PRSNT_L", + "CX1_SSD1_PRSNT_L", + "CX_BOOT_CMPLT_CX0", + "CX_BOOT_CMPLT_CX1", + "CX_TWARN_CX0_L", + "CX_TWARN_CX1_L", + "CX_OVT_SHDN_CX0", + "CX_OVT_SHDN_CX1", + "FNP_L_CX0", + "FNP_L_CX1", + "", + "MCU_GPIO", + "MCU_RST_N", + "MCU_RECOVERY_N"; + }; + + // IO Mezz 0 FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + + // OSFP 0 FRU EEPROM + eeprom at 52 { + compatible = "atmel,24c128"; + reg = <0x52>; + }; + }; + i2c0mux1ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux1ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 73 { + compatible = "nxp,pca9546"; + reg = <0x73>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux2ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + // IOB0 NIC0 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + }; + i2c0mux2ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + i2c0mux2ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux2ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + // IOB0 NIC1 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + }; + }; + + i2c-mux at 75 { + compatible = "nxp,pca9546"; + reg = <0x75>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux3ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux3ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + // E1.S Backplane HDD FRU EEPROM + eeprom at 56 { + compatible = "atmel,24c128"; + reg = <0x56>; + }; + + // E1.S Backplane MUX + i2c0mux3ch1mux0: i2c-mux at 74 { + compatible = "nxp,pca9546"; + reg = <0x74>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux3ch1mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux3ch1mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + i2c0mux3ch1mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux3ch1mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + }; + i2c0mux3ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux3ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 76 { + compatible = "nxp,pca9546"; + reg = <0x76>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux4ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux4ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + // IO Mezz 1 IOEXP + io_expander8: gpio at 21 { + compatible = "nxp,pca9535"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "SEC_RST_CX7_0", + "SEC_RST_CX7_1", + "SEC_CX0_SSD0_PRSNT_L", + "SEC_CX1_SSD1_PRSNT_L", + "SEC_CX_BOOT_CMPLT_CX0", + "SEC_CX_BOOT_CMPLT_CX1", + "SEC_CX_TWARN_CX0_L", + "SEC_CX_TWARN_CX1_L", + "SEC_CX_OVT_SHDN_CX0", + "SEC_CX_OVT_SHDN_CX1", + "SEC_FNP_L_CX0", + "SEC_FNP_L_CX1", + "", + "SEC_MCU_GPIO", + "SEC_MCU_RST_N", + "SEC_MCU_RECOVERY_N"; + }; + + // IO Mezz 1 FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + + // OSFP 1 FRU EEPROM + eeprom at 52 { + compatible = "atmel,24c128"; + reg = <0x52>; + }; + }; + i2c0mux4ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux4ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 77 { + compatible = "nxp,pca9546"; + reg = <0x77>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux5ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + // IOB1 NIC0 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + }; + i2c0mux5ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + i2c0mux5ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux5ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + // IOB1 NIC1 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + }; + }; +}; + +&i2c1 { + status = "okay"; + + // PDB + power-monitor at 12 { + compatible = "ti,lm5066i"; + reg = <0x12>; + }; + + // PDB + power-monitor at 14 { + compatible = "ti,lm5066i"; + reg = <0x14>; + }; + + // Module 0 + fanctl0: fan-controller at 20{ + compatible = "maxim,max31790"; + reg = <0x20>; + }; + + // Module 0 + fanctl1: fan-controller at 23{ + compatible = "maxim,max31790"; + reg = <0x23>; + }; + + // Module 1 + fanctl2: fan-controller at 2c{ + compatible = "maxim,max31790"; + reg = <0x2c>; + }; + + // Module 1 + fanctl3: fan-controller at 2f{ + compatible = "maxim,max31790"; + reg = <0x2f>; + }; + + // Module 0 Leak Sensor + adc at 34 { + compatible = "maxim,max1363"; + reg = <0x34>; + #address-cells = <1>; + #size-cells = <0>; + + channel at 0 { + reg = <0>; + ti,gain = <2>; + }; + + channel at 1 { + reg = <1>; + ti,gain = <2>; + }; + + channel at 2 { + reg = <2>; + ti,gain = <2>; + }; + + channel at 3 { + reg = <3>; + ti,gain = <2>; + }; + }; + + // Module 1 Leak Sensor + adc at 35 { + compatible = "maxim,max1363"; + reg = <0x35>; + #address-cells = <1>; + #size-cells = <0>; + + channel at 0 { + reg = <0>; + ti,gain = <2>; + }; + + channel at 1 { + reg = <1>; + ti,gain = <2>; + }; + + channel at 2 { + reg = <2>; + ti,gain = <2>; + }; + + channel at 3 { + reg = <3>; + ti,gain = <2>; + }; + }; + +// PDB TEMP SENSOR + temperature-sensor at 4e { + compatible = "ti,tmp1075"; + reg = <0x4e>; + }; + + // PDB FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c02"; + reg = <0x50>; + }; + + // PDB + vrm at 60 { + compatible = "renesas,raa228004"; + reg = <0x60>; + }; + + // PDB + vrm at 61 { + compatible = "renesas,raa228004"; + reg = <0x61>; + }; + + // Interposer + i2c-mux at 70 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x70>; + i2c-mux-idle-disconnect; + + i2c1mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0>; + }; + i2c1mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x1>; + }; + i2c1mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x2>; + }; + i2c1mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x3>; + }; + i2c1mux0ch4: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x4>; + }; + i2c1mux0ch5: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x5>; + + // Interposer TEMP SENSOR + temperature-sensor at 4f { + compatible = "ti,tmp75"; + reg = <0x4f>; + }; + + // Interposer FRU EEPROM + eeprom at 54 { + compatible = "atmel,24c64"; + reg = <0x54>; + }; + }; + i2c1mux0ch6: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x6>; + + // Interposer IOEXP + io_expander5: gpio at 27 { + compatible = "nxp,pca9554"; + reg = <0x27>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "JTAG_MUX_SEL", + "IOX_BMC_RESET", + "RTC_CLR_L", + "RTC_U77_ALRT_N", + "", + "PSU_ALERT_N", + "", + "RST_P12V_STBY_N"; + }; + }; + i2c1mux0ch7: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x7>; + + // FIO TEMP SENSOR + temperature-sensor at 4b { + compatible = "ti,tmp75"; + reg = <0x4b>; + }; + + // FIO FRU EEPROM + eeprom at 51 { + compatible = "atmel,24c64"; + reg = <0x51>; + }; + }; + }; +}; + +&i2c2 { + status = "okay"; + // Module 0, Expander @0x20 + io_expander0: gpio at 20 { + compatible = "nxp,pca9555"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "FPGA_THERM_OVERT_L-I", + "FPGA_READY_BMC-I", + "HMC_BMC_DETECT-O", + "HMC_PGOOD-O", + "", + "BMC_STBY_CYCLE-O", + "FPGA_EROT_FATAL_ERROR_L-I", + "WP_HW_EXT_CTRL_L-O", + "EROT_FPGA_RST_L-O", + "FPGA_EROT_RECOVERY_L-O", + "BMC_EROT_FPGA_SPI_MUX_SEL-O", + "USB2_HUB_RST_L-O", + "", + "SGPIO_EN_L-O", + "B2B_IOEXP_INT_L-I", + "I2C_BUS_MUX_RESET_L-O"; + }; + + // Module 1, Expander @0x21 + io_expander1: gpio at 21 { + compatible = "nxp,pca9555"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "SEC_FPGA_THERM_OVERT_L", + "SEC_FPGA_READY_BMC", + "SEC_HMC_BMC_DETECT", + "SEC_HMC_PGOOD", + "", + "SEC_BMC_SELF_POWER_CYCLE", + "SEC_SEC_FPGA_EROT_FATAL_ERROR_L", + "SEC_WP_HW_EXT_CTRL_L", + "SEC_EROT_FPGA_RST_L", + "SEC_FPGA_EROT_RECOVERY_L", + "SEC_BMC_EROT_FPGA_SPI_MUX_SEL", + "SEC_USB2_HUB_RST_L", + "", + "SEC_SGPIO_EN_L", + "SEC_IOB_IOEXP_INT_L", + "SEC_I2C_BUS_MUX_RESET_L"; + }; + + // HMC Expander @0x27 + io_expander2: gpio at 27 { + compatible = "nxp,pca9555"; + reg = <0x27>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "HMC_PRSNT_L-I", + "HMC_READY-I", + "HMC_EROT_FATAL_ERROR_L-I", + "I2C_MUX_SEL-O", + "HMC_EROT_SPI_MUX_SEL-O", + "HMC_EROT_RECOVERY_L-O", + "HMC_EROT_RST_L-O", + "GLOBAL_WP_HMC-O", + "FPGA_RST_L-O", + "USB2_HUB_RST-O", + "CPU_UART_MUX_SEL-O", + "", + "", + "", + "", + ""; + }; + + // Module 0 Aux EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + + // Module 1 Aux EEPROM + eeprom at 51 { + compatible = "atmel,24c64"; + reg = <0x51>; + }; +}; + +&i2c3 { + status = "okay"; +}; + +&i2c4 { + status = "okay"; +}; + +&i2c5 { + status = "okay"; +}; + +&i2c6 { + status = "okay"; + io_expander3: gpio at 21 { + compatible = "nxp,pca9555"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "RTC_MUX_SEL", + "PCI_MUX_SEL", + "TPM_MUX_SEL", + "FAN_MUX-SEL", + "SGMII_MUX_SEL", + "DP_MUX_SEL", + "UPHY3_USB_SEL", + "NCSI_MUX_SEL", + "BMC_PHY_RST", + "RTC_CLR_L", + "BMC_12V_CTRL", + "PS_RUN_IO0_PG", + "", + "", + "", + ""; + }; + + rtc at 6f { + compatible = "nuvoton,nct3018y"; + reg = <0x6f>; + }; +}; + +&i2c7 { + status = "okay"; +}; + +&i2c8 { + status = "okay"; +}; + +&i2c9 { + status = "okay"; + // SCM TEMP SENSOR BOARD + temperature-sensor at 4b { + compatible = "national,lm75b"; + reg = <0x4b>; + }; + + // SCM CPLD IOEXP + io_expander4: gpio at 4f { + compatible = "nxp,pca9555"; + reg = <0x4f>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "stby_power_en_cpld", + "stby_power_gd_cpld", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + ""; + }; + + // SCM FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + + // BSM FRU EEPROM + eeprom at 56 { + compatible = "atmel,24c64"; + reg = <0x56>; + }; +}; + +&i2c10 { + status = "okay"; + multi-master; + mctp-controller; + mctp at 10 { + compatible = "mctp-i2c-controller"; + reg = <(0x10 | I2C_OWN_SLAVE_ADDRESS)>; + }; + + // OCP NIC0 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + + // OCP NIC0 FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; +}; + +&i2c11 { + status = "okay"; + aspeed,enable-byte; + + ssif-bmc at 10 { + compatible = "ssif-bmc"; + reg = <0x10>; + }; +}; + +&i2c12 { + status = "okay"; + multi-master; + + // HPM 1 FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + // CBC 2 FRU + eeprom at 54 { + compatible = "atmel,24c02"; + reg = <0x54>; + }; + // CBC 3 FRU + eeprom at 55 { + compatible = "atmel,24c02"; + reg = <0x55>; + }; +}; + +&i2c13 { + status = "okay"; + multi-master; + + // HPM FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + // CBC 0 FRU + eeprom at 54 { + compatible = "atmel,24c02"; + reg = <0x54>; + }; + // CBC 1 FRU + eeprom at 55 { + compatible = "atmel,24c02"; + reg = <0x55>; + }; + // HMC FRU EEPROM + eeprom at 57 { + compatible = "atmel,24c02"; + reg = <0x57>; + }; +}; + +&i2c14 { + status = "okay"; + + // PDB CPLD IOEXP 0x10 + io_expander9: gpio at 10 { + compatible = "nxp,pca9555"; + interrupt-parent = <&gpio0>; + interrupts = ; + reg = <0x10>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "wSequence_Latch_State_N", + "wP12V_N1N2_RUNTIME_FLT_N", + "wP12V_FAN_RUNTIME_FLT_N", + "wP12V_AUX_RUNTIME_FLT_N", + "wHost_PERST_SEQPWR_FLT_N", + "wP12V_N1N2_SEQPWR_FLT_N", + "wP12V_FAN_SEQPWR_FLT_N", + "wP12V_AUX_SEQPWR_FLT_N", + "wP12V_RUNTIME_FLT_NIC1_N", + "wAUX_RUNTIME_FLT_NIC1_N", + "wP12V_SEQPWR_FLT_NIC1_N", + "wAUX_SEQPWR_FLT_NIC1_N", + "wP12V_RUNTIME_FLT_NIC0_N", + "wAUX_RUNTIME_FLT_NIC0_N", + "wP12V_SEQPWR_FLT_NIC0_N", + "wAUX_SEQPWR_FLT_NIC0_N"; + }; + + // PDB CPLD IOEXP 0x11 + io_expander10: gpio at 11 { + compatible = "nxp,pca9555"; + interrupt-parent = <&gpio0>; + interrupts = ; + reg = <0x11>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "FM_P12V_NIC1_FLTB_R_N", + "FM_P3V3_NIC1_FAULT_R_N", + "FM_P12V_NIC0_FLTB_R_N", + "FM_P3V3_NIC0_FAULT_R_N", + "P48V_HS2_FAULT_N_PLD", + "P48V_HS1_FAULT_N_PLD", + "P12V_AUX_FAN_OC_PLD_N", + "P12V_AUX_FAN_FAULT_PLD_N", + "", + "", + "", + "", + "", + "FM_SYS_THROTTLE_N", + "OCP_V3_2_PWRBRK_FROM_HOST_ISO_PLD_N", + "OCP_SFF_PWRBRK_FROM_HOST_ISO_PLD_N"; + }; + + // PDB CPLD IOEXP 0x12 + io_expander11: gpio at 12 { + compatible = "nxp,pca9555"; + interrupt-parent = <&gpio0>; + interrupts = ; + reg = <0x12>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "P12V_AUX_PSU_SMB_ALERT_R_L", + "P12V_SCM_SENSE_ALERT_R_N", + "P12V_AUX_NIC1_SENSE_ALERT_R_N", + "P12V_AUX_NIC0_SENSE_ALERT_R_N", + "NODEB_PSU_SMB_ALERT_R_L", + "NODEA_PSU_SMB_ALERT_R_L", + "P12V_AUX_FAN_ALERT_PLD_N", + "P52V_SENSE_ALERT_PLD_N", + "PRSNT_RJ45_FIO_N_R", + "FM_MAIN_PWREN_RMC_EN_ISO_R", + "CHASSIS3_LEAK_Q_N_PLD", + "CHASSIS2_LEAK_Q_N_PLD", + "CHASSIS1_LEAK_Q_N_PLD", + "CHASSIS0_LEAK_Q_N_PLD", + "", + "SMB_RJ45_FIO_TMP_ALERT"; + }; + + // PDB CPLD IOEXP 0x13 + io_expander12: gpio at 13 { + compatible = "nxp,pca9555"; + interrupt-parent = <&gpio0>; + interrupts = ; + reg = <0x13>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "FAN_7_PRESENT_N", + "FAN_6_PRESENT_N", + "FAN_5_PRESENT_N", + "FAN_4_PRESENT_N", + "FAN_3_PRESENT_N", + "FAN_2_PRESENT_N", + "FAN_1_PRESENT_N", + "FAN_0_PRESENT_N", + "HP_LVC3_OCP_V3_2_PRSNT2_PLD_N", + "HP_LVC3_OCP_V3_1_PRSNT2_PLD_N", + "PRSNT_HDDBD_POWER_CABLE_N", + "PRSNT_OSFP0_POWER_CABLE_N", + "PRSNT_CHASSIS3_LEAK_CABLE_R_N", + "PRSNT_CHASSIS2_LEAK_CABLE_R_N", + "PRSNT_CHASSIS1_LEAK_CABLE_R_N", + "PRSNT_CHASSIS0_LEAK_CABLE_R_N"; + }; + + // PDB CPLD IOEXP 0x14 + io_expander13: gpio at 14 { + compatible = "nxp,pca9555"; + reg = <0x14>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "rmc_en_dc_pwr_on", + "", + "", + "", + "", + "", + "", + "", + "leak_config_0", + "leak_config_1", + "leak_config_2", + "leak_config_3", + "mfg_led_test_mode_l", + "small_leak_err_inj", + "large_leak_err_inj", + ""; + }; +}; + +&i2c15 { + status = "okay"; + multi-master; + mctp-controller; + mctp at 10 { + compatible = "mctp-i2c-controller"; + reg = <(0x10 | I2C_OWN_SLAVE_ADDRESS)>; + }; + + // OCP NIC1 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + + // OCP NIC1 FRU EEPROM + eeprom at 52 { + compatible = "atmel,24c64"; + reg = <0x52>; + }; +}; + +&mac2 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ncsi3_default>; + use-ncsi; +}; + +&mac3 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ncsi4_default>; + use-ncsi; +}; + +&udma { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; + +&uart3 { + status = "okay"; +}; + +&uart4 { + status = "okay"; +}; + +&uart5 { + status = "okay"; +}; + +&wdt1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_wdtrst1_default>; + aspeed,reset-type = "soc"; + aspeed,external-signal; + aspeed,ext-push-pull; + aspeed,ext-active-high; + aspeed,ext-pulse-duration = <256>; +}; + diff --git a/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi b/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi index 289668f051eb4271ac48ae3ce9b82587911548ee..61b1d1c5040c820f8c995132739becde80e069bb 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi +++ b/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi @@ -412,6 +412,16 @@ pinctrl_mdio4_default: mdio4_default { groups = "MDIO4"; }; + pinctrl_ncsi3_default: ncsi3_default { + function = "RMII3"; + groups = "NCSI3"; + }; + + pinctrl_ncsi4_default: ncsi4_default { + function = "RMII4"; + groups = "NCSI4"; + }; + pinctrl_ncts1_default: ncts1_default { function = "NCTS1"; groups = "NCTS1"; @@ -1192,3 +1202,4 @@ pinctrl_wdtrst4_default: wdtrst4_default { groups = "WDTRST4"; }; }; + -- 2.43.0 From leo.jt.wang at gmail.com Fri Jul 18 00:58:59 2025 From: leo.jt.wang at gmail.com (Leo Wang) Date: Thu, 17 Jul 2025 22:58:59 +0800 Subject: [PATCH v8 1/2] dt-bindings: arm: aspeed: add Meta Clemente board In-Reply-To: <20250717-add-support-for-meta-clemente-bmc-v8-0-2ff6afb36b0e@fii-foxconn.com> References: <20250717-add-support-for-meta-clemente-bmc-v8-0-2ff6afb36b0e@fii-foxconn.com> Message-ID: <20250717-add-support-for-meta-clemente-bmc-v8-1-2ff6afb36b0e@fii-foxconn.com> From: Leo Wang Document the new compatibles used on Meta Clemente. Acked-by: Conor Dooley Signed-off-by: Leo Wang --- Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml index 01333ac111fbb076582a6c0e801903c3500b459f..ff3fea63cecd99ec2dc56d3cf71403f897681a98 100644 --- a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml +++ b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml @@ -81,6 +81,7 @@ properties: - asus,x4tf-bmc - facebook,bletchley-bmc - facebook,catalina-bmc + - facebook,clemente-bmc - facebook,cloudripper-bmc - facebook,elbert-bmc - facebook,fuji-bmc -- 2.43.0 From leo.jt.wang at gmail.com Fri Jul 18 00:58:58 2025 From: leo.jt.wang at gmail.com (Leo Wang) Date: Thu, 17 Jul 2025 22:58:58 +0800 Subject: [PATCH v8 0/2] ARM: dts: Add support for Meta Clemente BMC Message-ID: <20250717-add-support-for-meta-clemente-bmc-v8-0-2ff6afb36b0e@fii-foxconn.com> This series adds initial support for the Meta Clemente BMC based on the ASPEED AST2600 SoC. Patch 1 documents the compatible string. Patch 2 adds the device tree for the board. Signed-off-by: Leo Wang --- Changes in v8: - Relocate IOBx_NICx_TEMP TMP421 sensors - Enable byte mode for i2c11 - Link to v7: https://lore.kernel.org/r/20250716-add-support-for-meta-clemente-bmc-v7-0-d5bb7459c5aa at fii-foxconn.com Changes in v7: - Relocate CBC FRU EEPROMs from i2c13 to i2c12. - Link to v6: https://lore.kernel.org/r/20250708-add-support-for-meta-clemente-bmc-v6-0-7f3e57bd0336 at fii-foxconn.com Changes in v6: - Correct Author email to match Signed-off-by email address. - Link to v5: https://lore.kernel.org/r/20250627-add-support-for-meta-clemente-bmc-v5-0-038ed6f1cb9f at fii-foxconn.com Changes in v5: - Remove accidentally pasted texts. - Link to v4: https://lore.kernel.org/r/20250627-add-support-for-meta-clemente-bmc-v4-0-ce7ff23460c4 at fii-foxconn.com Changes in v4: - Move properties of nodes defined in the same file from label ref back to where they belong. - Move pinctrl default configs for ncsi3 and ncsi4 to aspeed-g6-pinctrl.dtsi. - Add properties to i2c10 and i2c15 to enable MCTP. - Link to v3: https://lore.kernel.org/r/20250623-add-support-for-meta-clemente-bmc-v3-0-c223ffcf46cf at fii-foxconn.com Changes in v3: - Modify leakage sensor to reflect current design. - Link to v2: https://lore.kernel.org/r/20250621-add-support-for-meta-clemente-bmc-v2-0-6c5ef059149c at fii-foxconn.com Changes in v2: - Fix patch 1/2 subject line to match dt-bindings convention. - Reorder device tree nodes in patch 2/2 to follow upstream DTS style. - Link to v1: https://lore.kernel.org/r/20250618-add-support-for-meta-clemente-bmc-v1-0-e5ca669ee47b at fii-foxconn.com --- Leo Wang (2): dt-bindings: arm: aspeed: add Meta Clemente board ARM: dts: aspeed: clemente: add Meta Clemente BMC .../devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + arch/arm/boot/dts/aspeed/Makefile | 1 + .../dts/aspeed/aspeed-bmc-facebook-clemente.dts | 1295 ++++++++++++++++++++ arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi | 11 + 4 files changed, 1308 insertions(+) --- base-commit: 52da431bf03b5506203bca27fe14a97895c80faf change-id: 20250618-add-support-for-meta-clemente-bmc-941a469bc523 Best regards, -- Leo Wang From wthai at nvidia.com Thu Jul 17 19:52:13 2025 From: wthai at nvidia.com (Willie Thai) Date: Thu, 17 Jul 2025 09:52:13 +0000 Subject: [PATCH v3 4/4] ARM: dts: aspeed: nvidia: gb200nvl: Enable MAC0 for BMC network In-Reply-To: <20250717-update-gb200nvl-dts-for-new-hardware-v3-0-f28145c55c98@nvidia.com> References: <20250717-update-gb200nvl-dts-for-new-hardware-v3-0-f28145c55c98@nvidia.com> Message-ID: <20250717-update-gb200nvl-dts-for-new-hardware-v3-4-f28145c55c98@nvidia.com> Upstream-Status: Inappropriate Bad devices Signed-off-by: Deepak Kodihalli Signed-off-by: Ed Tanous Signed-off-by: Willie Thai --- Changes v2 -> v3: - Remove max-speed setting as it is not necessary [Andrew Lunn] --- --- .../dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts index dd2a02a6d1d40cd3fe99af83123a7a3a67149a69..72dafebc080d5ab30a100450fb04c688cd805844 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts @@ -227,6 +227,30 @@ &uart_routing { status = "okay"; }; +&mdio0 { + status = "okay"; + ethphy0: ethernet-phy at 0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + }; +}; + +&mdio3 { + status = "okay"; + ethphy3: ethernet-phy at 2 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <2>; + }; +}; + +&mac0 { + status = "okay"; + pinctrl-names = "default"; + phy-mode = "rgmii-id"; + phy-handle = <ðphy3>; + pinctrl-0 = <&pinctrl_rgmii1_default>; +}; + &mac2 { status = "okay"; phy-mode = "rmii"; -- 2.25.1 From wthai at nvidia.com Thu Jul 17 19:52:12 2025 From: wthai at nvidia.com (Willie Thai) Date: Thu, 17 Jul 2025 09:52:12 +0000 Subject: [PATCH v3 3/4] ARM: dts: aspeed: nvidia: gb200nvl: Repurpose the HMC gpio pin In-Reply-To: <20250717-update-gb200nvl-dts-for-new-hardware-v3-0-f28145c55c98@nvidia.com> References: <20250717-update-gb200nvl-dts-for-new-hardware-v3-0-f28145c55c98@nvidia.com> Message-ID: <20250717-update-gb200nvl-dts-for-new-hardware-v3-3-f28145c55c98@nvidia.com> Repurpose the HMC reset pin to FPGA reset pin. This change is according to hardware change. Signed-off-by: Deepak Kodihalli Signed-off-by: Ed Tanous Signed-off-by: Willie Thai --- arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts index f0a18adc328759e290bc354ad8ef703f28c1ffe8..dd2a02a6d1d40cd3fe99af83123a7a3a67149a69 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts @@ -1126,7 +1126,7 @@ &gpio0 { /*J0-J7*/ "", "", "", "", "", "", "", "", /*K0-K7*/ "", "", "", "", "", "", "", "", /*L0-L7*/ "", "", "", "", "", "", "", "", - /*M0-M7*/ "PCIE_EP_RST_EN-O", "BMC_FRU_WP-O", "HMC_RESET_L-O", "STBY_POWER_EN-O", + /*M0-M7*/ "PCIE_EP_RST_EN-O", "BMC_FRU_WP-O", "FPGA_RST_L-O", "STBY_POWER_EN-O", "STBY_POWER_PG-I", "PCIE_EP_RST_L-O", "", "", /*N0-N7*/ "", "", "", "", "", "", "", "", /*O0-O7*/ "", "", "", "", "", "", "", "", -- 2.25.1 From wthai at nvidia.com Thu Jul 17 19:52:10 2025 From: wthai at nvidia.com (Willie Thai) Date: Thu, 17 Jul 2025 09:52:10 +0000 Subject: [PATCH v3 1/4] ARM: dts: aspeed: nvidia: gb200nvl: Add VCC Supply In-Reply-To: <20250717-update-gb200nvl-dts-for-new-hardware-v3-0-f28145c55c98@nvidia.com> References: <20250717-update-gb200nvl-dts-for-new-hardware-v3-0-f28145c55c98@nvidia.com> Message-ID: <20250717-update-gb200nvl-dts-for-new-hardware-v3-1-f28145c55c98@nvidia.com> Add Vcc supply to avoid probing the devices before they have power. Signed-off-by: Deepak Kodihalli Signed-off-by: Ed Tanous Signed-off-by: Willie Thai --- Changes v1 -> v2: - Fix unevaluated vcc-supply properties [Rob Herring] --- --- .../dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts index 41e3e9dd85f571254a08d40e68c0d8f8f049256b..bd9395a194137ea70d184665ad6cb659541ef175 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts @@ -126,6 +126,17 @@ button-uid { gpio = <&sgpiom0 154 GPIO_ACTIVE_LOW>; }; }; + + standby_power_regulator: standby-power-regulator { + status = "okay"; + compatible = "regulator-fixed"; + regulator-name = "standby_power"; + gpio = <&gpio0 ASPEED_GPIO(M, 3) GPIO_ACTIVE_HIGH>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + enable-active-high; + regulator-always-on; + }; }; // Enable Primary flash on FMC for bring up activity @@ -431,6 +442,7 @@ exp4: gpio at 21 { #interrupt-cells = <2>; interrupt-parent = <&gpio1>; interrupts = ; + vcc-supply = <&standby_power_regulator>; gpio-line-names = "RTC_MUX_SEL-O", "PCI_MUX_SEL-O", @@ -464,6 +476,7 @@ i2c-mux at 71 { #size-cells = <0>; reg = <0x71>; i2c-mux-idle-disconnect; + vdd-supply = <&standby_power_regulator>; imux16: i2c at 0 { #address-cells = <1>; @@ -528,6 +541,7 @@ i2c-mux at 72 { #size-cells = <0>; reg = <0x72>; i2c-mux-idle-disconnect; + vdd-supply = <&standby_power_regulator>; imux20: i2c at 0 { #address-cells = <1>; @@ -545,6 +559,7 @@ gpio at 21 { reg = <0x21>; gpio-controller; #gpio-cells = <2>; + vcc-supply = <&standby_power_regulator>; gpio-line-names = "RST_CX_0_L-O", "RST_CX_1_L-O", @@ -584,6 +599,7 @@ i2c-mux at 73 { #size-cells = <0>; reg = <0x73>; i2c-mux-idle-disconnect; + vdd-supply = <&standby_power_regulator>; imux24: i2c at 0 { #address-cells = <1>; @@ -602,6 +618,7 @@ i2c-mux at 70 { #size-cells = <0>; reg = <0x70>; i2c-mux-idle-disconnect; + vdd-supply = <&standby_power_regulator>; i2c25mux0: i2c at 0 { #address-cells = <1>; @@ -648,6 +665,7 @@ i2c-mux at 75 { #size-cells = <0>; reg = <0x75>; i2c-mux-idle-disconnect; + vdd-supply = <&standby_power_regulator>; imux28: i2c at 0 { #address-cells = <1>; @@ -712,6 +730,7 @@ i2c-mux at 76 { #size-cells = <0>; reg = <0x76>; i2c-mux-idle-disconnect; + vdd-supply = <&standby_power_regulator>; imux32: i2c at 0 { #address-cells = <1>; @@ -729,6 +748,7 @@ gpio at 21 { reg = <0x21>; gpio-controller; #gpio-cells = <2>; + vcc-supply = <&standby_power_regulator>; gpio-line-names = "SEC_RST_CX_0_L-O", "SEC_RST_CX_1_L-O", @@ -768,6 +788,7 @@ i2c-mux at 77 { #size-cells = <0>; reg = <0x77>; i2c-mux-idle-disconnect; + vdd-supply = <&standby_power_regulator>; imux36: i2c at 0 { #address-cells = <1>; @@ -862,6 +883,7 @@ exp0: gpio at 20 { #interrupt-cells = <2>; interrupt-parent = <&gpio1>; interrupts = ; + vcc-supply = <&standby_power_regulator>; gpio-line-names = "FPGA_THERM_OVERT_L-I", "FPGA_READY_BMC-I", @@ -891,6 +913,7 @@ exp1: gpio at 21 { #interrupt-cells = <2>; interrupt-parent = <&gpio1>; interrupts = ; + vcc-supply = <&standby_power_regulator>; gpio-line-names = "SEC_FPGA_THERM_OVERT_L-I", "SEC_FPGA_READY_BMC-I", @@ -949,6 +972,7 @@ exp3: gpio at 74 { #interrupt-cells = <2>; interrupt-parent = <&gpio1>; interrupts = ; + vcc-supply = <&standby_power_regulator>; gpio-line-names = "IOB_PRSNT_L", "IOB_DP_HPD", @@ -1014,6 +1038,7 @@ i2c-mux at 77 { #size-cells = <0>; reg = <0x77>; i2c-mux-idle-disconnect; + vdd-supply = <&standby_power_regulator>; e1si2c0: i2c at 0 { #address-cells = <1>; @@ -1054,6 +1079,7 @@ i2c-mux at 77 { #size-cells = <0>; reg = <0x77>; i2c-mux-idle-disconnect; + vdd-supply = <&standby_power_regulator>; e1si2c4: i2c at 0 { #address-cells = <1>; -- 2.25.1 From wthai at nvidia.com Thu Jul 17 19:52:11 2025 From: wthai at nvidia.com (Willie Thai) Date: Thu, 17 Jul 2025 09:52:11 +0000 Subject: [PATCH v3 2/4] ARM: dts: aspeed: nvidia: gb200nvl: Enable i2c3 bus In-Reply-To: <20250717-update-gb200nvl-dts-for-new-hardware-v3-0-f28145c55c98@nvidia.com> References: <20250717-update-gb200nvl-dts-for-new-hardware-v3-0-f28145c55c98@nvidia.com> Message-ID: <20250717-update-gb200nvl-dts-for-new-hardware-v3-2-f28145c55c98@nvidia.com> Enable i2c3 bus for telemetry fetching purpose. Signed-off-by: Deepak Kodihalli Signed-off-by: Ed Tanous Signed-off-by: Willie Thai --- Changes v1 -> v2: - Fix unevaluated vcc-supply properties [Rob Herring] --- --- arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts index bd9395a194137ea70d184665ad6cb659541ef175..f0a18adc328759e290bc354ad8ef703f28c1ffe8 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts @@ -422,7 +422,7 @@ &i2c2 { // I2C4 &i2c3 { - status = "disabled"; + status = "okay"; }; // I2C5 -- 2.25.1 From wthai at nvidia.com Thu Jul 17 19:52:09 2025 From: wthai at nvidia.com (Willie Thai) Date: Thu, 17 Jul 2025 09:52:09 +0000 Subject: [PATCH v3 0/4] ARM: dts: aspeed: nvidia: Update DTS to support GB200NVL hardware Message-ID: <20250717-update-gb200nvl-dts-for-new-hardware-v3-0-f28145c55c98@nvidia.com> Update the DTS file for the GB200NVL hardware change. Signed-off-by: Deepak Kodihalli Signed-off-by: Ed Tanous Signed-off-by: Leo Huang Signed-off-by: Willie Thai --- Changes v1 -> v2: - Fix unevaluated vcc-supply properties [Rob Herring] - Add MAC0 [Deepak Kodihalli] Changes v2-> v3: - Remove max-speed setting as it is not necessary [Andrew Lunn] --- --- Willie Thai (4): ARM: dts: aspeed: nvidia: gb200nvl: Add VCC Supply ARM: dts: aspeed: nvidia: gb200nvl: Enable i2c3 bus ARM: dts: aspeed: nvidia: gb200nvl: Repurpose the HMC gpio pin ARM: dts: aspeed: nvidia: gb200nvl: Enable MAC0 for BMC network .../dts/aspeed/aspeed-bmc-nvidia-gb200nvl-bmc.dts | 54 +++++++++++++++++++++- 1 file changed, 52 insertions(+), 2 deletions(-) --- base-commit: 13c9c6eabf033ed4f369ad4d29bdc58ed4a411e3 change-id: 20250716-update-gb200nvl-dts-for-new-hardware-b130d390c93c Best regards, -- Willie Thai From wthai at nvidia.com Thu Jul 17 18:58:57 2025 From: wthai at nvidia.com (Willie Thai) Date: Thu, 17 Jul 2025 08:58:57 +0000 Subject: [PATCH v2 4/4] ARM: dts: aspeed: nvidia: gb200nvl: Enable MAC0 for BMC network In-Reply-To: <17cd5195-29d7-44db-8f3c-474dc5c3486b@lunn.ch> References: <17cd5195-29d7-44db-8f3c-474dc5c3486b@lunn.ch> Message-ID: <20250717085857.2707150-1-wthai@nvidia.com> >> +&mac0 { >> + status = "okay"; >> + pinctrl-names = "default"; >> + phy-mode = "rgmii-id"; >> + max-speed = <1000>; > The MAC is using rgmii. How can it do more than 1G? > Andrew Thanks Andrew for quick reply ! Will fix this in the next version by removing it, because this MAC can negotiate with PHY. From donalds at nvidia.com Sat Jul 19 09:11:17 2025 From: donalds at nvidia.com (Donald Shannon) Date: Fri, 18 Jul 2025 16:11:17 -0700 Subject: [PATCH v5 1/2] Documentation: devicetree: Add binding for NVIDIA GB200-UT3.0b platform In-Reply-To: <20250718231118.3330855-1-donalds@nvidia.com> References: <20250718231118.3330855-1-donalds@nvidia.com> Message-ID: <20250718231118.3330855-2-donalds@nvidia.com> This is an Aspeed AST2600 based unit testing platform for GB200. UT3.0b is different than nvidia-gb200nvl-bmc due to networking topology differences, additional gpio expanders, and voltage regulator gating some devices. Reference to Ast2600 SOC [1]. Reference to Blackwell GB200NVL Platform [2]. Link: https://www.aspeedtech.com/server_ast2600/ [1] Link: https://nvdam.widen.net/s/wwnsxrhm2w/blackwell-datasheet-3384703 [2] Signed-off-by: Donald Shannon --- Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml index 456dbf7b5ec8..624581db2330 100644 --- a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml +++ b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml @@ -99,6 +99,7 @@ properties: - inventec,starscream-bmc - inventec,transformer-bmc - jabil,rbp-bmc + - nvidia,gb200-ut30b - nvidia,gb200nvl-bmc - qcom,dc-scm-v1-bmc - quanta,s6q-bmc -- 2.43.0 From donalds at nvidia.com Sat Jul 19 09:11:18 2025 From: donalds at nvidia.com (Donald Shannon) Date: Fri, 18 Jul 2025 16:11:18 -0700 Subject: [PATCH v5 2/2] ARM: dts: aspeed: Add device tree for Nvidia's GB200 UT3.0b platform BMC In-Reply-To: <20250718231118.3330855-1-donalds@nvidia.com> References: <20250718231118.3330855-1-donalds@nvidia.com> Message-ID: <20250718231118.3330855-3-donalds@nvidia.com> This is an Aspeed AST2600 based unit testing platform for GB200. UT3.0b is different than nvidia-gb200nvl-bmc due to networking topology differences, additional gpio expanders, and voltage regulator gating some devices. Reference to Ast2600 SOC [1]. Reference to Blackwell GB200NVL Platform [2]. Link: https://www.aspeedtech.com/server_ast2600/ [1] Link: https://nvdam.widen.net/s/wwnsxrhm2w/blackwell-datasheet-3384703 [2] Signed-off-by: Donald Shannon --- Changes v1 -> v2: - Changed phy-mode to rgmii-id [Lunn] - Removed redundant max-speed for mac0 [Lunn] - Fixed typo from gb200nvl to gb200 in Makefile Changes v2 -> v3: - Fixed whitespace issues [Krzysztof] - Fixed schema validation issues from my end ( there are still issues with the aspeed dtsi file that are not related to this new dts) [Herring] - Reordered to follow style guide [Krzysztof] - Removed redundant status okays - Changed vcc to vdd for the power gating on the gpio expanders Changes v3 -> v4: - Added changelog [Krzysztof] - Added nvidia,gb200-ut30b board binding [Krzysztof] - Removed unused imports - Reordered a couple other style guide violations - Added back in a couple needed "status okay"s Changes v4 -> v5: - Resumed my patch after a pause - Don't plan to make this include of nvidia-gb200nvl-bmc due to some platform differences - Fixed io expanders that weren't gated by the 3.3V standby regulator - Fixed incorrect interrupt pin for one IO expander - Removed some IO expanders and I2C busses --- arch/arm/boot/dts/aspeed/Makefile | 1 + .../aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts | 1027 +++++++++++++++++ 2 files changed, 1028 insertions(+) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile index aba7451ab749..37edc4625a9f 100644 --- a/arch/arm/boot/dts/aspeed/Makefile +++ b/arch/arm/boot/dts/aspeed/Makefile @@ -51,6 +51,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ aspeed-bmc-lenovo-hr630.dtb \ aspeed-bmc-lenovo-hr855xg2.dtb \ aspeed-bmc-microsoft-olympus.dtb \ + aspeed-bmc-nvidia-gb200-ut30b.dtb \ aspeed-bmc-nvidia-gb200nvl-bmc.dtb \ aspeed-bmc-opp-lanyang.dtb \ aspeed-bmc-opp-mowgli.dtb \ diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts new file mode 100644 index 000000000000..851fb784d082 --- /dev/null +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts @@ -0,0 +1,1027 @@ +// SPDX-License-Identifier: GPL-2.0+ +/dts-v1/; + +#include "aspeed-g6.dtsi" +#include + +/ { + model = "AST2600 GB200 UT3.0b BMC"; + compatible = "nvidia,gb200-ut30b", "aspeed,ast2600"; + + aliases { + serial2 = &uart3; + serial4 = &uart5; + i2c16 = &imux16; + i2c17 = &imux17; + i2c18 = &imux18; + i2c19 = &imux19; + i2c20 = &imux20; + i2c21 = &imux21; + i2c22 = &imux22; + i2c23 = &imux23; + i2c24 = &imux24; + i2c25 = &imux25; + i2c26 = &imux26; + i2c27 = &imux27; + i2c28 = &imux28; + i2c29 = &imux29; + i2c30 = &imux30; + i2c31 = &imux31; + i2c32 = &imux32; + i2c33 = &imux33; + i2c34 = &imux34; + i2c35 = &imux35; + i2c36 = &imux36; + i2c37 = &imux37; + i2c38 = &imux38; + i2c39 = &imux39; + i2c40 = &e1si2c0; + i2c41 = &e1si2c1; + i2c42 = &e1si2c2; + i2c43 = &e1si2c3; + i2c48 = &i2c17mux0; + i2c49 = &i2c17mux1; + i2c50 = &i2c17mux2; + i2c51 = &i2c17mux3; + i2c52 = &i2c25mux0; + i2c53 = &i2c25mux1; + i2c54 = &i2c25mux2; + i2c55 = &i2c25mux3; + i2c56 = &i2c29mux0; + i2c57 = &i2c29mux1; + i2c58 = &i2c29mux2; + i2c59 = &i2c29mux3; + }; + + buttons { + button-power { + label = "power-btn"; + gpio = <&sgpiom0 156 GPIO_ACTIVE_LOW>; + }; + button-uid { + label = "uid-btn"; + gpio = <&sgpiom0 154 GPIO_ACTIVE_LOW>; + }; + }; + + chosen { + stdout-path = &uart5; + }; + + leds { + compatible = "gpio-leds"; + led-0 { + label = "uid_led"; + gpios = <&sgpiom0 27 GPIO_ACTIVE_LOW>; + }; + led-1 { + label = "fault_led"; + gpios = <&sgpiom0 29 GPIO_ACTIVE_LOW>; + }; + led-2 { + label = "power_led"; + gpios = <&sgpiom0 31 GPIO_ACTIVE_LOW>; + }; + }; + + memory at 80000000 { + device_type = "memory"; + reg = <0x80000000 0x80000000>; + }; + + reg_3v3_stby: regulator-3v3-standby { + compatible = "regulator-fixed"; + regulator-name = "3v3-standby"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + gpio = <&gpio0 ASPEED_GPIO(M, 3) GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-always-on; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + vga_memory: framebuffer at 9f000000 { + no-map; + reg = <0x9f000000 0x01000000>; /* 16M */ + }; + + ramoops at a0000000 { + compatible = "ramoops"; + reg = <0xa0000000 0x100000>; /* 1MB */ + record-size = <0x10000>; /* 64KB */ + max-reason = <2>; /* KMSG_DUMP_OOPS */ + }; + + gfx_memory: framebuffer { + compatible = "shared-dma-pool"; + reusable; + size = <0x01000000>; + alignment = <0x01000000>; + }; + + video_engine_memory: jpegbuffer { + compatible = "shared-dma-pool"; + reusable; + size = <0x02000000>; /* 32M */ + alignment = <0x01000000>; + }; + }; +}; + +// Enable Primary flash on FMC for bring up activity +&fmc { + status = "okay"; + flash at 0 { + compatible = "jedec,spi-nor"; + label = "bmc"; + spi-max-frequency = <50000000>; + status = "okay"; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + u-boot at 0 { + // 896KB + reg = <0x0 0xe0000>; + label = "u-boot"; + }; + + kernel at 100000 { + // 9MB + reg = <0x100000 0x900000>; + label = "kernel"; + }; + + rofs at a00000 { + // 55292KB (extends to end of 64MB SPI - 4KB) + reg = <0xa00000 0x35FF000>; + label = "rofs"; + }; + }; + }; +}; + +&spi2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_spi2_default>; + status = "okay"; + // Data SPI is 64MB in size + flash at 0 { + label = "config"; + spi-max-frequency = <50000000>; + status = "okay"; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + u-boot-env at 0 { + // 256KB + reg = <0x0 0x40000>; + label = "u-boot-env"; + }; + + rwfs at 40000 { + // 16MB + reg = <0x40000 0x1000000>; + label = "rwfs"; + }; + + log at 1040000 { + // 40MB + reg = <0x1040000 0x2800000>; + label = "log"; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + ethphy0: ethernet-phy at 0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + }; +}; + +&mac0 { + pinctrl-names = "default"; + phy-mode = "rgmii-id"; + phy-handle = <ðphy0>; + pinctrl-0 = <&pinctrl_rgmii1_default>; + status = "okay"; +}; + +// USB Port B Controller +&ehci1 { + status = "okay"; +}; + +// USB Port B Controller +&uhci { + status = "okay"; +}; + +// USB port A vhub +&vhub { + status = "okay"; +}; + +&rng { + status = "okay"; +}; + +&video { + memory-region = <&video_engine_memory>; + status = "okay"; +}; + +&gpio0 { + gpio-line-names = + /*A0-A7*/ "", "", "", "", "", "", "", "", + /*B0-B7*/ "", "", "", "", "", "", "", "", + /*C0-C7*/ "SGPIO_I2C_MUX_SEL-O", "", "", "", "", "", "", "", + /*D0-D7*/ "", "", "", "UART1_MUX_SEL-O", "", "FPGA_PEX_RST_L-O", "", "", + /*E0-E7*/ "RTL8221_PHY_RST_L-O", "RTL8211_PHY_INT_L-I", "", "UART3_MUX_SEL-O", + "", "", "", "SGPIO_BMC_EN-O", + /*F0-F7*/ "", "", "", "", "", "", "", "", + /*G0-G7*/ "", "", "", "", "", "", "", "", + /*H0-H7*/ "", "", "", "", "", "", "", "", + /*I0-I7*/ "", "", "", "", "", "QSPI2_RST_L-O", "GLOBAL_WP_BMC-O", "BMC_DDR4_TEN-O", + /*J0-J7*/ "", "", "", "", "", "", "", "", + /*K0-K7*/ "", "", "", "", "", "", "", "", + /*L0-L7*/ "", "", "", "", "", "", "", "", + /*M0-M7*/ "PCIE_EP_RST_EN-O", "BMC_FRU_WP-O", "FPGA_RST_L-O", "STBY_POWER_EN-O", + "STBY_POWER_PG-I", "PCIE_EP_RST_L-O", "", "", + /*N0-N7*/ "", "", "", "", "", "", "", "", + /*O0-O7*/ "", "", "", "", "", "", "", "", + /*P0-P7*/ "", "", "", "", "", "", "", "", + /*Q0-Q7*/ "", "", "", "", "", "", "", "", + /*R0-R7*/ "", "", "", "", "", "", "", "", + /*S0-S7*/ "", "", "", "", "", "", "", "", + /*T0-T7*/ "", "", "", "", "", "", "", "", + /*U0-U7*/ "", "", "", "", "", "", "", "", + /*V0-V7*/ "AP_EROT_REQ-O", "EROT_AP_GNT-I", "", "","PCB_TEMP_ALERT-I", "","", "", + /*W0-W7*/ "", "", "", "", "", "", "", "", + /*X0-X7*/ "", "", "TPM_MUX_SEL-O", "", "", "", "", "", + /*Y0-Y7*/ "", "", "", "EMMC_RST-O", "","", "", "", + /*Z0-Z7*/ "BMC_READY-O","", "", "", "", "", "", ""; +}; + +&gpio1 { + /* 36 1.8V GPIOs */ + gpio-line-names = + /*A0-A7*/ "", "", "", "", "", "", "", "", + /*B0-B7*/ "", "", "", "", "", "", "IO_EXPANDER_INT_L-I","", + /*C0-C7*/ "", "", "", "", "", "", "", "", + /*D0-D7*/ "", "", "", "", "", "", "SPI_HOST_TPM_RST_L-O", "SPI_BMC_FPGA_INT_L-I", + /*E0-E7*/ "", "", "", "", "", "", "", ""; +}; + +&sgpiom0 { + ngpios = <128>; + status = "okay"; + gpio-line-names = + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "RUN_POWER_FAULT_L-I","SYS_RST_IN_L-O", + "RUN_POWER_PG-I","PWR_BRAKE_L-O", + "SYS_RST_OUT_L-I","RUN_POWER_EN-O", + "L0L1_RST_REQ_OUT_L-I","SHDN_FORCE_L-O", + "L2_RST_REQ_OUT_L-I","SHDN_REQ_L-O", + "SHDN_OK_L-I","UID_LED_N-O", + "BMC_I2C1_FPGA_ALERT_L-I","SYS_FAULT_LED_N-O", + "BMC_I2C0_FPGA_ALERT_L-I","PWR_LED_N-O", + "FPGA_RSVD_FFU3-I","", + "FPGA_RSVD_FFU2-I","", + "FPGA_RSVD_FFU1-I","", + "FPGA_RSVD_FFU0-I","BMC_I2C_SSIF_ALERT_L-O", + "CPU_BOOT_DONE-I","JTAG_MUX_SELECT-O", + "SPI_BMC_FPGA_INT_L-I","RTC_CLR_L-O", + "THERM_BB_WARN_L-I","UART_MUX_SEL-O", + "THERM_BB_OVERT_L-I","", + "CPU0_UPHY3_PRSNT1_L-I","IOBRD0_RUN_POWER_EN-O", + "CPU0_UPHY3_PRSNT0_L-I","IOBRD1_RUN_POWER_EN-O", + "CPU0_UPHY2_PRSNT1_L-I","FPGA_RSVD_FFU4-O", + "CPU0_UPHY2_PRSNT0_L-I","FPGA_RSVD_FFU5-O", + "CPU0_UPHY1_PRSNT1_L-I","FPGA_RSVD_FFU6-O", + "CPU0_UPHY1_PRSNT0_L-I","FPGA_RSVD_FFU7-O", + "CPU0_UPHY0_PRSNT1_L-I","RSVD_NV_PLT_DETECT-O", + "CPU0_UPHY0_PRSNT0_L-I","SPI1_INT_L-O", + "CPU1_UPHY3_PRSNT1_L-I","", + "CPU1_UPHY3_PRSNT0_L-I","HMC_EROT_MUX_STATUS", + "CPU1_UPHY2_PRSNT1_L-I","", + "CPU1_UPHY2_PRSNT0_L-I","", + "CPU1_UPHY1_PRSNT1_L-I","", + "CPU1_UPHY1_PRSNT0_L-I","", + "CPU1_UPHY0_PRSNT1_L-I","", + "CPU1_UPHY0_PRSNT0_L-I","", + "FAN1_PRESENT_L-I","", + "FAN0_PRESENT_L-I","", + "","", + "IPEX_CABLE_PRSNT_L-I","", + "M2_1_PRSNT_L-I","", + "M2_0_PRSNT_L-I","", + "CPU1_UPHY4_PRSNT1_L-I","", + "CPU0_UPHY4_PRSNT0_L-I","", + "","", + "I2C_RTC_ALERT_L-I","", + "FAN7_PRESENT_L-I","", + "FAN6_PRESENT_L-I","", + "FAN5_PRESENT_L-I","", + "FAN4_PRESENT_L-I","", + "FAN3_PRESENT_L-I","", + "FAN2_PRESENT_L-I","", + "IOBRD0_IOX_INT_L-I","", + "IOBRD1_PRSNT_L-I","", + "IOBRD0_PRSNT_L-I","", + "IOBRD1_PWR_GOOD-I","", + "IOBRD0_PWR_GOOD-I","", + "","", + "","", + "FAN_FAIL_IN_L-I","", + "","", + "","", + "","", + "PDB_CABLE_PRESENT_L-I","", + "","", + "CHASSIS_PWR_BRK_L-I","", + "","", + "IOBRD1_IOX_INT_L-I","", + "10GBE_SMBALRT_L-I","", + "PCIE_WAKE_L-I","", + "I2C_M21_ALERT_L-I","", + "I2C_M20_ALERT_L-I","", + "TRAY_FAST_SHDN_L-I","", + "UID_BTN_N-I","", + "PWR_BTN_L-I","", + "PSU_SMB_ALERT_L-I","", + "","", + "","", + "NODE_LOC_ID[0]-I","", + "NODE_LOC_ID[1]-I","", + "NODE_LOC_ID[2]-I","", + "NODE_LOC_ID[3]-I","", + "NODE_LOC_ID[4]-I","", + "NODE_LOC_ID[5]-I","", + "FAN10_PRESENT_L-I","", + "FAN9_PRESENT_L-I","", + "FAN8_PRESENT_L-I","", + "FPGA1_READY_HMC-I","", + "DP_HPD-I","", + "HMC_I2C3_FPGA_ALERT_L-I","", + "HMC_I2C2_FPGA_ALERT_L-I","", + "FPGA0_READY_HMC-I","", + "","", + "","", + "","", + "","", + "LEAK_DETECT_ALERT_L-I","", + "MOD1_B2B_CABLE_PRESENT_L-I","", + "MOD1_CLINK_CABLE_PRESENT_L-I","", + "FAN11_PRESENT_L-I","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "RSVD_SGPIO_IN_CRC[0]","RSVD_SGPIO_O_CRC[7]", + "RSVD_SGPIO_IN_CRC[1]","RSVD_SGPIO_O_CRC[6]", + "RSVD_SGPIO_IN_CRC[2]","RSVD_SGPIO_O_CRC[5]", + "RSVD_SGPIO_IN_CRC[3]","RSVD_SGPIO_O_CRC[4]", + "RSVD_SGPIO_IN_CRC[4]","RSVD_SGPIO_O_CRC[3]", + "RSVD_SGPIO_IN_CRC[5]","RSVD_SGPIO_O_CRC[2]", + "RSVD_SGPIO_IN_CRC[6]","RSVD_SGPIO_O_CRC[1]", + "RSVD_SGPIO_IN_CRC[7]","RSVD_SGPIO_O_CRC[0]"; +}; + +&uart1 { + status = "okay"; +}; + +// Enabling SOL +&uart3 { + status = "okay"; +}; + +// BMC Debug Console +&uart5 { + status = "okay"; +}; + +&uart_routing { }; + +// I2C1, SSIF IPMI interface +&i2c0 { + clock-frequency = <400000>; + status = "okay"; + ssif-bmc at 10 { + compatible = "ssif-bmc"; + reg = <0x10>; + }; +}; + +// I2C3 +// BMC_I2C0_FPGA - Primary FPGA +&i2c2 { + clock-frequency = <400000>; + multi-master; + status = "okay"; +}; + +// I2C5 +// RTC Driver +// IO Expander +&i2c4 { + clock-frequency = <400000>; + status = "okay"; + // Module 0, Expander @0x21 + exp4: gpio at 21 { + compatible = "nxp,pca9555"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio1>; + interrupts = ; + vcc-supply = <®_3v3_stby>; + gpio-line-names = + "RTC_MUX_SEL-O", + "PCI_MUX_SEL-O", + "TPM_MUX_SEL-O", + "FAN_MUX-SEL-O", + "SGMII_MUX_SEL-O", + "DP_MUX_SEL-O", + "UPHY3_USB_SEL-O", + "NCSI_MUX_SEL-O", + "BMC_PHY_RST-O", + "RTC_CLR_L-O", + "BMC_12V_CTRL-O", + "PS_RUN_IO0_PG-I", + "", + "", + "", + ""; + }; +}; + +// I2C6 +// Module 0/1 I2C MUX x3 +&i2c5 { + clock-frequency = <400000>; + multi-master; + status = "okay"; + + i2c-mux at 71 { + compatible = "nxp,pca9546"; + reg = <0x71>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + imux16: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux17: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + i2c-mux at 74 { + compatible = "nxp,pca9546"; + reg = <0x74>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + i2c17mux0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + i2c17mux1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + i2c17mux2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + i2c17mux3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + }; + + imux18: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux19: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 72 { + compatible = "nxp,pca9546"; + reg = <0x72>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + imux20: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux21: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + gpio at 20 { + compatible = "nxp,pca9555"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + vcc-supply = <®_3v3_stby>; + gpio-line-names = + "RST_CX_0_L-O", + "RST_CX_1_L-O", + "CX0_SSD0_PRSNT_L-I", + "CX1_SSD1_PRSNT_L-I", + "CX_BOOT_CMPLT_CX0-I", + "CX_BOOT_CMPLT_CX1-I", + "CX_TWARN_CX0_L-I", + "CX_TWARN_CX1_L-I", + "CX_OVT_SHDN_CX0-I", + "CX_OVT_SHDN_CX1-I", + "FNP_L_CX0-O", + "FNP_L_CX1-O", + "", + "MCU_GPIO-I", + "MCU_RST_N-O", + "MCU_RECOVERY_N-O"; + }; + }; + + imux22: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux23: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + + i2c-mux at 73 { + compatible = "nxp,pca9546"; + reg = <0x73>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + imux24: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux25: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + i2c-mux at 70 { + compatible = "nxp,pca9546"; + reg = <0x70>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + i2c25mux0: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c25mux1: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c25mux2: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c25mux3: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + }; + + imux26: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux27: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + + i2c-mux at 75 { + compatible = "nxp,pca9546"; + reg = <0x75>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + imux28: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux29: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + i2c-mux at 74 { + compatible = "nxp,pca9546"; + reg = <0x74>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + i2c29mux0: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c29mux1: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c29mux2: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c29mux3: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + }; + + imux30: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux31: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + + i2c-mux at 76 { + compatible = "nxp,pca9546"; + reg = <0x76>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + imux32: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux33: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux34: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux35: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + + i2c-mux at 77 { + compatible = "nxp,pca9546"; + reg = <0x77>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + imux36: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux37: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux38: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux39: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; +}; + +// I2C7 +// Module 0/1 Leak Sensors +// Module 0/1 Fan Controllers +&i2c6 { + clock-frequency = <400000>; + status = "okay"; + + pmic at 12 { + compatible = "ti,lm5066i"; + reg = <0x12>; + shunt-resistor-micro-ohms = <190>; + }; + + pmic at 14 { + compatible = "ti,lm5066i"; + reg = <0x14>; + shunt-resistor-micro-ohms = <190>; + }; + + pwm at 20 { + compatible = "maxim,max31790"; + reg = <0x20>; + }; + + pwm at 23 { + compatible = "maxim,max31790"; + reg = <0x23>; + }; + + pwm at 2c { + compatible = "maxim,max31790"; + reg = <0x2c>; + }; + + pwm at 2f { + compatible = "maxim,max31790"; + reg = <0x2f>; + }; +}; + +// I2C9 +// M.2 +&i2c8 { + clock-frequency = <400000>; + multi-master; + status = "okay"; +}; + +// I2C10 +// Module 0/1 IO Expanders +&i2c9 { + clock-frequency = <400000>; + status = "okay"; + + // Module 0, Expander @0x20 + exp0: gpio at 20 { + compatible = "nxp,pca9555"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio1>; + interrupts = ; + vcc-supply = <®_3v3_stby>; + gpio-line-names = + "FPGA_THERM_OVERT_L-I", + "FPGA_READY_BMC-I", + "HMC_BMC_DETECT-O", + "HMC_PGOOD-O", + "", + "BMC_STBY_CYCLE-O", + "FPGA_EROT_FATAL_ERROR_L-I", + "WP_HW_EXT_CTRL_L-O", + "EROT_FPGA_RST_L-O", + "FPGA_EROT_RECOVERY_L-O", + "BMC_EROT_FPGA_SPI_MUX_SEL-O", + "USB_HUB_RESET_L-O", + "NCSI_CS1_SEL-O", + "SGPIO_EN_L-O", + "B2B_IOEXP_INT_L-I", + "I2C_BUS_MUX_RESET_L-O"; + }; + + // UT3.0b Expander @0x22 + exp2: gpio at 22 { + compatible = "nxp,pca9555"; + reg = <0x22>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio1>; + interrupts = ; + vcc-supply = <®_3v3_stby>; + gpio-line-names = + "BMC1_FANCTRL_FAIL_L-I", + "IOEXP_BMC_RST_12V-O", + "NODE_RST_STBY_H-O", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + ""; + }; + + // UT3.0b Expander @0x23 + exp3: gpio at 23 { + compatible = "nxp,pca9555"; + reg = <0x23>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio1>; + interrupts = ; + vcc-supply = <®_3v3_stby>; + gpio-line-names = + "PEXSW_FL_SPI_MUX_SEL-O", + "PEX_SW_FATAL_ERROR_3V3_L-I", + "IOEXP_PDB_NODE_EN_L-O", + "NODE_PWOK_ISO-I", + "BMC_FAN_PWR_EN-O", + "BMC_ETHERNET_INT-I", + "BMC_ENET_RST-O", + "IOEXP_BMC_RST_SENSE-O", + "BMC_ID-I", + "TPM_MUX_3V3_SEL_N-O", + "IOEXP_TPM_RST_N-O", + "TPM_DOWN_SPI_INT_L-I", + "PS_BRD_PGOOD-I", + "FP_BUTTON_POWER_N-I", + "FP_BUTTON_RESET_N-I", + "FP_LED_POWER_GPIOEXP_N-O"; + }; +}; + +// I2C11 +// BMC FRU EEPROM +// BMC Temp Sensor +&i2c10 { + clock-frequency = <400000>; + status = "okay"; + + // BMC FRU EEPROM - 256 bytes + eeprom at 50 { + compatible = "atmel,24c02"; + reg = <0x50>; + pagesize = <8>; + }; +}; + +// I2C12 +&i2c11 { + clock-frequency = <400000>; + status = "okay"; +}; + +// I2C15 +// Module 1 UPHY3 SMBus +&i2c14 { + clock-frequency = <100000>; + multi-master; + status = "okay"; + + //E1.S drive slot 0-3 + i2c-mux at 77 { + compatible = "nxp,pca9546"; + reg = <0x77>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + e1si2c0: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + e1si2c1: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + e1si2c2: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + e1si2c3: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; +}; -- 2.43.0 From donalds at nvidia.com Sat Jul 19 09:11:16 2025 From: donalds at nvidia.com (Donald Shannon) Date: Fri, 18 Jul 2025 16:11:16 -0700 Subject: [PATCH v5 0/2] Adding device tree and binding for NVIDIA GB200-UT3.0b Message-ID: <20250718231118.3330855-1-donalds@nvidia.com> Patch 1 adds the binding for the NVIDIA GB200-UT3.0b platform. Patch 2 adds the device tree for the NVIDIA GB200-UT3.0b platform. This is an Aspeed AST2600 based unit testing platform for GB200. UT3.0b is different than nvidia-gb200nvl-bmc due to networking topology differences, additional gpio expanders, and voltage regulator gating some devices. Reference to Ast2600 SOC [1]. Reference to Blackwell GB200NVL Platform [2]. Link: https://www.aspeedtech.com/server_ast2600/ [1] Link: https://nvdam.widen.net/s/wwnsxrhm2w/blackwell-datasheet-3384703 [2] Signed-off-by: Donald Shannon --- Changes v1 -> v2: - Changed phy-mode to rgmii-id [Lunn] - Removed redundant max-speed for mac0 [Lunn] - Fixed typo from gb200nvl to gb200 in Makefile Changes v2 -> v3: - Fixed whitespace issues [Krzysztof] - Fixed schema validation issues from my end ( there are still issues with the aspeed dtsi file that are not related to this new dts) [Herring] - Reordered to follow style guide [Krzysztof] - Removed redundant status okays - Changed vcc to vdd for the power gating on the gpio expanders Changes v3 -> v4: - Added changelog [Krzysztof] - Added nvidia,gb200-ut30b board binding [Krzysztof] - Removed unused imports - Reordered a couple other style guide violations - Added back in a couple needed "status okay"s Changes v4 -> v5: - Resumed my patch after a pause - Don't plan to make this include of nvidia-gb200nvl-bmc due to some platform differences - Fixed io expanders that weren't gated by the 3.3V standby regulator - Fixed incorrect interrupt pin for one IO expander - Removed some IO expanders and I2C busses --- Donald Shannon (2): Documentation: devicetree: Add binding for NVIDIA GB200-UT3.0b platform ARM: dts: aspeed: Add device tree for Nvidia's GB200 UT3.0b platform BMC .../bindings/arm/aspeed/aspeed.yaml | 1 + arch/arm/boot/dts/aspeed/Makefile | 1 + .../aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts | 1027 +++++++++++++++++ 3 files changed, 1029 insertions(+) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts base-commit: d086c886ceb9f59dea6c3a9dae7eb89e780a20c9 -- 2.43.0 From robh at kernel.org Sun Jul 20 10:06:48 2025 From: robh at kernel.org (Rob Herring (Arm)) Date: Sat, 19 Jul 2025 19:06:48 -0500 Subject: [PATCH v8 0/2] ARM: dts: Add support for Meta Clemente BMC In-Reply-To: <20250717-add-support-for-meta-clemente-bmc-v8-0-2ff6afb36b0e@fii-foxconn.com> References: <20250717-add-support-for-meta-clemente-bmc-v8-0-2ff6afb36b0e@fii-foxconn.com> Message-ID: <175296991777.777229.6170492596613432717.robh@kernel.org> On Thu, 17 Jul 2025 22:58:58 +0800, Leo Wang wrote: > This series adds initial support for the Meta Clemente BMC based on the > ASPEED AST2600 SoC. > > Patch 1 documents the compatible string. > Patch 2 adds the device tree for the board. > > Signed-off-by: Leo Wang > --- > Changes in v8: > - Relocate IOBx_NICx_TEMP TMP421 sensors > - Enable byte mode for i2c11 > - Link to v7: https://lore.kernel.org/r/20250716-add-support-for-meta-clemente-bmc-v7-0-d5bb7459c5aa at fii-foxconn.com > > Changes in v7: > - Relocate CBC FRU EEPROMs from i2c13 to i2c12. > - Link to v6: https://lore.kernel.org/r/20250708-add-support-for-meta-clemente-bmc-v6-0-7f3e57bd0336 at fii-foxconn.com > > Changes in v6: > - Correct Author email to match Signed-off-by email address. > - Link to v5: https://lore.kernel.org/r/20250627-add-support-for-meta-clemente-bmc-v5-0-038ed6f1cb9f at fii-foxconn.com > > Changes in v5: > - Remove accidentally pasted texts. > - Link to v4: https://lore.kernel.org/r/20250627-add-support-for-meta-clemente-bmc-v4-0-ce7ff23460c4 at fii-foxconn.com > > Changes in v4: > - Move properties of nodes defined in the same file from label ref back to where they belong. > - Move pinctrl default configs for ncsi3 and ncsi4 to aspeed-g6-pinctrl.dtsi. > - Add properties to i2c10 and i2c15 to enable MCTP. > - Link to v3: https://lore.kernel.org/r/20250623-add-support-for-meta-clemente-bmc-v3-0-c223ffcf46cf at fii-foxconn.com > > Changes in v3: > - Modify leakage sensor to reflect current design. > - Link to v2: https://lore.kernel.org/r/20250621-add-support-for-meta-clemente-bmc-v2-0-6c5ef059149c at fii-foxconn.com > > Changes in v2: > - Fix patch 1/2 subject line to match dt-bindings convention. > - Reorder device tree nodes in patch 2/2 to follow upstream DTS style. > - Link to v1: https://lore.kernel.org/r/20250618-add-support-for-meta-clemente-bmc-v1-0-e5ca669ee47b at fii-foxconn.com > > --- > Leo Wang (2): > dt-bindings: arm: aspeed: add Meta Clemente board > ARM: dts: aspeed: clemente: add Meta Clemente BMC > > .../devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + > arch/arm/boot/dts/aspeed/Makefile | 1 + > .../dts/aspeed/aspeed-bmc-facebook-clemente.dts | 1295 ++++++++++++++++++++ > arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi | 11 + > 4 files changed, 1308 insertions(+) > --- > base-commit: 52da431bf03b5506203bca27fe14a97895c80faf > change-id: 20250618-add-support-for-meta-clemente-bmc-941a469bc523 > > Best regards, > -- > Leo Wang > > > My bot found new DTB warnings on the .dts files added or changed in this series. Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments. If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date: pip3 install dtschema --upgrade This patch series was applied (using b4) to base: Base: using specified base-commit 52da431bf03b5506203bca27fe14a97895c80faf If this is not the correct base, please add 'base-commit' tag (or use b4 which does this automatically) New warnings running 'make CHECK_DTBS=y for arch/arm/boot/dts/aspeed/' for 20250717-add-support-for-meta-clemente-bmc-v8-0-2ff6afb36b0e at fii-foxconn.com: arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: timer (arm,armv7-timer): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/timer/arm,arch_timer.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /sdram at 1e6e0000: failed to match any schema with compatible: ['aspeed,ast2600-sdram-edac', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: bus at 1e600000 (aspeed,ast2600-ahbc): compatible: ['aspeed,ast2600-ahbc', 'syscon'] is too long from schema $id: http://devicetree.org/schemas/bus/aspeed,ast2600-ahbc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: syscon at 1e6e2000 (aspeed,ast2600-scu): 'smp-memram at 180' does not match any of the regexes: '^interrupt-controller@[0-9a-f]+$', '^p2a-control@[0-9a-f]+$', '^pinctrl(@[0-9a-f]+)?$', '^pinctrl-[0-9]+$', '^silicon-id@[0-9a-f]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed,ast2x00-scu.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/syscon at 1e6e2000/smp-memram at 180: failed to match any schema with compatible: ['aspeed,ast2600-smpmem'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/display at 1e6e6000: failed to match any schema with compatible: ['aspeed,ast2600-gfx', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: adc at 1e6e9000 (aspeed,ast2600-adc0): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: adc at 1e6e9100 (aspeed,ast2600-adc1): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: crypto at 1e6fa000 (aspeed,ast2600-acry): 'aspeed,ahbc' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/crypto/aspeed,ast2600-acry.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/timer at 1e782000: failed to match any schema with compatible: ['aspeed,ast2600-timer'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): reg-io-width: 4 is not of type 'object' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): lpc-snoop at 80: 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: kcs at 24 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: kcs at 28 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: kcs at 2c (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: kcs at 114 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/lpc at 1e789000/lhc at a0: failed to match any schema with compatible: ['aspeed,ast2600-lhc'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/lpc at 1e789000/ibt at 140: failed to match any schema with compatible: ['aspeed,ast2600-ibt-bmc'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740100:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740200:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740100: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740200: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: adc at 34 (maxim,max1363): '#address-cells', '#size-cells', 'channel at 0', 'channel at 1', 'channel at 2', 'channel at 3' do not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/maxim,max1363.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: adc at 35 (maxim,max1363): '#address-cells', '#size-cells', 'channel at 0', 'channel at 1', 'channel at 2', 'channel at 3' do not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/maxim,max1363.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: i2c at 600 (aspeed,ast2600-i2c-bus): Unevaluated properties are not allowed ('aspeed,enable-byte' was unexpected) from schema $id: http://devicetree.org/schemas/i2c/aspeed,i2c.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: fsi at 1e79b000 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/fsi at 1e79b000: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: fsi at 1e79b100 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/fsi at 1e79b100: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: /ahb/apb/dma-controller at 1e79e000: failed to match any schema with compatible: ['aspeed,ast2600-udma'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dtb: kcs at 24 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# From robh at kernel.org Mon Jul 21 08:22:30 2025 From: robh at kernel.org (Rob Herring) Date: Sun, 20 Jul 2025 17:22:30 -0500 Subject: [PATCH v2 06/10] ARM: dts: aspeed-g6: Add PCIe RC node In-Reply-To: References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> <20250715034320.2553837-7-jacky_chou@aspeedtech.com> Message-ID: <20250720222230.GA2842356-robh@kernel.org> On Wed, Jul 16, 2025 at 03:51:11AM +0000, Jacky Chou wrote: > Hi Rob, > > Thank you for your reply. > > > > quality = <100>; > > > }; > > > > > > + pcie_phy1: syscon at 1e6ed200 { > > > + compatible = "aspeed,pcie-phy", > > "syscon"; > > > + reg = <0x1e6ed200 0x100>; > > > > This looks like part of something else? It should be a child of that. > > > > If this is the controls for the PCIe PHY, then use the PHY binding instead of your > > own custom phandle property. > > > > Our PCIe design has multiple functions. And the series of patches are submitted for > PCIe RC. The other PCIe functions also use this phy node. > I traced the PHY driver interface, it cannot meet our usage. Why not? There is also no requirement that using the DT PHY binding means you have to use the Linux PHY subsystem. > Therefore, the RC driver uses the phandle property to configure. > And this syscon also is used by the other PCIe functions. Like what? > > > + }; > > > + > > > + pcie_cfg: syscon at 1e770000 { > > > + compatible = "aspeed,pcie-cfg", > > "syscon"; > > > + reg = <0x1e770000 0x80>; > > > > Looks like this is really part of the PCIe block as a h/w block isn't going to start > > at offset 0xc0. > > > > > > Actually. > There are two PCIe bus in AST2600 > We use the other one PCIe to EP mode, here I call PCIe A. > I call the pcie0 node as PCIe B. > We do not provide PCIe A to RC mode for usage, just EP mode. > But, when PCIe A is used as RC, it reg mapping is starting from 0x1e770080. > I list there mapping. > > 0x1e77_0000 ~ 0x1e77_007f : common usage > 0x1e77_0080 ~ 0x1e77_00bf : PCIE A > 0x1e77_00C0 ~ 0x1e77_00ff : PCIE B > > So, it is why we create one node to describe common usage for PCIe A and B. > And, why the pcie0 reg mapping is starting from 0x1e77_00c0. In that case, maybe you need a common parent node with 2 child nodes for each bus. Rob > > > > + }; > > > + > > > + pcie0: pcie at 1e7700c0 { > > > + compatible = "aspeed,ast2600-pcie"; > > > + device_type = "pci"; > > > + reg = <0x1e7700c0 0x40>; > > > + linux,pci-domain = <0>; > > > > No need for this. You only have 1 PCI host. > > > > Agreed. > We only provide one RC. > > > > + #address-cells = <3>; > > > + #size-cells = <2>; > > > + interrupts = > IRQ_TYPE_LEVEL_HIGH>; > > > + bus-range = <0x80 0xff>; > > > > Does this h/w not support bus 0-0x7f for some reason? > > > > List: > PCIE A: 0-0x7f > PCIE B: 0x80-0xff > > It is our design on PCIe B to use bus-range 0x80-0xff. That's a policy or h/w limitation? Rob From robh at kernel.org Mon Jul 21 09:06:54 2025 From: robh at kernel.org (Rob Herring (Arm)) Date: Sun, 20 Jul 2025 18:06:54 -0500 Subject: [PATCH v5 0/2] Adding device tree and binding for NVIDIA GB200-UT3.0b In-Reply-To: <20250718231118.3330855-1-donalds@nvidia.com> References: <20250718231118.3330855-1-donalds@nvidia.com> Message-ID: <175305254811.3034422.3750387733086194199.robh@kernel.org> On Fri, 18 Jul 2025 16:11:16 -0700, Donald Shannon wrote: > Patch 1 adds the binding for the NVIDIA GB200-UT3.0b platform. > Patch 2 adds the device tree for the NVIDIA GB200-UT3.0b platform. > > This is an Aspeed AST2600 based unit testing platform for GB200. > UT3.0b is different than nvidia-gb200nvl-bmc due to networking topology > differences, additional gpio expanders, and voltage regulator gating > some devices. > > Reference to Ast2600 SOC [1]. > Reference to Blackwell GB200NVL Platform [2]. > > Link: https://www.aspeedtech.com/server_ast2600/ [1] > Link: https://nvdam.widen.net/s/wwnsxrhm2w/blackwell-datasheet-3384703 [2] > Signed-off-by: Donald Shannon > --- > Changes v1 -> v2: > - Changed phy-mode to rgmii-id [Lunn] > - Removed redundant max-speed for mac0 [Lunn] > - Fixed typo from gb200nvl to gb200 in Makefile > Changes v2 -> v3: > - Fixed whitespace issues [Krzysztof] > - Fixed schema validation issues from my end ( there are still issues > with the aspeed dtsi file that are not related to this new dts) > [Herring] > - Reordered to follow style guide [Krzysztof] > - Removed redundant status okays > - Changed vcc to vdd for the power gating on the gpio expanders > Changes v3 -> v4: > - Added changelog [Krzysztof] > - Added nvidia,gb200-ut30b board binding [Krzysztof] > - Removed unused imports > - Reordered a couple other style guide violations > - Added back in a couple needed "status okay"s > Changes v4 -> v5: > - Resumed my patch after a pause > - Don't plan to make this include of nvidia-gb200nvl-bmc due to some > platform differences > - Fixed io expanders that weren't gated by the 3.3V standby regulator > - Fixed incorrect interrupt pin for one IO expander > - Removed some IO expanders and I2C busses > --- > > Donald Shannon (2): > Documentation: devicetree: Add binding for NVIDIA GB200-UT3.0b > platform > ARM: dts: aspeed: Add device tree for Nvidia's GB200 UT3.0b platform > BMC > > .../bindings/arm/aspeed/aspeed.yaml | 1 + > arch/arm/boot/dts/aspeed/Makefile | 1 + > .../aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts | 1027 +++++++++++++++++ > 3 files changed, 1029 insertions(+) > create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts > > > base-commit: d086c886ceb9f59dea6c3a9dae7eb89e780a20c9 > -- > 2.43.0 > > > My bot found new DTB warnings on the .dts files added or changed in this series. Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments. If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date: pip3 install dtschema --upgrade This patch series was applied (using b4) to base: Base: using specified base-commit d086c886ceb9f59dea6c3a9dae7eb89e780a20c9 If this is not the correct base, please add 'base-commit' tag (or use b4 which does this automatically) New warnings running 'make CHECK_DTBS=y for arch/arm/boot/dts/aspeed/' for 20250718231118.3330855-1-donalds at nvidia.com: arch/arm/boot/dts/aspeed/aspeed-bmc-opp-lanyang.dtb: kcs at 28 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-amd-daytonax.dtb: fan at 15: aspeed,fan-tach-ch: b'\x0f' is not of type 'object', 'integer', 'array', 'boolean', 'null' from schema $id: http://devicetree.org/schemas/dt-core.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: timer (arm,armv7-timer): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/timer/arm,arch_timer.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /sdram at 1e6e0000: failed to match any schema with compatible: ['aspeed,ast2600-sdram-edac', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: bus at 1e600000 (aspeed,ast2600-ahbc): compatible: ['aspeed,ast2600-ahbc', 'syscon'] is too long from schema $id: http://devicetree.org/schemas/bus/aspeed,ast2600-ahbc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: syscon at 1e6e2000 (aspeed,ast2600-scu): 'smp-memram at 180' does not match any of the regexes: '^interrupt-controller@[0-9a-f]+$', '^p2a-control@[0-9a-f]+$', '^pinctrl(@[0-9a-f]+)?$', '^pinctrl-[0-9]+$', '^silicon-id@[0-9a-f]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed,ast2x00-scu.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/syscon at 1e6e2000/smp-memram at 180: failed to match any schema with compatible: ['aspeed,ast2600-smpmem'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/display at 1e6e6000: failed to match any schema with compatible: ['aspeed,ast2600-gfx', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: adc at 1e6e9000 (aspeed,ast2600-adc0): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: adc at 1e6e9100 (aspeed,ast2600-adc1): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: crypto at 1e6fa000 (aspeed,ast2600-acry): 'aspeed,ahbc' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/crypto/aspeed,ast2600-acry.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): reg-io-width: 4 is not of type 'object' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): lpc-snoop at 80: 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: kcs at 24 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: kcs at 28 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: kcs at 2c (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: kcs at 114 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/lpc at 1e789000/lhc at a0: failed to match any schema with compatible: ['aspeed,ast2600-lhc'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/lpc at 1e789000/ibt at 140: failed to match any schema with compatible: ['aspeed,ast2600-ibt-bmc'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740100:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740200:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740100: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740200: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: fsi at 1e79b000 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/fsi at 1e79b000: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: fsi at 1e79b100 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/fsi at 1e79b100: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/dma-controller at 1e79e000: failed to match any schema with compatible: ['aspeed,ast2600-udma'] From jassisinghbrar at gmail.com Mon Jul 21 05:51:02 2025 From: jassisinghbrar at gmail.com (Jassi Brar) Date: Sun, 20 Jul 2025 14:51:02 -0500 Subject: [PATCH v6 2/2] mailbox: aspeed: add mailbox driver for AST27XX series SoC In-Reply-To: <20250702011956.47479-3-jammy_huang@aspeedtech.com> References: <20250702011956.47479-1-jammy_huang@aspeedtech.com> <20250702011956.47479-3-jammy_huang@aspeedtech.com> Message-ID: On Tue, Jul 1, 2025 at 8:19?PM Jammy Huang wrote: ..... > + /* Read the message data */ > + for (data_reg = mb->rx_regs + IPCR_DATA + mb->msg_size * n, > + word_data = chan->con_priv, > + num_words = (mb->msg_size / sizeof(u32)); > + num_words; > + num_words--, data_reg += sizeof(u32), word_data++) > + *word_data = readl(data_reg); > + Please clean this for loop. Thanks -Jassi From andrew at codeconstruct.com.au Mon Jul 21 09:53:01 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Mon, 21 Jul 2025 09:23:01 +0930 Subject: [PATCH] soc: aspeed: Use of_reserved_mem_region_to_resource() for "memory-region" In-Reply-To: <20250703183508.2074735-1-robh@kernel.org> References: <20250703183508.2074735-1-robh@kernel.org> Message-ID: <175305558159.1020373.9271236318462742119.b4-ty@codeconstruct.com.au> On Thu, 03 Jul 2025 13:35:07 -0500, Rob Herring (Arm) wrote: > Use the newly added of_reserved_mem_region_to_resource() function to > handle "memory-region" properties. > > The error handling is a bit different. "memory-region" is optional, so > failed lookup is not an error. But then an error in > of_address_to_resource() is treated as an error. However, that > distinction is not really important. Either the region is available > and usable or it is not. So now, it is just > of_reserved_mem_region_to_resource() which is checked for an error. > > [...] Thanks, I've applied this to be picked up through the BMC tree. -- Andrew Jeffery From andrew at codeconstruct.com.au Mon Jul 21 11:12:03 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Mon, 21 Jul 2025 10:42:03 +0930 Subject: [PATCH v2 5/9] ARM: dts: aspeed: wedge400: Extend data0 partition to 64MB In-Reply-To: <20250706042404.138128-6-rentao.bupt@gmail.com> References: <20250706042404.138128-1-rentao.bupt@gmail.com> <20250706042404.138128-6-rentao.bupt@gmail.com> Message-ID: <0b9b6c712bff18a25da218c507d18b9a8f18c7e8.camel@codeconstruct.com.au> On Sat, 2025-07-05 at 21:23 -0700, rentao.bupt at gmail.com wrote: > From: Tao Ren > > Extend wedge400 BMC flash's data0 partition to 64MB for larger > persistent storage. > > Signed-off-by: Tao Ren > --- > Changes in v2: > ? - None (the patch is introduced in v2). > > ?arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts | 2 +- > ?1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts > index 3e4d30f0884d..cf6c768cbad5 100644 > --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts > +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts > @@ -92,7 +92,7 @@ tpm at 0 { > ? * Both firmware flashes are 128MB on Wedge400 BMC. > ? */ > ?&fmc_flash0 { > -#include "facebook-bmc-flash-layout-128.dtsi" > +#include "facebook-bmc-flash-layout-128-data64.dtsi" My preference here is that we maintain two separate DTS for Wedge400: - aspeed-bmc-facebook-wedge400.dts - aspeed-bmc-facebook-wedge400-data64.dts We do so such that we implement aspeed-bmc-facebook-wedge400.dts like: > cat aspeed-bmc-facebook-wedge400.dts #include "aspeed-bmc-facebook-wedge400-data64.dts" &fmc_flash0 { /delete-node/partitions; #include "facebook-bmc-flash-layout-128.dtsi" }; aspeed-bmc-facebook-wedge400-data64.dts includes facebook-bmc-flash- layout-128-data64.dtsi as usual. From bogus@does.not.exist.com Mon Jul 21 11:15:02 2025 From: bogus@does.not.exist.com () Date: Mon, 21 Jul 2025 01:15:02 -0000 Subject: No subject Message-ID: deprecated and can remove it in a future release. At least with this arrangement any revert of the (future) patch removing aspeed-bmc- facebook-wedge400.dts has no other impact. Further, both layouts will be supported in at least one release, making it possible to update the kernel without requiring a simultaneous update to the flash layout. Andrew From andrew at codeconstruct.com.au Mon Jul 21 11:13:59 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Mon, 21 Jul 2025 10:43:59 +0930 Subject: [PATCH v2 6/9] ARM: dts: aspeed: Move flash layout out of Facebook netbmc-common.dtsi In-Reply-To: <20250706042404.138128-7-rentao.bupt@gmail.com> References: <20250706042404.138128-1-rentao.bupt@gmail.com> <20250706042404.138128-7-rentao.bupt@gmail.com> Message-ID: On Sat, 2025-07-05 at 21:23 -0700, rentao.bupt at gmail.com wrote: > From: Tao Ren > > Move BMC flash layout from ast2600-facebook-netbmc-common.dtsi to each > BMC platform so it's easier to apply different layout settings. > > The fuji data0 partition was already extended to 64MB in Meta > environment. Elbert flash layout is not changed. > > Signed-off-by: Tao Ren > --- > Changes in v2: > ? - None (the patch is introduced in v2). > > ?arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts???? | 6 ++++++ > ?arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts?????? | 6 ++++++ > ?.../arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi | 2 -- > ?3 files changed, 12 insertions(+), 2 deletions(-) > > diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts > index 74f3c67e0eff..673cabbec92e 100644 > --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts > +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts > @@ -50,6 +50,12 @@ spi_gpio: spi { > ????????}; > ?}; > ? > +&fmc { > +???????flash at 0 { > +#include "facebook-bmc-flash-layout-128.dtsi" > +???????}; > +}; > + > ?&lpc_ctrl { > ????????status = "okay"; > ?}; > diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts > index 840d19d6b1d4..71f58ad1ff06 100644 > --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts > +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts > @@ -223,6 +223,12 @@ eeprom at 2 { > ????????}; > ?}; > ? > +&fmc { > +???????flash at 0 { > +#include "facebook-bmc-flash-layout-128-data64.dtsi" Please don't bury the change of flash layout in a patch that only claims to push the layout choice down to the platform dts. Also see my reply on patch 5/9 regarding maintenance for the Wedge400 flash layout. Andrew > +???????}; > +}; > + > ?&i2c0 { > ????????multi-master; > ????????bus-frequency = <1000000>; > diff --git a/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi b/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi > index 208cf6567ed4..4f819bf8c909 100644 > --- a/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi > +++ b/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi > @@ -54,8 +54,6 @@ flash at 0 { > ????????????????status = "okay"; > ????????????????m25p,fast-read; > ????????????????label = "spi0.0"; > - > -#include "facebook-bmc-flash-layout-128.dtsi" > ????????}; > ? > ????????flash at 1 { From andrew at codeconstruct.com.au Mon Jul 21 13:30:41 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Mon, 21 Jul 2025 13:00:41 +0930 Subject: [PATCH v3 0/4] ARM: dts: aspeed: nvidia: Update DTS to support GB200NVL hardware In-Reply-To: <20250717-update-gb200nvl-dts-for-new-hardware-v3-0-f28145c55c98@nvidia.com> References: <20250717-update-gb200nvl-dts-for-new-hardware-v3-0-f28145c55c98@nvidia.com> Message-ID: <175306864149.1300934.10142311415731184566.b4-ty@codeconstruct.com.au> On Thu, 17 Jul 2025 09:52:09 +0000, Willie Thai wrote: > Update the DTS file for the GB200NVL hardware change. > > Thanks, I've applied this to be picked up through the BMC tree. -- Andrew Jeffery From andrew at codeconstruct.com.au Mon Jul 21 13:41:51 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Mon, 21 Jul 2025 13:11:51 +0930 Subject: [PATCH v9 2/2] ARM: dts: aspeed: ventura: add Meta Ventura BMC In-Reply-To: <20250716094329.1069203-3-pkleequanta@gmail.com> References: <20250716094329.1069203-1-pkleequanta@gmail.com> <20250716094329.1069203-3-pkleequanta@gmail.com> Message-ID: <6b1ade72e11089b0fab13a4f6ef53a1ea65fa732.camel@codeconstruct.com.au> On Wed, 2025-07-16 at 17:43 +0800, P.K. Lee wrote: > Add Linux device tree related to Meta (Facebook) Ventura specific > devices connected to the BMC (AST2600) SoC. The purpose of Ventura is to > detect liquid leakage from all compute trays, switch trays and rack > sensors within the rack, log the events, and take necessary actions > accordingly. > > Signed-off-by: P.K. Lee > --- > ?arch/arm/boot/dts/aspeed/Makefile???????????? |??? 1 + > ?.../aspeed/aspeed-bmc-facebook-ventura.dts??? | 1553 +++++++++++++++++ > ?2 files changed, 1554 insertions(+) > ?create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-ventura.dts > > diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile > index c4f064e4b073..5ed6042eea97 100644 > --- a/arch/arm/boot/dts/aspeed/Makefile > +++ b/arch/arm/boot/dts/aspeed/Makefile > @@ -27,6 +27,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ > ????????aspeed-bmc-facebook-minerva.dtb \ > ????????aspeed-bmc-facebook-minipack.dtb \ > ????????aspeed-bmc-facebook-tiogapass.dtb \ > +???????aspeed-bmc-facebook-ventura.dtb \ I'm hitting a conflict here, can you please rebase this series on top of aspeed/dt from [1]? [1]: https://git.kernel.org/pub/scm/linux/kernel/git/bmc/linux.git/ > + > +???????memory at 80000000 { > +???????????????device_type = "memory"; > +???????????????reg = <0x80000000 0x80000000>; > +???????}; > + > +??? p1v8_bmc_aux: regulator-p1v8-bmc-aux { Can you please fix the indentation here? > +???????????????compatible = "regulator-fixed"; > +???????????????regulator-name = "p1v8_bmc_aux"; > +???????????????regulator-min-microvolt = <1800000>; > +???????????????regulator-max-microvolt = <1800000>; > +???????????????regulator-always-on; > +???????}; > + > +???????p2v5_bmc_aux: regulator-p2v5-bmc-aux { > +???????????????compatible = "regulator-fixed"; > +???????????????regulator-name = "p2v5_bmc_aux"; > +???????????????regulator-min-microvolt = <2500000>; > +???????????????regulator-max-microvolt = <2500000>; > +???????????????regulator-always-on; > +???????}; > + > +??? spi1_gpio: spi { And again here? Please check the entire devicetree for similar issues. > +???????????????compatible = "spi-gpio"; > +???????????????#address-cells = <1>; > +???????????????#size-cells = <0>; > + > +???????????????sck-gpios = <&gpio0 ASPEED_GPIO(Z, 3) GPIO_ACTIVE_HIGH>; > +???????????????mosi-gpios = <&gpio0 ASPEED_GPIO(Z, 4) GPIO_ACTIVE_HIGH>; > +???????????????miso-gpios = <&gpio0 ASPEED_GPIO(Z, 5) GPIO_ACTIVE_HIGH>; > +???????????????cs-gpios = <&gpio0 ASPEED_GPIO(Z, 0) GPIO_ACTIVE_LOW>; > +???????????????num-chipselects = <1>; > + > +???????????????tpm at 0 { > +???????????????????????compatible = "infineon,slb9670", "tcg,tpm_tis-spi"; > +???????????????????????spi-max-frequency = <33000000>; > +???????????????????????reg = <0>; > +???????????????}; > +???????}; > +}; > + [...] > +???????????????i2c3mux0ch3: i2c at 3 { > +???????????????????????#address-cells = <1>; > +???????????????????????#size-cells = <0>; > +???????????????????????reg = <3>; > + > +???????????????????????// Fan Board 0 FRU > +???????????????????????eeprom at 56 { > +???????????????????????????????compatible = "atmel,24c128"; > +???????????????????????????????reg = <0x56>; > +???????????????????????}; > + > +???????????????????????fan_leds_g1_gpio: gpio at 21 { Please make sure the devicetree meets the style guide[2], particularly the order of nodes: https://docs.kernel.org/devicetree/bindings/dts-coding-style.html#order-of-nodes Here, devices should be listed in ascending order of address. Please check the entire devicetree. [2]: https://docs.kernel.org/devicetree/bindings/dts-coding-style.html Andrew From andrew at codeconstruct.com.au Mon Jul 21 13:52:19 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Mon, 21 Jul 2025 13:22:19 +0930 Subject: [PATCH v8 2/2] ARM: dts: aspeed: clemente: add Meta Clemente BMC In-Reply-To: <20250717-add-support-for-meta-clemente-bmc-v8-2-2ff6afb36b0e@fii-foxconn.com> References: <20250717-add-support-for-meta-clemente-bmc-v8-0-2ff6afb36b0e@fii-foxconn.com> <20250717-add-support-for-meta-clemente-bmc-v8-2-2ff6afb36b0e@fii-foxconn.com> Message-ID: On Thu, 2025-07-17 at 22:59 +0800, Leo Wang wrote: > From: Leo Wang > > Add linux device tree entry for Meta Clemente compute-tray > BMC using AST2600 SoC. > > Signed-off-by: Leo Wang > [...] > +???????}; > + > +// PDB TEMP SENSOR This comment should be indented appropriately? > +???????temperature-sensor at 4e { > +???????????????compatible = "ti,tmp1075"; > +???????????????reg = <0x4e>; > +???????}; > [...] > + > +&i2c11 { > +???????status = "okay"; > +???????aspeed,enable-byte; This is not a property specified in any accepted binding, please drop it. arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: i2c at 600 (aspeed,ast2600-i2c-bus): Unevaluated properties are not allowed ('aspeed,enable-byte' was unexpected) from schema $id: http://devicetree.org/schemas/i2c/aspeed,i2c.yaml# > + > +???????ssif-bmc at 10 { > +???????????????compatible = "ssif-bmc"; > +???????????????reg = <0x10>; > +???????}; > +}; > [...] > + > diff --git a/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi b/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi > index 289668f051eb4271ac48ae3ce9b82587911548ee..61b1d1c5040c820f8c995132739becde80e069bb 100644 > --- a/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi > +++ b/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi > @@ -412,6 +412,16 @@ pinctrl_mdio4_default: mdio4_default { > ????????????????groups = "MDIO4"; > ????????}; > ? > +???????pinctrl_ncsi3_default: ncsi3_default { > +???????????????function = "RMII3"; > +???????????????groups = "NCSI3"; > +???????}; > + > +???????pinctrl_ncsi4_default: ncsi4_default { > +???????????????function = "RMII4"; > +???????????????groups = "NCSI4"; > +???????}; > + Can you please make this a separate patch? Thanks, Andrew From jacky_chou at aspeedtech.com Mon Jul 21 13:47:01 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Mon, 21 Jul 2025 03:47:01 +0000 Subject: =?utf-8?B?5Zue6KaGOiBbUEFUQ0ggdjIgMDEvMTBdIGR0LWJpbmRpbmdzOiBzb2M6IGFz?= =?utf-8?Q?peed:_Add_ASPEED_PCIe_Config_support?= In-Reply-To: <20250716-wine-partridge-of-wonder-af10a6@krzk-bin> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> <20250715034320.2553837-2-jacky_chou@aspeedtech.com> <20250716-wine-partridge-of-wonder-af10a6@krzk-bin> Message-ID: Hi Krzysztof, Thank you for your reply. > > +maintainers: > > + - Jacky Chou > > + > > +description: | > > Drop | > Agreed. > > + The ASPEED PCIe configuration syscon block provides a set of > > + registers shared by multiple PCIe-related devices within the SoC. > > + This node represents the common configuration space that allows > > + these devices to coordinate and manage shared PCIe settings, > > + including address mapping, control, and status registers. The > > + syscon interface enables for various PCIe devices to access and modify > these shared registers in a consistent and centralized manner. > > + > > +properties: > > + compatible: > > + items: > > + - enum: > > + - aspeed,pcie-cfg > > NAK, see writing bindings. You already received comments about generic > compatible in the past. > I understand the generic aspeed,pcie-cfg is not acceptable per the binding guidelines. I will update it in the next version to use a more specific name like aspeed,ast2600-pciecfg. Thanks again for your guidance. Thanks, Jacky From jacky_chou at aspeedtech.com Mon Jul 21 13:44:42 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Mon, 21 Jul 2025 03:44:42 +0000 Subject: =?utf-8?B?5Zue6KaGOiBbUEFUQ0ggdjIgMDMvMTBdIGR0LWJpbmRpbmdzOiBQQ0k6IEFk?= =?utf-8?Q?d_ASPEED_PCIe_RC_support?= In-Reply-To: <20250716-watchful-enigmatic-condor-0fc6b3@krzk-bin> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> <20250715034320.2553837-4-jacky_chou@aspeedtech.com> <20250716-watchful-enigmatic-condor-0fc6b3@krzk-bin> Message-ID: Hi Krzysztof, Thank you for your reply. > No, describe the hardware, not "this binding". > > > configuring the PCIe RC node, including support for syscon phandles, > > MSI, clocks, resets, and interrupt mapping. The schema enforces strict > > property validation and provides a comprehensive example for reference. > > Don't say what schema does or does not. It's completely redundant. > Describe the hardware. > > Your entire commit is redundantn and not helpful at all. > I will revise the commit message in the next version. Thanks for your guidance. > > > > ... > > > + > > + aspeed,ahbc: > > + $ref: /schemas/types.yaml#/definitions/phandle > > + description: > > + Phandle to the ASPEED AHB Controller (AHBC) syscon node. > > + This reference is used by the PCIe controller to access > > + system-level configuration registers related to the AHB bus. > > + To enable AHB access for the PCIe controller. > > + > > + aspeed,pciecfg: > > + $ref: /schemas/types.yaml#/definitions/phandle > > + description: > > + Phandle to the ASPEED PCIe configuration syscon node. > > + This reference allows the PCIe controller to access > > + SoC-specific PCIe configuration registers. There are the others > > + functions such PCIe RC and PCIe EP will use this common register > > + to configure the SoC interfaces. > > + > > + aspeed,pciephy: > > No, phys are not syscons. I already told you that in v1. > I will remove the aspeed,pciephy syscon reference and rework this part to use the standard phys binding properly. Sorry for overlooking your previous feedback in v1. Thanks again for your patience. > > + $ref: /schemas/types.yaml#/definitions/phandle > > + description: > > + Phandle to the ASPEED PCIe PHY syscon node. > > + This property provides access to the PCIe PHY control > > + registers required for link initialization and management. > > + The other functions such PCIe RC and PCIe EP will use this > > + common register to configure the PHY interfaces and get some > > + information from the PHY. > > + > > + interrupt-controller: > > + description: Interrupt controller node for handling legacy PCI > interrupts. > > + type: object > > + properties: > > + '#address-cells': > > + const: 0 > > + '#interrupt-cells': > > + const: 1 > > + interrupt-controller: true > > + > > + required: > > + - '#address-cells' > > + - '#interrupt-cells' > > + - interrupt-controller > > + > > + additionalProperties: false > > + > > +allOf: > > + - $ref: /schemas/pci/pci-bus-common.yaml# > > No other binding references this. Don't write completely different code than all > other SoCs. This entire binding is written such way. > Agreed. I will remove it in next version. > > + - $ref: /schemas/pci/pci-host-bridge.yaml# > > + - $ref: /schemas/interrupt-controller/msi-controller.yaml# > > + - if: > > + properties: > > + compatible: > > + contains: > > + const: aspeed,ast2600-pcie > > + then: > > + required: > > + - aspeed,ahbc > > + else: > > + properties: > > + aspeed,ahbc: false > > + > > +required: > > + - reg > > + - interrupts > > + - bus-range > > + - ranges > > + - resets > > + - reset-names > > + - msi-parent > > + - msi-controller > > + - aspeed,pciecfg > > + - interrupt-map-mask > > + - interrupt-map > > + - interrupt-controller > > + > > +unevaluatedProperties: false > > + > > +patternProperties: > > + "^pcie@[0-9a-f,]+$": > > Why do you need it? Also, order things according to example schema. > Thanks for your question. In the v1 discussion, another reviewer suggested that we should support a multi-port structure for the PCIe root complex, where each port is represented as a child node (e.g., pcie at ...). That's why patternProperties was added here ? to explicitly allow such subnodes and validate them properly. Thanks, Jacky From jacky_chou at aspeedtech.com Mon Jul 21 13:32:57 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Mon, 21 Jul 2025 03:32:57 +0000 Subject: =?utf-8?B?5Zue6KaGOiBbUEFUQ0ggdjIgMDQvMTBdIGR0LWJpbmRpbmdzOiBwaW5jdHJs?= =?utf-8?B?OiBhc3BlZWQsYXN0MjYwMC1waW5jdHJsOiBBZGQgUENJZSBSQyBQRVJTVCMg?= =?utf-8?Q?group?= In-Reply-To: <20250716-provocative-worm-of-gallantry-3797f8@krzk-bin> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> <20250715034320.2553837-5-jacky_chou@aspeedtech.com> <20250716-provocative-worm-of-gallantry-3797f8@krzk-bin> Message-ID: Hi Krzysztof, Thank you for your reply. > > Add PCIe PERST# group to support for PCIe RC. > > > > Signed-off-by: Jacky Chou > > --- > > .../devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yaml | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git > > a/Documentation/devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yam > > l > > b/Documentation/devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yam > > l index 80974c46f3ef..5d7fbb1c72b7 100644 > > --- > > a/Documentation/devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl.yam > > l > > +++ b/Documentation/devicetree/bindings/pinctrl/aspeed,ast2600-pinctrl > > +++ .yaml > > @@ -254,6 +254,7 @@ additionalProperties: > > - WDTRST2 > > - WDTRST3 > > - WDTRST4 > > + - PCIERC1 > > What feedback Aspeed received about ordering lists? More than once? > Thank you for pointing this out. We will update the ordering accordingly in the next revision to keep the list sorted. Thanks, Jacky From jacky_chou at aspeedtech.com Mon Jul 21 13:21:31 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Mon, 21 Jul 2025 03:21:31 +0000 Subject: =?big5?B?pl7C0DogW1BBVENIIHYyIDA2LzEwXSBBUk06IGR0czogYXNwZWVkLWc2OiBBZGQg?= =?big5?Q?PCIe_RC_node?= In-Reply-To: <20250720222230.GA2842356-robh@kernel.org> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> <20250715034320.2553837-7-jacky_chou@aspeedtech.com> <20250720222230.GA2842356-robh@kernel.org> Message-ID: > > > > quality = <100>; > > > > }; > > > > > > > > + pcie_phy1: syscon at 1e6ed200 { > > > > + compatible = "aspeed,pcie-phy", > > > "syscon"; > > > > + reg = <0x1e6ed200 0x100>; > > > > > > This looks like part of something else? It should be a child of that. > > > > > > If this is the controls for the PCIe PHY, then use the PHY binding > > > instead of your own custom phandle property. > > > > > > > Our PCIe design has multiple functions. And the series of patches are > > submitted for PCIe RC. The other PCIe functions also use this phy node. > > I traced the PHY driver interface, it cannot meet our usage. > > Why not? > > There is also no requirement that using the DT PHY binding means you have to > use the Linux PHY subsystem. > Got it. I always focused on when using the "phys" property, I must use the Linux PHY subsystem. I will change this part to use the "phys" property instead of our definition property. Thank you for your comments. > > Therefore, the RC driver uses the phandle property to configure. > > And this syscon also is used by the other PCIe functions. > > Like what? > Other PCIe functions such as MCTP also use the PHY interface. > > > > + }; > > > > + > > > > + pcie_cfg: syscon at 1e770000 { > > > > + compatible = "aspeed,pcie-cfg", > > > "syscon"; > > > > + reg = <0x1e770000 0x80>; > > > > > > Looks like this is really part of the PCIe block as a h/w block > > > isn't going to start at offset 0xc0. > > > > > > > > > > Actually. > > There are two PCIe bus in AST2600 > > We use the other one PCIe to EP mode, here I call PCIe A. > > I call the pcie0 node as PCIe B. > > We do not provide PCIe A to RC mode for usage, just EP mode. > > But, when PCIe A is used as RC, it reg mapping is starting from 0x1e770080. > > I list there mapping. > > > > 0x1e77_0000 ~ 0x1e77_007f : common usage > > 0x1e77_0080 ~ 0x1e77_00bf : PCIE A > > 0x1e77_00C0 ~ 0x1e77_00ff : PCIE B > > > > So, it is why we create one node to describe common usage for PCIe A and B. > > And, why the pcie0 reg mapping is starting from 0x1e77_00c0. > > In that case, maybe you need a common parent node with 2 child nodes for > each bus. Got it. But we may remove the pcie_cfg node and merge these register regions. > > > > > > + }; > > > > + > > > > + pcie0: pcie at 1e7700c0 { > > > > + compatible = > "aspeed,ast2600-pcie"; > > > > + device_type = "pci"; > > > > + reg = <0x1e7700c0 0x40>; > > > > + linux,pci-domain = <0>; > > > > > > No need for this. You only have 1 PCI host. > > > > > > > Agreed. > > We only provide one RC. > > > > > > + #address-cells = <3>; > > > > + #size-cells = <2>; > > > > + interrupts = > > IRQ_TYPE_LEVEL_HIGH>; > > > > + bus-range = <0x80 0xff>; > > > > > > Does this h/w not support bus 0-0x7f for some reason? > > > > > > > List: > > PCIE A: 0-0x7f > > PCIE B: 0x80-0xff > > > > It is our design on PCIe B to use bus-range 0x80-0xff. > > That's a policy or h/w limitation? > It is a hardware limitation of this PCIe RC. Thanks, Jacky From rentao.bupt at gmail.com Mon Jul 21 15:55:19 2025 From: rentao.bupt at gmail.com (Tao Ren) Date: Sun, 20 Jul 2025 22:55:19 -0700 Subject: [PATCH v2 5/9] ARM: dts: aspeed: wedge400: Extend data0 partition to 64MB In-Reply-To: <0b9b6c712bff18a25da218c507d18b9a8f18c7e8.camel@codeconstruct.com.au> References: <20250706042404.138128-1-rentao.bupt@gmail.com> <20250706042404.138128-6-rentao.bupt@gmail.com> <0b9b6c712bff18a25da218c507d18b9a8f18c7e8.camel@codeconstruct.com.au> Message-ID: Hi Andrew, On Mon, Jul 21, 2025 at 10:42:03AM +0930, Andrew Jeffery wrote: > On Sat, 2025-07-05 at 21:23 -0700, rentao.bupt at gmail.com wrote: > > From: Tao Ren > > > > Extend wedge400 BMC flash's data0 partition to 64MB for larger > > persistent storage. > > > > Signed-off-by: Tao Ren > > --- > > Changes in v2: > > ? - None (the patch is introduced in v2). > > > > ?arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts | 2 +- > > ?1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts > > index 3e4d30f0884d..cf6c768cbad5 100644 > > --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts > > +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts > > @@ -92,7 +92,7 @@ tpm at 0 { > > ? * Both firmware flashes are 128MB on Wedge400 BMC. > > ? */ > > ?&fmc_flash0 { > > -#include "facebook-bmc-flash-layout-128.dtsi" > > +#include "facebook-bmc-flash-layout-128-data64.dtsi" > > My preference here is that we maintain two separate DTS for Wedge400: > > - aspeed-bmc-facebook-wedge400.dts > - aspeed-bmc-facebook-wedge400-data64.dts > > We do so such that we implement aspeed-bmc-facebook-wedge400.dts like: > > > cat aspeed-bmc-facebook-wedge400.dts > #include "aspeed-bmc-facebook-wedge400-data64.dts" > > &fmc_flash0 { > /delete-node/partitions; > #include "facebook-bmc-flash-layout-128.dtsi" > }; > > aspeed-bmc-facebook-wedge400-data64.dts includes facebook-bmc-flash- > layout-128-data64.dtsi as usual. > > From there we can consider aspeed-bmc-facebook-wedge400.dts to be > deprecated and can remove it in a future release. At least with this > arrangement any revert of the (future) patch removing aspeed-bmc- > facebook-wedge400.dts has no other impact. Further, both layouts will > be supported in at least one release, making it possible to update the > kernel without requiring a simultaneous update to the flash layout. > > Andrew Thank you for the detailed explanation. Let me send out v3 after testing the changes. Cheers, Tao From krzk at kernel.org Mon Jul 21 17:00:21 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Mon, 21 Jul 2025 09:00:21 +0200 Subject: =?UTF-8?B?UmU6IOWbnuimhjogW1BBVENIIHYyIDAzLzEwXSBkdC1iaW5kaW5nczog?= =?UTF-8?Q?PCI=3A_Add_ASPEED_PCIe_RC_support?= In-Reply-To: References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> <20250715034320.2553837-4-jacky_chou@aspeedtech.com> <20250716-watchful-enigmatic-condor-0fc6b3@krzk-bin> Message-ID: <61ced029-987e-4484-9a0a-7c911518ffd8@kernel.org> On 21/07/2025 05:44, Jacky Chou wrote: >>> +patternProperties: >>> + "^pcie@[0-9a-f,]+$": >> >> Why do you need it? Also, order things according to example schema. >> > > Thanks for your question. > > In the v1 discussion, another reviewer suggested that we should support a > multi-port structure for the PCIe root complex, > where each port is represented as a child node (e.g., pcie at ...). > That's why patternProperties was added here ? to explicitly allow such > subnodes and validate them properly. And schema does not allow it already? Best regards, Krzysztof From krzk at kernel.org Mon Jul 21 17:42:21 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Mon, 21 Jul 2025 09:42:21 +0200 Subject: [PATCH v5 1/2] Documentation: devicetree: Add binding for NVIDIA GB200-UT3.0b platform In-Reply-To: <20250718231118.3330855-2-donalds@nvidia.com> References: <20250718231118.3330855-1-donalds@nvidia.com> <20250718231118.3330855-2-donalds@nvidia.com> Message-ID: <20250721-auspicious-uptight-parrot-b1e19f@kuoka> On Fri, Jul 18, 2025 at 04:11:17PM -0700, Donald Shannon wrote: > This is an Aspeed AST2600 based unit testing platform for GB200. > UT3.0b is different than nvidia-gb200nvl-bmc due to networking topology > differences, additional gpio expanders, and voltage regulator gating > some devices. > > Reference to Ast2600 SOC [1]. > Reference to Blackwell GB200NVL Platform [2]. Please use subject prefixes matching the subsystem. You can get them for example with 'git log --oneline -- DIRECTORY_OR_FILE' on the directory your patch is touching. For bindings, the preferred subjects are explained here: https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters A nit, subject: drop second/last, redundant "binding". The "dt-bindings" prefix is already stating that these are bindings. See also: https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18 With above two: Acked-by: Krzysztof Kozlowski
This is an automated instruction, just in case, because many review tags are being ignored. If you know the process, just skip it entirely (please do not feel offended by me posting it here - no bad intentions intended, no patronizing, I just want to avoid wasted efforts). If you do not know the process, here is a short explanation: Please add Acked-by/Reviewed-by/Tested-by tags when posting new versions of patchset, under or above your Signed-off-by tag, unless patch changed significantly (e.g. new properties added to the DT bindings). Tag is "received", when provided in a message replied to you on the mailing list. Tools like b4 can help here ('b4 trailers -u ...'). However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for tags received on the version they apply. https://elixir.bootlin.com/linux/v6.15/source/Documentation/process/submitting-patches.rst#L591
Best regards, Krzysztof From krzk at kernel.org Mon Jul 21 17:44:15 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Mon, 21 Jul 2025 09:44:15 +0200 Subject: [PATCH v5 2/2] ARM: dts: aspeed: Add device tree for Nvidia's GB200 UT3.0b platform BMC In-Reply-To: <20250718231118.3330855-3-donalds@nvidia.com> References: <20250718231118.3330855-1-donalds@nvidia.com> <20250718231118.3330855-3-donalds@nvidia.com> Message-ID: <20250721-hulking-violet-mastodon-16e87a@kuoka> On Fri, Jul 18, 2025 at 04:11:18PM -0700, Donald Shannon wrote: > + > +/ { > + model = "AST2600 GB200 UT3.0b BMC"; > + compatible = "nvidia,gb200-ut30b", "aspeed,ast2600"; > + > + aliases { > + serial2 = &uart3; > + serial4 = &uart5; > + i2c16 = &imux16; > + i2c17 = &imux17; > + i2c18 = &imux18; > + i2c19 = &imux19; > + i2c20 = &imux20; > + i2c21 = &imux21; > + i2c22 = &imux22; > + i2c23 = &imux23; > + i2c24 = &imux24; > + i2c25 = &imux25; > + i2c26 = &imux26; > + i2c27 = &imux27; > + i2c28 = &imux28; > + i2c29 = &imux29; > + i2c30 = &imux30; > + i2c31 = &imux31; > + i2c32 = &imux32; > + i2c33 = &imux33; > + i2c34 = &imux34; > + i2c35 = &imux35; > + i2c36 = &imux36; > + i2c37 = &imux37; > + i2c38 = &imux38; > + i2c39 = &imux39; > + i2c40 = &e1si2c0; > + i2c41 = &e1si2c1; > + i2c42 = &e1si2c2; > + i2c43 = &e1si2c3; > + i2c48 = &i2c17mux0; > + i2c49 = &i2c17mux1; > + i2c50 = &i2c17mux2; > + i2c51 = &i2c17mux3; > + i2c52 = &i2c25mux0; > + i2c53 = &i2c25mux1; > + i2c54 = &i2c25mux2; > + i2c55 = &i2c25mux3; > + i2c56 = &i2c29mux0; > + i2c57 = &i2c29mux1; > + i2c58 = &i2c29mux2; > + i2c59 = &i2c29mux3; > + }; > + > + buttons { > + button-power { > + label = "power-btn"; How is this supposed to work? How does anything bind here? > + gpio = <&sgpiom0 156 GPIO_ACTIVE_LOW>; > + }; > + button-uid { > + label = "uid-btn"; > + gpio = <&sgpiom0 154 GPIO_ACTIVE_LOW>; > + }; > + }; > + > + chosen { > + stdout-path = &uart5; > + }; > + > + leds { > + compatible = "gpio-leds"; > + led-0 { > + label = "uid_led"; > + gpios = <&sgpiom0 27 GPIO_ACTIVE_LOW>; > + }; > + led-1 { > + label = "fault_led"; > + gpios = <&sgpiom0 29 GPIO_ACTIVE_LOW>; > + }; > + led-2 { > + label = "power_led"; > + gpios = <&sgpiom0 31 GPIO_ACTIVE_LOW>; > + }; > + }; > + > + memory at 80000000 { > + device_type = "memory"; > + reg = <0x80000000 0x80000000>; > + }; > + > + reg_3v3_stby: regulator-3v3-standby { > + compatible = "regulator-fixed"; > + regulator-name = "3v3-standby"; > + regulator-min-microvolt = <1800000>; > + regulator-max-microvolt = <1800000>; > + gpio = <&gpio0 ASPEED_GPIO(M, 3) GPIO_ACTIVE_HIGH>; > + enable-active-high; > + regulator-always-on; > + }; > + > + reserved-memory { > + #address-cells = <1>; > + #size-cells = <1>; > + ranges; > + > + vga_memory: framebuffer at 9f000000 { > + no-map; > + reg = <0x9f000000 0x01000000>; /* 16M */ > + }; > + > + ramoops at a0000000 { > + compatible = "ramoops"; > + reg = <0xa0000000 0x100000>; /* 1MB */ > + record-size = <0x10000>; /* 64KB */ > + max-reason = <2>; /* KMSG_DUMP_OOPS */ > + }; > + > + gfx_memory: framebuffer { > + compatible = "shared-dma-pool"; > + reusable; > + size = <0x01000000>; > + alignment = <0x01000000>; > + }; > + > + video_engine_memory: jpegbuffer { > + compatible = "shared-dma-pool"; > + reusable; > + size = <0x02000000>; /* 32M */ > + alignment = <0x01000000>; > + }; > + }; > +}; > + > +// Enable Primary flash on FMC for bring up activity > +&fmc { > + status = "okay"; > + flash at 0 { > + compatible = "jedec,spi-nor"; > + label = "bmc"; > + spi-max-frequency = <50000000>; > + status = "okay"; Why do you need it? Anything disabled it? Best regards, Krzysztof From jammy_huang at aspeedtech.com Tue Jul 22 11:31:15 2025 From: jammy_huang at aspeedtech.com (Jammy Huang) Date: Tue, 22 Jul 2025 09:31:15 +0800 Subject: [PATCH v7 0/2] ASPEED: Add mailbox driver for AST2700 series Message-ID: <20250722013117.2561025-1-jammy_huang@aspeedtech.com> Add mailbox controller driver for AST27XX SoCs, which provides independent tx/rx mailbox between different processors. There are 4 channels for each tx/rx mailbox and each channel has an 32-byte FIFO. v7 changes: - Update driver 1. clean for loop v6 changes: - Update document 1. Update description to preserve paragraphs. 2. Update for property, reg. 3. Add reg-names. 4. Add 'Reviewed-by' from Krok. - Update driver 1. Use devm_platform_ioremap_resource_byname since we add reg-names now. 2. Update error code for ch not enabled. v5 changes: - Update document 1. Separate reg from 1 to 2. 1st is tx controller; 2nd is rx. 2. Remove 'Reviewed-by' since the patch has changed. - Update driver, no functional changes. 1. Update since there is 2 reg base now. 2. Refine reg definitions 3. Add spinlock to protect registers 4. Use bool as return value for ast2700_mbox_tx_done 5. Rename variable from drv_data to dev_data. v4 changes: - Update driver, no functional changes. 1. Remove unused variable, rx_buff, in struct ast2700_mbox. 2. Remove unneeded cast on device_get_match_data. 3. Remove the usage of writel/readl_relaxed. 4. Improve readability. v3 changes: - Correct document 1. Use 32-bit addressing in dts example property, reg. v2 changes: - Update document 1. Correct error in dts example. 2. Drop description for mbox-cell per suggestion previously. Jammy Huang (2): dt-bindings: mailbox: Add ASPEED AST2700 series SoC mailbox: aspeed: add mailbox driver for AST27XX series SoC .../mailbox/aspeed,ast2700-mailbox.yaml | 68 +++++ drivers/mailbox/Kconfig | 8 + drivers/mailbox/Makefile | 2 + drivers/mailbox/ast2700-mailbox.c | 235 ++++++++++++++++++ 4 files changed, 313 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/aspeed,ast2700-mailbox.yaml create mode 100644 drivers/mailbox/ast2700-mailbox.c base-commit: 8c2e52ebbe885c7eeaabd3b7ddcdc1246fc400d2 -- 2.25.1 From jammy_huang at aspeedtech.com Tue Jul 22 11:31:16 2025 From: jammy_huang at aspeedtech.com (Jammy Huang) Date: Tue, 22 Jul 2025 09:31:16 +0800 Subject: [PATCH v7 1/2] dt-bindings: mailbox: Add ASPEED AST2700 series SoC In-Reply-To: <20250722013117.2561025-1-jammy_huang@aspeedtech.com> References: <20250722013117.2561025-1-jammy_huang@aspeedtech.com> Message-ID: <20250722013117.2561025-2-jammy_huang@aspeedtech.com> Introduce the mailbox module for AST27XX series SoC, which is responsible for interchanging messages between asymmetric processors. Signed-off-by: Jammy Huang Reviewed-by: Krzysztof Kozlowski Reviewed-by: Andrew Jeffery --- .../mailbox/aspeed,ast2700-mailbox.yaml | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/aspeed,ast2700-mailbox.yaml diff --git a/Documentation/devicetree/bindings/mailbox/aspeed,ast2700-mailbox.yaml b/Documentation/devicetree/bindings/mailbox/aspeed,ast2700-mailbox.yaml new file mode 100644 index 000000000000..600e2d63fccd --- /dev/null +++ b/Documentation/devicetree/bindings/mailbox/aspeed,ast2700-mailbox.yaml @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mailbox/aspeed,ast2700-mailbox.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ASPEED AST2700 mailbox controller + +maintainers: + - Jammy Huang + +description: > + ASPEED AST2700 has multiple processors that need to communicate with each + other. The mailbox controller provides a way for these processors to send + messages to each other. It is a hardware-based inter-processor communication + mechanism that allows processors to send and receive messages through + dedicated channels. + + The mailbox's tx/rx are independent, meaning that one processor can send a + message while another processor is receiving a message simultaneously. + There are 4 channels available for both tx and rx operations. Each channel + has a FIFO buffer that can hold messages of a fixed size (32 bytes in this + case). + + The mailbox controller also supports interrupt generation, allowing + processors to notify each other when a message is available or when an event + occurs. + +properties: + compatible: + const: aspeed,ast2700-mailbox + + reg: + items: + - description: TX control register + - description: RX control register + + reg-names: + items: + - const: tx + - const: rx + + interrupts: + maxItems: 1 + + "#mbox-cells": + const: 1 + +required: + - compatible + - reg + - reg-names + - interrupts + - "#mbox-cells" + +additionalProperties: false + +examples: + - | + #include + + mailbox at 12c1c200 { + compatible = "aspeed,ast2700-mailbox"; + reg = <0x12c1c200 0x100>, <0x12c1c300 0x100>; + reg-names = "tx", "rx"; + interrupts = ; + #mbox-cells = <1>; + }; -- 2.25.1 From jammy_huang at aspeedtech.com Tue Jul 22 11:31:17 2025 From: jammy_huang at aspeedtech.com (Jammy Huang) Date: Tue, 22 Jul 2025 09:31:17 +0800 Subject: [PATCH v7 2/2] mailbox: aspeed: add mailbox driver for AST27XX series SoC In-Reply-To: <20250722013117.2561025-1-jammy_huang@aspeedtech.com> References: <20250722013117.2561025-1-jammy_huang@aspeedtech.com> Message-ID: <20250722013117.2561025-3-jammy_huang@aspeedtech.com> Add mailbox controller driver for AST27XX SoCs, which provides independent tx/rx mailbox between different processors. There are 4 channels for each tx/rx mailbox and each channel has an 32-byte FIFO. Signed-off-by: Jammy Huang Reviewed-by: Andrew Jeffery --- drivers/mailbox/Kconfig | 8 + drivers/mailbox/Makefile | 2 + drivers/mailbox/ast2700-mailbox.c | 235 ++++++++++++++++++++++++++++++ 3 files changed, 245 insertions(+) create mode 100644 drivers/mailbox/ast2700-mailbox.c diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig index 68eeed660a4a..1c38cd570091 100644 --- a/drivers/mailbox/Kconfig +++ b/drivers/mailbox/Kconfig @@ -340,4 +340,12 @@ config THEAD_TH1520_MBOX kernel is running, and E902 core used for power management among other things. +config AST2700_MBOX + tristate "ASPEED AST2700 IPC driver" + depends on ARCH_ASPEED || COMPILE_TEST + help + Mailbox driver implementation for ASPEED AST27XX SoCs. This driver + can be used to send message between different processors in SoC. + The driver provides mailbox support for sending interrupts to the + clients. Say Y here if you want to build this driver. endif diff --git a/drivers/mailbox/Makefile b/drivers/mailbox/Makefile index 13a3448b3271..9a9add9a7548 100644 --- a/drivers/mailbox/Makefile +++ b/drivers/mailbox/Makefile @@ -72,3 +72,5 @@ obj-$(CONFIG_QCOM_CPUCP_MBOX) += qcom-cpucp-mbox.o obj-$(CONFIG_QCOM_IPCC) += qcom-ipcc.o obj-$(CONFIG_THEAD_TH1520_MBOX) += mailbox-th1520.o + +obj-$(CONFIG_AST2700_MBOX) += ast2700-mailbox.o diff --git a/drivers/mailbox/ast2700-mailbox.c b/drivers/mailbox/ast2700-mailbox.c new file mode 100644 index 000000000000..080fb02c917c --- /dev/null +++ b/drivers/mailbox/ast2700-mailbox.c @@ -0,0 +1,235 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * Copyright Aspeed Technology Inc. (C) 2025. All rights reserved + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Each bit in the register represents an IPC ID */ +#define IPCR_TX_TRIG 0x00 +#define IPCR_ENABLE 0x04 +#define IPCR_STATUS 0x08 +#define RX_IRQ(n) BIT(n) +#define RX_IRQ_MASK 0xf +#define IPCR_DATA 0x10 + +struct ast2700_mbox_data { + u8 num_chans; + u8 msg_size; +}; + +struct ast2700_mbox { + struct mbox_controller mbox; + u8 msg_size; + void __iomem *tx_regs; + void __iomem *rx_regs; + spinlock_t lock; +}; + +static inline int ch_num(struct mbox_chan *chan) +{ + return chan - chan->mbox->chans; +} + +static inline bool ast2700_mbox_tx_done(struct ast2700_mbox *mb, int idx) +{ + return !(readl(mb->tx_regs + IPCR_STATUS) & BIT(idx)); +} + +static irqreturn_t ast2700_mbox_irq(int irq, void *p) +{ + struct ast2700_mbox *mb = p; + void __iomem *data_reg; + int num_words = mb->msg_size / sizeof(u32); + u32 *word_data; + u32 status; + int n, i; + + /* Only examine channels that are currently enabled. */ + status = readl(mb->rx_regs + IPCR_ENABLE) & + readl(mb->rx_regs + IPCR_STATUS); + + if (!(status & RX_IRQ_MASK)) + return IRQ_NONE; + + for (n = 0; n < mb->mbox.num_chans; ++n) { + struct mbox_chan *chan = &mb->mbox.chans[n]; + + if (!(status & RX_IRQ(n))) + continue; + + data_reg = mb->rx_regs + IPCR_DATA + mb->msg_size * n; + word_data = chan->con_priv; + /* Read the message data */ + for (i = 0; i < num_words; i++) + word_data[i] = readl(data_reg + i * sizeof(u32)); + + mbox_chan_received_data(chan, chan->con_priv); + + /* The IRQ can be cleared only once the FIFO is empty. */ + writel(RX_IRQ(n), mb->rx_regs + IPCR_STATUS); + } + + return IRQ_HANDLED; +} + +static int ast2700_mbox_send_data(struct mbox_chan *chan, void *data) +{ + struct ast2700_mbox *mb = dev_get_drvdata(chan->mbox->dev); + int idx = ch_num(chan); + void __iomem *data_reg = mb->tx_regs + IPCR_DATA + mb->msg_size * idx; + u32 *word_data = data; + int num_words = mb->msg_size / sizeof(u32); + int i; + + if (!(readl(mb->tx_regs + IPCR_ENABLE) & BIT(idx))) { + dev_warn(mb->mbox.dev, "%s: Ch-%d not enabled yet\n", __func__, idx); + return -ENODEV; + } + + if (!(ast2700_mbox_tx_done(mb, idx))) { + dev_warn(mb->mbox.dev, "%s: Ch-%d last data has not finished\n", __func__, idx); + return -EBUSY; + } + + /* Write the message data */ + for (i = 0 ; i < num_words; i++) + writel(word_data[i], data_reg + i * sizeof(u32)); + + writel(BIT(idx), mb->tx_regs + IPCR_TX_TRIG); + dev_dbg(mb->mbox.dev, "%s: Ch-%d sent\n", __func__, idx); + + return 0; +} + +static int ast2700_mbox_startup(struct mbox_chan *chan) +{ + struct ast2700_mbox *mb = dev_get_drvdata(chan->mbox->dev); + int idx = ch_num(chan); + void __iomem *reg = mb->rx_regs + IPCR_ENABLE; + unsigned long flags; + + spin_lock_irqsave(&mb->lock, flags); + writel(readl(reg) | BIT(idx), reg); + spin_unlock_irqrestore(&mb->lock, flags); + + return 0; +} + +static void ast2700_mbox_shutdown(struct mbox_chan *chan) +{ + struct ast2700_mbox *mb = dev_get_drvdata(chan->mbox->dev); + int idx = ch_num(chan); + void __iomem *reg = mb->rx_regs + IPCR_ENABLE; + unsigned long flags; + + spin_lock_irqsave(&mb->lock, flags); + writel(readl(reg) & ~BIT(idx), reg); + spin_unlock_irqrestore(&mb->lock, flags); +} + +static bool ast2700_mbox_last_tx_done(struct mbox_chan *chan) +{ + struct ast2700_mbox *mb = dev_get_drvdata(chan->mbox->dev); + int idx = ch_num(chan); + + return ast2700_mbox_tx_done(mb, idx); +} + +static const struct mbox_chan_ops ast2700_mbox_chan_ops = { + .send_data = ast2700_mbox_send_data, + .startup = ast2700_mbox_startup, + .shutdown = ast2700_mbox_shutdown, + .last_tx_done = ast2700_mbox_last_tx_done, +}; + +static int ast2700_mbox_probe(struct platform_device *pdev) +{ + struct ast2700_mbox *mb; + const struct ast2700_mbox_data *dev_data; + struct device *dev = &pdev->dev; + int irq, ret; + + if (!pdev->dev.of_node) + return -ENODEV; + + dev_data = device_get_match_data(&pdev->dev); + + mb = devm_kzalloc(dev, sizeof(*mb), GFP_KERNEL); + if (!mb) + return -ENOMEM; + + mb->mbox.chans = devm_kcalloc(&pdev->dev, dev_data->num_chans, + sizeof(*mb->mbox.chans), GFP_KERNEL); + if (!mb->mbox.chans) + return -ENOMEM; + + /* con_priv of each channel is used to store the message received */ + for (int i = 0; i < dev_data->num_chans; i++) { + mb->mbox.chans[i].con_priv = devm_kcalloc(dev, dev_data->msg_size, + sizeof(u8), GFP_KERNEL); + if (!mb->mbox.chans[i].con_priv) + return -ENOMEM; + } + + platform_set_drvdata(pdev, mb); + + mb->tx_regs = devm_platform_ioremap_resource_byname(pdev, "tx"); + if (IS_ERR(mb->tx_regs)) + return PTR_ERR(mb->tx_regs); + + mb->rx_regs = devm_platform_ioremap_resource_byname(pdev, "rx"); + if (IS_ERR(mb->rx_regs)) + return PTR_ERR(mb->rx_regs); + + mb->msg_size = dev_data->msg_size; + mb->mbox.dev = dev; + mb->mbox.num_chans = dev_data->num_chans; + mb->mbox.ops = &ast2700_mbox_chan_ops; + mb->mbox.txdone_irq = false; + mb->mbox.txdone_poll = true; + mb->mbox.txpoll_period = 5; + spin_lock_init(&mb->lock); + + irq = platform_get_irq(pdev, 0); + if (irq < 0) + return irq; + + ret = devm_request_irq(dev, irq, ast2700_mbox_irq, 0, dev_name(dev), mb); + if (ret) + return ret; + + return devm_mbox_controller_register(dev, &mb->mbox); +} + +static const struct ast2700_mbox_data ast2700_dev_data = { + .num_chans = 4, + .msg_size = 0x20, +}; + +static const struct of_device_id ast2700_mbox_of_match[] = { + { .compatible = "aspeed,ast2700-mailbox", .data = &ast2700_dev_data }, + {} +}; +MODULE_DEVICE_TABLE(of, ast2700_mbox_of_match); + +static struct platform_driver ast2700_mbox_driver = { + .driver = { + .name = "ast2700-mailbox", + .of_match_table = ast2700_mbox_of_match, + }, + .probe = ast2700_mbox_probe, +}; +module_platform_driver(ast2700_mbox_driver); + +MODULE_AUTHOR("Jammy Huang "); +MODULE_DESCRIPTION("ASPEED AST2700 IPC driver"); +MODULE_LICENSE("GPL"); -- 2.25.1 From ryan_chen at aspeedtech.com Tue Jul 22 19:51:54 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Tue, 22 Jul 2025 17:51:54 +0800 Subject: [PATCH v3 0/2] irqchip: aspeed: Add AST2700 INTC debugfs support and yaml update Message-ID: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> This patch series adds device tree bindings and driver support for the AST2700 SoC??s two interrupt controllers (INTC0 and INTC1), along with debugfs entries for runtime inspection of routing and register protection status, and bindings example refine. v3: - aspeed,ast2700-intc.yaml - improve commit message description. - irq-aspeed-intc.c - add platform driver for "aspeed,ast2700-intc0/1" compatible nodes. v2: - fix dt bindingcheck Ryan Chen (2): dt-bindings: interrupt-controller: aspeed: Add parent node compatibles and refine documentation irqchip: aspeed: add debugfs support and AST2700 INTC0/INTC1 routing/protection display .../aspeed,ast2700-intc.yaml | 158 ++++++++---- drivers/irqchip/irq-aspeed-intc.c | 238 ++++++++++++++++++ 2 files changed, 353 insertions(+), 43 deletions(-) -- 2.34.1 From ryan_chen at aspeedtech.com Tue Jul 22 19:51:55 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Tue, 22 Jul 2025 17:51:55 +0800 Subject: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent node compatibles and refine documentation In-Reply-To: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> Message-ID: <20250722095156.1672873-2-ryan_chen@aspeedtech.com> The AST2700 SoC contains two independent top-level interrupt controllers (INTC0 and INTC1), each responsible for handling different peripheral groups and occupying separate register spaces. Above them, PSP(CA35) GIC controller acts as the root interrupt aggregator. Accurately describing this hierarchical hardware structure in the device tree requires distinct compatible strings for the parent nodes of INTC0 and INTC1. - Adds 'aspeed,ast2700-intc0' and 'aspeed,ast2700-intc1' compatible strings for parent interrupt controller nodes. (in addition to the existing 'aspeed,ast2700-intc-ic' for child nodes) - Clarifies the relationship and function of INTC0 parent (intc0_0~x: child), INTC1 parent (intc1_0~x: child), and the GIC in the documentation. - Updates block diagrams and device tree examples to illustrate the hierarchy and compatible usage. - Refines documentation and example formatting. This change allows the device tree and driver to distinguish between parent (top-level) and child (group) interrupt controller nodes, enabling more precise driver matching SOC register space allocation. Signed-off-by: Ryan Chen --- .../aspeed,ast2700-intc.yaml | 158 +++++++++++++----- 1 file changed, 115 insertions(+), 43 deletions(-) diff --git a/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml index 55636d06a674..bdc4d8835843 100644 --- a/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml +++ b/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml @@ -10,6 +10,33 @@ description: This interrupt controller hardware is second level interrupt controller that is hooked to a parent interrupt controller. It's useful to combine multiple interrupt sources into 1 interrupt to parent interrupt controller. + Depend to which INTC0 or INTC1 used. + INTC0 and INTC1 are two kinds of interrupt controller with enable and raw + status registers for use. + INTC0 is used to assert GIC if interrupt in INTC1 asserted. + INTC1 is used to assert INTC0 if interrupt of modules asserted. + +-----+ +---------+ + | GIC |---| INTC0 | + +-----+ +---------+ + +---------+ + | |---module0 + | INTC0_0 |---module1 + | |---... + +---------+---module31 + |---.... | + +---------+ + | | +---------+ + | INTC0_11| +---| INTC1 | + | | +---------+ + +---------+ +---------+---module0 + | INTC1_0 |---module1 + | |---... + +---------+---module31 + ... + +---------+---module0 + | INTC1_5 |---module1 + | |---... + +---------+---module31 maintainers: - Kevin Chen @@ -17,49 +44,70 @@ maintainers: properties: compatible: enum: - - aspeed,ast2700-intc-ic + - aspeed,ast2700-intc0 + - aspeed,ast2700-intc1 reg: maxItems: 1 - interrupt-controller: true + '#address-cells': + const: 2 - '#interrupt-cells': + '#size-cells': const: 2 - description: - The first cell is the IRQ number, the second cell is the trigger - type as defined in interrupt.txt in this directory. - - interrupts: - maxItems: 6 - description: | - Depend to which INTC0 or INTC1 used. - INTC0 and INTC1 are two kinds of interrupt controller with enable and raw - status registers for use. - INTC0 is used to assert GIC if interrupt in INTC1 asserted. - INTC1 is used to assert INTC0 if interrupt of modules asserted. - +-----+ +-------+ +---------+---module0 - | GIC |---| INTC0 |--+--| INTC1_0 |---module2 - | | | | | | |---... - +-----+ +-------+ | +---------+---module31 - | - | +---------+---module0 - +---| INTC1_1 |---module2 - | | |---... - | +---------+---module31 - ... - | +---------+---module0 - +---| INTC1_5 |---module2 - | |---... - +---------+---module31 + ranges: true + +patternProperties: + "^interrupt-controller@": + type: object + description: Interrupt group child nodes + additionalProperties: false + + properties: + compatible: + enum: + - aspeed,ast2700-intc-ic + + reg: + maxItems: 1 + + interrupt-controller: true + + '#interrupt-cells': + const: 2 + description: | + The first cell is the IRQ number, the second cell is the trigger + type as defined in interrupt.txt in this directory. + + interrupts: + minItems: 1 + maxItems: 6 + description: | + The interrupts provided by this interrupt controller. + + interrupts-extended: + minItems: 1 + maxItems: 6 + description: | + This property is required when defining a cascaded interrupt controller + that is connected under another interrupt controller. It specifies the + parent interrupt(s) in the upstream controller to which this controller + is connected. + + oneOf: + - required: [interrupts] + - required: [interrupts-extended] + + required: + - compatible + - reg + - interrupt-controller + - '#interrupt-cells' required: - compatible - reg - - interrupt-controller - - '#interrupt-cells' - - interrupts additionalProperties: false @@ -68,19 +116,43 @@ examples: #include bus { + #address-cells = <2>; + #size-cells = <2>; + + intc0: interrupt-controller at 12100000 { + compatible = "aspeed,ast2700-intc0"; + reg = <0 0x12100000 0 0x4000>; + ranges = <0x0 0x0 0x0 0x12100000 0x0 0x4000>; + #address-cells = <2>; + #size-cells = <2>; + + intc0_11: interrupt-controller at 1b00 { + compatible = "aspeed,ast2700-intc-ic"; + reg = <0 0x12101b00 0 0x10>; + #interrupt-cells = <2>; + interrupt-controller; + interrupts = , + , + , + , + , + ; + }; + }; + + intc1: interrupt-controller at 14c18000 { + compatible = "aspeed,ast2700-intc1"; + reg = <0 0x14c18000 0 0x400>; + ranges = <0x0 0x0 0x0 0x14c18000 0x0 0x400>; #address-cells = <2>; #size-cells = <2>; - interrupt-controller at 12101b00 { - compatible = "aspeed,ast2700-intc-ic"; - reg = <0 0x12101b00 0 0x10>; - #interrupt-cells = <2>; - interrupt-controller; - interrupts = , - , - , - , - , - ; + intc1_0: interrupt-controller at 100 { + compatible = "aspeed,ast2700-intc-ic"; + reg = <0x0 0x100 0x0 0x10>; + #interrupt-cells = <2>; + interrupt-controller; + interrupts-extended = <&intc0_11 0 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; }; + }; }; -- 2.34.1 From ryan_chen at aspeedtech.com Tue Jul 22 19:51:56 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Tue, 22 Jul 2025 17:51:56 +0800 Subject: [PATCH v3 2/2] irqchip: aspeed: add debugfs support and AST2700 INTC0/INTC1 routing/protection display In-Reply-To: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> Message-ID: <20250722095156.1672873-3-ryan_chen@aspeedtech.com> AST2700 INTC0/INTC1 nodes ("aspeed,ast2700-intc0/1") not only include the interrupt controller child node ("aspeed,ast2700-intc-ic"), but also provide interrupt routing and register protection features. This patch adds debugfs entries for interrupt routing and protection status for AST2700 INTC0/INTC1. - Register platform driver for "aspeed,ast2700-intc0" and "aspeed,ast2700-intc1" compatible nodes. - Add show_routing/show_prot callbacks for both intc0 and intc1, displaying current interrupt routing and protection register status. - Expose routing/protection information via debugfs for debugging and validation. Signed-off-by: Ryan Chen --- drivers/irqchip/irq-aspeed-intc.c | 238 ++++++++++++++++++++++++++++++ 1 file changed, 238 insertions(+) diff --git a/drivers/irqchip/irq-aspeed-intc.c b/drivers/irqchip/irq-aspeed-intc.c index 8330221799a0..8385f3d5f901 100644 --- a/drivers/irqchip/irq-aspeed-intc.c +++ b/drivers/irqchip/irq-aspeed-intc.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include @@ -15,6 +16,13 @@ #include #include +#define INTC0_ROUTING0_SEL0 0x200 +#define INTC0_ROUTING0_SEL1 0x300 +#define INTC0_ROUTING0_SEL2 0x400 +#define INTC1_ROUTING0_SEL0 0x80 +#define INTC1_ROUTING0_SEL1 0xa0 +#define INTC1_ROUTING0_SEL2 0xc0 + #define INTC_INT_ENABLE_REG 0x00 #define INTC_INT_STATUS_REG 0x04 #define INTC_IRQS_PER_WORD 32 @@ -137,3 +145,233 @@ static int __init aspeed_intc_ic_of_init(struct device_node *node, } IRQCHIP_DECLARE(ast2700_intc_ic, "aspeed,ast2700-intc-ic", aspeed_intc_ic_of_init); + +struct aspeed_intc { + void __iomem *base; + struct device *dev; + struct dentry *dbg_root; + int (*show_routing)(struct seq_file *s, void *unused); + int (*show_prot)(struct seq_file *s, void *unused); +}; + +/* + * 000: Route interrupt INTn to PSP GICINT0-31 + * 001: Route interrupt INTn to SSPINT0-31 + * 010: Route interrupt INTn to TSPINT0-31 + */ +static int aspeed_intc0_show_routing(struct seq_file *s, void *unused) +{ + struct aspeed_intc *intc = s->private; + int group, bit; + + seq_puts(s, "int | PSP | SSP | TSP\n"); + seq_puts(s, "----+-----+-----+----\n"); + + for (group = 0; group < 4; group++) { + u32 reg0 = readl(intc->base + INTC0_ROUTING0_SEL0 + group * 4); + u32 reg1 = readl(intc->base + INTC0_ROUTING0_SEL1 + group * 4); + u32 reg2 = readl(intc->base + INTC0_ROUTING0_SEL2 + group * 4); + + for (bit = 0; bit < 32; bit++) { + int idx = group * 32 + bit; + u8 routing = (((reg2 >> bit) & 0x1) << 2) | + (((reg1 >> bit) & 0x1) << 1) | + (((reg0 >> bit) & 0x1) << 0); + + const char *ca35 = (routing == 0) ? " O " : " - "; + const char *ssp = (routing == 1) ? " O " : " - "; + const char *tsp = (routing == 2) ? " O " : " - "; + + seq_printf(s, "%-4d| %s | %s | %s\n", idx, ca35, ssp, tsp); + } + } + return 0; +} + +static int aspeed_intc0_show_prot(struct seq_file *s, void *unused) +{ + struct aspeed_intc *intc = s->private; + u32 prot = readl(intc->base + 0x40); + + seq_printf(s, "INTC040 : 0x%08x\n", prot); + + static const char * const prot_bits[] = { + "hprot_ca35: Protect INTC010~018,1xxx accessed by PSP only", + "hprot_ssp: Protect INTC020~028,2xxx accessed by SSP only", + "hprot_tsp: Protect INTC030~038,3xxx accessed by TSP only", + "hprot_sirqs: Protect INTC0C0~0D4 to be read only", + "hprot_sirqs_1700: Protect INTC0D8~0DC to be read only", + "hprot_sirqs_ext: Protect INTC0E0 to be read only", + "hprot_reg_prot: Protect INTC044,2xx~3xx to be read only", + "hprot_rd1_prot: Read protect for INTC044,200-438", + "hprot_rd2_prot: Read protect for INTC0C0~164", + "hprot_rd3_prot: Read protect for INTC02x,1xxx to be read by PSP only", + "hprot_rd4_prot: Read protect for INTC03x,2xxx to be read by SSP only", + "hprot_rd5_prot: Read protect for INTC04x,3xxx to be read by TSP only", + "hprot_mcu0: Protect INTC050~054,028 accessed by MCU0 only", + "hprot_ca35p: Protect INTC010~018 accessed by PSP secure only" + }; + + for (int i = 0; i < 14; i++) + seq_printf(s, " [%2d] %s: %s\n", i, prot_bits[i], + (prot & BIT(i)) ? "Enable" : "Disable"); + return 0; +} + +/* + * 000: Route interrupt INTi to PSP(default) + * 001: Route interrupt INTi to INTC controller + * 010: Route interrupt INTi to SSP + * 011: Route interrupt INTi to TSP + * 100: Route interrupt INTi to PSP S1 + * 101: Route interrupt INTi to PSP S2 + * 110: Route interrupt INTi to MCU0 + */ +static int aspeed_intc1_show_routing(struct seq_file *s, void *unused) +{ + struct aspeed_intc *intc = s->private; + int group, bit; + + seq_puts(s, "index | PSP | INTC| SSP | TSP | S1 | S2 | MCU0\n"); + seq_puts(s, "-----------+-----+-----+-----+-----+-----+-----+-----\n"); + + for (group = 0; group < 6; group++) { + u32 reg0 = readl(intc->base + INTC1_ROUTING0_SEL0 + group * 4); + u32 reg1 = readl(intc->base + INTC1_ROUTING0_SEL1 + group * 4); + u32 reg2 = readl(intc->base + INTC1_ROUTING0_SEL2 + group * 4); + + for (bit = 0; bit < 32; bit++) { + u8 routing = (((reg2 >> bit) & 0x1) << 2) | + (((reg1 >> bit) & 0x1) << 1) | + (((reg0 >> bit) & 0x1) << 0); + + const char *psp = (routing == 0) ? " O " : " - "; + const char *intc = (routing == 1) ? " O " : " - "; + const char *ssp = (routing == 2) ? " O " : " - "; + const char *tsp = (routing == 3) ? " O " : " - "; + const char *s1 = (routing == 4) ? " O " : " - "; + const char *s2 = (routing == 5) ? " O " : " - "; + const char *mcu0 = (routing == 6) ? " O " : " - "; + + seq_printf(s, "intc1_%d_%02d | %s | %s | %s | %s | %s | %s | %s\n", + group, bit, psp, intc, ssp, tsp, s1, s2, mcu0); + } + } + return 0; +} + +static int aspeed_intc1_show_prot(struct seq_file *s, void *unused) +{ + struct aspeed_intc *intc = s->private; + u32 prot = readl(intc->base); + + seq_printf(s, "INTC1: 0x%08x\n", prot); + + static const char * const prot_bits[] = { + "pprot_ca35: Protect INTC100~150,280~2D0,300~350 write by PSP only", + "pprot_ssp: Protect INTC180~1D0 write by SSP only", + "pprot_tsp: Protect INTC200~250 write by TSP only", + "pprot_reg_prot: Protect INTC080~0D4 to be read only", + "pprot_regrd: Protect INTC080~0D4 to be read protected", + "pprot_regrd2: Protect INTC100~150,280~2D0,300~350 read by PSP only", + "pprot_regrd3: Protect INTC180~1D0 read by SSP only", + "pprot_regrd4: Protect INTC200~250 read by TSP only", + "pprot_mcu0: Protect INTC010,014 write by MCU0 only", + "pprot_regrd5: Protect INTC010,014 read by MCU0 only", + "pprot_treg: Protect INTC040~054 to be read protected" + }; + + for (int i = 0; i < 11; i++) + seq_printf(s, " [%2d] %s: %s\n", i, prot_bits[i], + (prot & BIT(i)) ? "Enable" : "Disable"); + return 0; +} + +static int aspeed_intc_open_routing(struct inode *inode, struct file *file) +{ + struct aspeed_intc *intc = inode->i_private; + + if (!intc->show_routing) + return -ENODEV; + return single_open(file, intc->show_routing, intc); +} + +static int aspeed_intc_open_prot(struct inode *inode, struct file *file) +{ + struct aspeed_intc *intc = inode->i_private; + + if (!intc->show_prot) + return -ENODEV; + return single_open(file, intc->show_prot, intc); +} + +static const struct file_operations aspeed_intc_routing_fops = { + .owner = THIS_MODULE, + .open = aspeed_intc_open_routing, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + +static const struct file_operations aspeed_intc_prot_fops = { + .owner = THIS_MODULE, + .open = aspeed_intc_open_prot, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + +static int aspeed_intc_probe(struct platform_device *pdev) +{ + struct aspeed_intc *intc; + struct resource *res; + + intc = devm_kzalloc(&pdev->dev, sizeof(*intc), GFP_KERNEL); + if (!intc) + return -ENOMEM; + intc->dev = &pdev->dev; + + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + intc->base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(intc->base)) + return PTR_ERR(intc->base); + + if (of_device_is_compatible(pdev->dev.of_node, "aspeed,ast2700-intc0")) { + intc->show_routing = aspeed_intc0_show_routing; + intc->show_prot = aspeed_intc0_show_prot; + } else if (of_device_is_compatible(pdev->dev.of_node, "aspeed,ast2700-intc1")) { + intc->show_routing = aspeed_intc1_show_routing; + intc->show_prot = aspeed_intc1_show_prot; + } else { + intc->show_routing = NULL; + intc->show_prot = NULL; + } + + platform_set_drvdata(pdev, intc); + + intc->dbg_root = debugfs_create_dir(dev_name(&pdev->dev), NULL); + if (intc->dbg_root) { + debugfs_create_file("routing", 0400, intc->dbg_root, intc, + &aspeed_intc_routing_fops); + debugfs_create_file("protection", 0400, intc->dbg_root, intc, + &aspeed_intc_prot_fops); + } + + return 0; +} + +static const struct of_device_id aspeed_intc_of_match[] = { + { .compatible = "aspeed,ast2700-intc0", }, + { .compatible = "aspeed,ast2700-intc1", }, + {}, +}; + +static struct platform_driver aspeed_intc_driver = { + .probe = aspeed_intc_probe, + .driver = { + .name = "ast2700-intc", + .of_match_table = aspeed_intc_of_match, + }, +}; +builtin_platform_driver(aspeed_intc_driver); + -- 2.34.1 From tglx at linutronix.de Wed Jul 23 01:27:29 2025 From: tglx at linutronix.de (Thomas Gleixner) Date: Tue, 22 Jul 2025 17:27:29 +0200 Subject: [PATCH v3 2/2] irqchip: aspeed: add debugfs support and AST2700 INTC0/INTC1 routing/protection display In-Reply-To: <20250722095156.1672873-3-ryan_chen@aspeedtech.com> References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> <20250722095156.1672873-3-ryan_chen@aspeedtech.com> Message-ID: <8734aotfdq.ffs@tglx> On Tue, Jul 22 2025 at 17:51, Ryan Chen wrote: The subsystem prefix is made up. See: https://www.kernel.org/doc/html/latest/process/maintainer-tip.html#patch-submission-notes > AST2700 INTC0/INTC1 nodes ("aspeed,ast2700-intc0/1") not only > include the interrupt controller child node ("aspeed,ast2700-intc-ic"), > but also provide interrupt routing and register protection features. > This patch adds debugfs entries for interrupt routing and protection # git grep 'This patch' Documentation/process > status for AST2700 INTC0/INTC1. > > - Register platform driver for "aspeed,ast2700-intc0" and > "aspeed,ast2700-intc1" compatible nodes. > - Add show_routing/show_prot callbacks for both intc0 and intc1, > displaying current interrupt routing and protection register status. > - Expose routing/protection information via debugfs for debugging > and validation. > + > +struct aspeed_intc { > + void __iomem *base; > + struct device *dev; > + struct dentry *dbg_root; > + int (*show_routing)(struct seq_file *s, void *unused); > + int (*show_prot)(struct seq_file *s, void *unused); > +}; See the chapter about struct declarations and initializers in the documentation I linked to above. > +static int aspeed_intc1_show_prot(struct seq_file *s, void *unused) > +{ > + struct aspeed_intc *intc = s->private; > + u32 prot = readl(intc->base); > + > + seq_printf(s, "INTC1: 0x%08x\n", prot); > + > + static const char * const prot_bits[] = { > + "pprot_ca35: Protect INTC100~150,280~2D0,300~350 write by PSP only", > + "pprot_ssp: Protect INTC180~1D0 write by SSP only", > + "pprot_tsp: Protect INTC200~250 write by TSP only", > + "pprot_reg_prot: Protect INTC080~0D4 to be read only", > + "pprot_regrd: Protect INTC080~0D4 to be read protected", > + "pprot_regrd2: Protect INTC100~150,280~2D0,300~350 read by PSP only", > + "pprot_regrd3: Protect INTC180~1D0 read by SSP only", > + "pprot_regrd4: Protect INTC200~250 read by TSP only", > + "pprot_mcu0: Protect INTC010,014 write by MCU0 only", > + "pprot_regrd5: Protect INTC010,014 read by MCU0 only", > + "pprot_treg: Protect INTC040~054 to be read protected" > + }; > + > + for (int i = 0; i < 11; i++) > + seq_printf(s, " [%2d] %s: %s\n", i, prot_bits[i], > + (prot & BIT(i)) ? "Enable" : "Disable"); > + return 0; > +} I really have to ask, what the value of this metric ton of string constants and decoding is. This is a debug interface, which is intended for developers and experts. As these are hardware bits, which are immutable, it's completely sufficient to print out the raw values here and let the engineer decode it, no? > +static int aspeed_intc_probe(struct platform_device *pdev) > +{ > + struct aspeed_intc *intc; > + struct resource *res; > + > + intc = devm_kzalloc(&pdev->dev, sizeof(*intc), GFP_KERNEL); > + if (!intc) > + return -ENOMEM; > + intc->dev = &pdev->dev; intc->dev is not used anywhere. > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > + intc->base = devm_ioremap_resource(&pdev->dev, res); > + if (IS_ERR(intc->base)) > + return PTR_ERR(intc->base); > + > + if (of_device_is_compatible(pdev->dev.of_node, "aspeed,ast2700-intc0")) { > + intc->show_routing = aspeed_intc0_show_routing; > + intc->show_prot = aspeed_intc0_show_prot; > + } else if (of_device_is_compatible(pdev->dev.of_node, "aspeed,ast2700-intc1")) { > + intc->show_routing = aspeed_intc1_show_routing; > + intc->show_prot = aspeed_intc1_show_prot; > + } else { > + intc->show_routing = NULL; > + intc->show_prot = NULL; What's the point of creating the debugfs entry instead of bailing out? > + } > + > + platform_set_drvdata(pdev, intc); > + > + intc->dbg_root = debugfs_create_dir(dev_name(&pdev->dev), NULL); Why storing this? It's just used for setting up the debugfs entry, no? > + if (intc->dbg_root) { > + debugfs_create_file("routing", 0400, intc->dbg_root, intc, > + &aspeed_intc_routing_fops); > + debugfs_create_file("protection", 0400, intc->dbg_root, intc, > + &aspeed_intc_prot_fops); > + } > + > + return 0; > +} > + > +static const struct of_device_id aspeed_intc_of_match[] = { > + { .compatible = "aspeed,ast2700-intc0", }, > + { .compatible = "aspeed,ast2700-intc1", }, > + {}, > +}; > + > +static struct platform_driver aspeed_intc_driver = { > + .probe = aspeed_intc_probe, > + .driver = { > + .name = "ast2700-intc", > + .of_match_table = aspeed_intc_of_match, > + }, > +}; > +builtin_platform_driver(aspeed_intc_driver); Why has this to be builtin and not a module? It has zero dependencies on the existing code in this file, right? Just stick it into a seperate source file and make it modular with a seperate Kconfig switch. No point in carrying this code as built-in in multi-platform builds. This whole platform driver muck is just there to expose the routing and protection registers in debugfs even if debugfs is disabled. Seriously? It's completely disconnected from the interrupt delivery chain as far as the kernel is concerned, i.e. it does not provide a interrupt domain/chip. So that interface dumps just some register values with a lot of effort and leaves it to the user to decode which actual linux interrupt in the real intc-ic interrupt domains is affected, right? I'm still failing to see the value of all of this. As the kernel does not even modify these registers, you are basically implementing a dump facility for decoding what the firmware put into those registers, right? I don't have a strong opinion about it, but if it has a value, then all of this can be done with way smaller code by just dumping the raw register values all in one go. No need for two files and string encoding. That's what user space is for. Something like the completely uncompiled below, which I cobbled together quickly for illustration. You get the idea. Thanks, tglx --- #define INTC_TYPE_C0 0 #define INTC_TYPE_C1 1 struct aspeed_intc { void __iomem *base; unsigned int type; }; const struct aspeed_intc_data { char *name; unsigned int groups; unsigned int prot_offs; unsigned int rout_offs; unsigned int rout_gap; } aspeed_intc_data[2] = { { .name = "INTC0", .groups = 4, .prot_offs = 0x40, .rout_offs = 0x200, .rout_gap = 0x100, }, { .name = "INTC1", .groups = 6, .prot_offs = 0x0, .rout_offs = 0x80, .rout_gap = 0x20, }, }; static int aspeed_intc_show(struct seq_file *m, void *unused) { struct aspeed_intc *intc = m->private; const struct aspeed_intc_data *d = &aspeed_intc_data[intc->type]; void __iomem *base = intc->base; seq_printf(m, "%s\n", d->name) seq_printf(m, "P: 0x%08x\n", readl(base + d->prot_offs)); base += d->rout_offs; for (unsigned int i = 0; i < d->groups; i++, base += 4) { seq_printf(m, "R%d: 0x%08x 0x%08x 0x%08x\n", i, readl(base), readl(base + d->rout_gap), readl(base + 2 * d->rout_gap)); } return 0; } DEFINE_SHOW_ATTRIBUTE(aspeed_intc); static int aspeed_intc_probe(struct platform_device *pdev) { struct aspeed_intc *intc; struct resource *res; struct dentry *dir; intc = devm_kzalloc(&pdev->dev, sizeof(*intc), GFP_KERNEL); if (!intc) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); intc->base = devm_ioremap_resource(&pdev->dev, res); if (IS_ERR(intc->base)) return PTR_ERR(intc->base); if (of_device_is_compatible(pdev->dev.of_node, "aspeed,ast2700-intc0")) intc->type = INTC_TYPE_C0; else if (of_device_is_compatible(pdev->dev.of_node, "aspeed,ast2700-intc1")) intc->type = INTC_TYPE_C1; else return -ENOTSUPP; platform_set_drvdata(pdev, intc); dir = debugfs_create_dir(dev_name(&pdev->dev), NULL); debugfs_create_file("intc_regs", 0400, dir, intc, &aspeed_intc_fops); return 0; } static const struct of_device_id aspeed_intc_of_match[] = { { .compatible = "aspeed,ast2700-intc0", }, { .compatible = "aspeed,ast2700-intc1", }, { }, }; MODULE_DEVICE_TABLE(of, aspeed_intc_of_match); static struct platform_driver aspeed_intc_driver = { .probe = aspeed_intc_probe, .driver = { .name = "ast2700-intc", .of_match_table = aspeed_intc_of_match, }, }; module_platform_driver(aspeed_intc_driver); From tglx at linutronix.de Wed Jul 23 01:28:23 2025 From: tglx at linutronix.de (Thomas Gleixner) Date: Tue, 22 Jul 2025 17:28:23 +0200 Subject: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent node compatibles and refine documentation In-Reply-To: <20250722095156.1672873-2-ryan_chen@aspeedtech.com> References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> <20250722095156.1672873-2-ryan_chen@aspeedtech.com> Message-ID: <87zfcws0rs.ffs@tglx> On Tue, Jul 22 2025 at 17:51, Ryan Chen wrote: > - interrupt-controller at 12101b00 { > - compatible = "aspeed,ast2700-intc-ic"; > - reg = <0 0x12101b00 0 0x10>; > - #interrupt-cells = <2>; > - interrupt-controller; > - interrupts = , > - , > - , > - , > - , > - ; > + intc1_0: interrupt-controller at 100 { > + compatible = "aspeed,ast2700-intc-ic"; > + reg = <0x0 0x100 0x0 0x10>; I doubt that the controller base address is at 0x100 ... From donalds at nvidia.com Wed Jul 23 03:47:29 2025 From: donalds at nvidia.com (Donald Shannon) Date: Tue, 22 Jul 2025 10:47:29 -0700 Subject: [PATCH v5 2/2] ARM: dts: aspeed: Add device tree for Nvidia's GB200 UT3.0b platform BMC In-Reply-To: <20250721-hulking-violet-mastodon-16e87a@kuoka> References: <20250718231118.3330855-1-donalds@nvidia.com> <20250718231118.3330855-3-donalds@nvidia.com> <20250721-hulking-violet-mastodon-16e87a@kuoka> Message-ID: Hi Krzysztof, Thank you for the button catch. Though, I don't see a redundant status = "okay"; in the FMC flash. It is disabled by default in the aspeed-g6.dtsi: ? ? ? ? fmc: spi at 1e620000 { ? ? ? ? ? ? reg = <0x1e620000 0xc4>, <0x20000000 0x10000000>; ? ? ? ? ? ? #address-cells = <1>; ? ? ? ? ? ? #size-cells = <0>; ? ? ? ? ? ? compatible = "aspeed,ast2600-fmc"; ? ? ? ? ? ? clocks = <&syscon ASPEED_CLK_AHB>; ? ? ? ? ? ? status = "disabled"; ? ? ? ? ? ? interrupts = ; ? ? ? ? ? ? flash at 0 { ? ? ? ? ? ? ? ? reg = < 0 >; ? ? ? ? ? ? ? ? compatible = "jedec,spi-nor"; ? ? ? ? ? ? ? ? spi-max-frequency = <50000000>; ? ? ? ? ? ? ? ? spi-rx-bus-width = <2>; ? ? ? ? ? ? ? ? status = "disabled"; ? ? ? ? ? ? }; I will reupload v6 with the button and subject line correction and assume the status okay is okay. Thanks, Donald On 7/21/25 00:44, Krzysztof Kozlowski wrote: > External email: Use caution opening links or attachments > > > On Fri, Jul 18, 2025 at 04:11:18PM -0700, Donald Shannon wrote: >> + >> +/ { >> + model = "AST2600 GB200 UT3.0b BMC"; >> + compatible = "nvidia,gb200-ut30b", "aspeed,ast2600"; >> + >> + aliases { >> + serial2 = &uart3; >> + serial4 = &uart5; >> + i2c16 = &imux16; >> + i2c17 = &imux17; >> + i2c18 = &imux18; >> + i2c19 = &imux19; >> + i2c20 = &imux20; >> + i2c21 = &imux21; >> + i2c22 = &imux22; >> + i2c23 = &imux23; >> + i2c24 = &imux24; >> + i2c25 = &imux25; >> + i2c26 = &imux26; >> + i2c27 = &imux27; >> + i2c28 = &imux28; >> + i2c29 = &imux29; >> + i2c30 = &imux30; >> + i2c31 = &imux31; >> + i2c32 = &imux32; >> + i2c33 = &imux33; >> + i2c34 = &imux34; >> + i2c35 = &imux35; >> + i2c36 = &imux36; >> + i2c37 = &imux37; >> + i2c38 = &imux38; >> + i2c39 = &imux39; >> + i2c40 = &e1si2c0; >> + i2c41 = &e1si2c1; >> + i2c42 = &e1si2c2; >> + i2c43 = &e1si2c3; >> + i2c48 = &i2c17mux0; >> + i2c49 = &i2c17mux1; >> + i2c50 = &i2c17mux2; >> + i2c51 = &i2c17mux3; >> + i2c52 = &i2c25mux0; >> + i2c53 = &i2c25mux1; >> + i2c54 = &i2c25mux2; >> + i2c55 = &i2c25mux3; >> + i2c56 = &i2c29mux0; >> + i2c57 = &i2c29mux1; >> + i2c58 = &i2c29mux2; >> + i2c59 = &i2c29mux3; >> + }; >> + >> + buttons { >> + button-power { >> + label = "power-btn"; > How is this supposed to work? How does anything bind here? > >> + gpio = <&sgpiom0 156 GPIO_ACTIVE_LOW>; >> + }; >> + button-uid { >> + label = "uid-btn"; >> + gpio = <&sgpiom0 154 GPIO_ACTIVE_LOW>; >> + }; >> + }; >> + >> + chosen { >> + stdout-path = &uart5; >> + }; >> + >> + leds { >> + compatible = "gpio-leds"; >> + led-0 { >> + label = "uid_led"; >> + gpios = <&sgpiom0 27 GPIO_ACTIVE_LOW>; >> + }; >> + led-1 { >> + label = "fault_led"; >> + gpios = <&sgpiom0 29 GPIO_ACTIVE_LOW>; >> + }; >> + led-2 { >> + label = "power_led"; >> + gpios = <&sgpiom0 31 GPIO_ACTIVE_LOW>; >> + }; >> + }; >> + >> + memory at 80000000 { >> + device_type = "memory"; >> + reg = <0x80000000 0x80000000>; >> + }; >> + >> + reg_3v3_stby: regulator-3v3-standby { >> + compatible = "regulator-fixed"; >> + regulator-name = "3v3-standby"; >> + regulator-min-microvolt = <1800000>; >> + regulator-max-microvolt = <1800000>; >> + gpio = <&gpio0 ASPEED_GPIO(M, 3) GPIO_ACTIVE_HIGH>; >> + enable-active-high; >> + regulator-always-on; >> + }; >> + >> + reserved-memory { >> + #address-cells = <1>; >> + #size-cells = <1>; >> + ranges; >> + >> + vga_memory: framebuffer at 9f000000 { >> + no-map; >> + reg = <0x9f000000 0x01000000>; /* 16M */ >> + }; >> + >> + ramoops at a0000000 { >> + compatible = "ramoops"; >> + reg = <0xa0000000 0x100000>; /* 1MB */ >> + record-size = <0x10000>; /* 64KB */ >> + max-reason = <2>; /* KMSG_DUMP_OOPS */ >> + }; >> + >> + gfx_memory: framebuffer { >> + compatible = "shared-dma-pool"; >> + reusable; >> + size = <0x01000000>; >> + alignment = <0x01000000>; >> + }; >> + >> + video_engine_memory: jpegbuffer { >> + compatible = "shared-dma-pool"; >> + reusable; >> + size = <0x02000000>; /* 32M */ >> + alignment = <0x01000000>; >> + }; >> + }; >> +}; >> + >> +// Enable Primary flash on FMC for bring up activity >> +&fmc { >> + status = "okay"; >> + flash at 0 { >> + compatible = "jedec,spi-nor"; >> + label = "bmc"; >> + spi-max-frequency = <50000000>; >> + status = "okay"; > Why do you need it? Anything disabled it? > > Best regards, > Krzysztof > From jacky_chou at aspeedtech.com Tue Jul 22 15:29:03 2025 From: jacky_chou at aspeedtech.com (Jacky Chou) Date: Tue, 22 Jul 2025 05:29:03 +0000 Subject: [PATCH v2 03/10] dt-bindings: PCI: Add ASPEED PCIe RC support In-Reply-To: <61ced029-987e-4484-9a0a-7c911518ffd8@kernel.org> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> <20250715034320.2553837-4-jacky_chou@aspeedtech.com> <20250716-watchful-enigmatic-condor-0fc6b3@krzk-bin> <61ced029-987e-4484-9a0a-7c911518ffd8@kernel.org> Message-ID: > >>> +patternProperties: > >>> + "^pcie@[0-9a-f,]+$": > >> > >> Why do you need it? Also, order things according to example schema. > >> > > > > Thanks for your question. > > > > In the v1 discussion, another reviewer suggested that we should > > support a multi-port structure for the PCIe root complex, where each > > port is represented as a child node (e.g., pcie at ...). > > That's why patternProperties was added here ? to explicitly allow such > > subnodes and validate them properly. > > And schema does not allow it already? > Agreed, I will remove it in next version. Thanks, Jacky From robh at kernel.org Wed Jul 23 14:19:05 2025 From: robh at kernel.org (Rob Herring (Arm)) Date: Tue, 22 Jul 2025 23:19:05 -0500 Subject: [PATCH v6 0/2] Adding device tree and binding for NVIDIA GB200-UT3.0b In-Reply-To: <20250723014239.22667-1-donalds@nvidia.com> References: <20250723014239.22667-1-donalds@nvidia.com> Message-ID: <175324420395.1136488.7622581130155119218.robh@kernel.org> On Tue, 22 Jul 2025 18:42:37 -0700, Donald Shannon wrote: > Patch 1 adds the binding for the NVIDIA GB200-UT3.0b platform. > Patch 2 adds the device tree for the NVIDIA GB200-UT3.0b platform. > > This is an Aspeed AST2600 based unit testing platform for GB200. > UT3.0b is different than nvidia-gb200nvl-bmc due to networking topology > differences, additional gpio expanders, and voltage regulator gating > some devices. > > Reference to Ast2600 SOC [1]. > Reference to Blackwell GB200NVL Platform [2]. > > Link: https://www.aspeedtech.com/server_ast2600/ [1] > Link: https://nvdam.widen.net/s/wwnsxrhm2w/blackwell-datasheet-3384703 [2] > Signed-off-by: Donald Shannon > --- > Changes v1 -> v2: > - Changed phy-mode to rgmii-id [Lunn] > - Removed redundant max-speed for mac0 [Lunn] > - Fixed typo from gb200nvl to gb200 in Makefile > Changes v2 -> v3: > - Fixed whitespace issues [Krzysztof] > - Fixed schema validation issues from my end ( there are still issues > with the aspeed dtsi file that are not related to this new dts) > [Herring] > - Reordered to follow style guide [Krzysztof] > - Removed redundant status okays > - Changed vcc to vdd for the power gating on the gpio expanders > Changes v3 -> v4: > - Added changelog [Krzysztof] > - Added nvidia,gb200-ut30b board binding [Krzysztof] > - Removed unused imports > - Reordered a couple other style guide violations > - Added back in a couple needed "status okay"s > Changes v4 -> v5: > - Resumed my patch after a pause > - Don't plan to make this include of nvidia-gb200nvl-bmc due to some > platform differences > - Fixed io expanders that weren't gated by the 3.3V standby regulator > - Fixed incorrect interrupt pin for one IO expander > - Removed some IO expanders and I2C busses > Changes v5 -> v6: > - Fixed subject line > - Added missing gpio-key compatible type to buttons > --- > > Donald Shannon (2): > dt-bindings: arm: aspeed: Add NVIDIA GB200-UT3.0b board > ARM: dts: aspeed: Add NVIDIA GB200 UT3.0b board > > .../bindings/arm/aspeed/aspeed.yaml | 1 + > arch/arm/boot/dts/aspeed/Makefile | 1 + > .../aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts | 1028 +++++++++++++++++ > 3 files changed, 1030 insertions(+) > create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts > > > base-commit: 05adbee3ad528100ab0285c15c91100e19e10138 > -- > 2.43.0 > > > My bot found new DTB warnings on the .dts files added or changed in this series. Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments. If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date: pip3 install dtschema --upgrade This patch series was applied (using b4) to base: Base: using specified base-commit 05adbee3ad528100ab0285c15c91100e19e10138 If this is not the correct base, please add 'base-commit' tag (or use b4 which does this automatically) New warnings running 'make CHECK_DTBS=y for arch/arm/boot/dts/aspeed/' for 20250723014239.22667-1-donalds at nvidia.com: arch/arm/boot/dts/aspeed/aspeed-bmc-ibm-everest.dtb: /ahb/apb/fsi at 1e79b000/cfam at 0,0/hub at 3400/cfam at 5,0/hub at 3400: failed to match any schema with compatible: ['fsi-master-hub'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: timer (arm,armv7-timer): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/timer/arm,arch_timer.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /sdram at 1e6e0000: failed to match any schema with compatible: ['aspeed,ast2600-sdram-edac', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: bus at 1e600000 (aspeed,ast2600-ahbc): compatible: ['aspeed,ast2600-ahbc', 'syscon'] is too long from schema $id: http://devicetree.org/schemas/bus/aspeed,ast2600-ahbc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-opp-zaius.dtb: /gpio-fsi/cfam at 0,0/i2c at 1800: failed to match any schema with compatible: ['ibm,fsi-i2c-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: syscon at 1e6e2000 (aspeed,ast2600-scu): 'smp-memram at 180' does not match any of the regexes: '^interrupt-controller@[0-9a-f]+$', '^p2a-control@[0-9a-f]+$', '^pinctrl(@[0-9a-f]+)?$', '^pinctrl-[0-9]+$', '^silicon-id@[0-9a-f]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed,ast2x00-scu.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/syscon at 1e6e2000/smp-memram at 180: failed to match any schema with compatible: ['aspeed,ast2600-smpmem'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/display at 1e6e6000: failed to match any schema with compatible: ['aspeed,ast2600-gfx', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: adc at 1e6e9000 (aspeed,ast2600-adc0): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: adc at 1e6e9100 (aspeed,ast2600-adc1): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: crypto at 1e6fa000 (aspeed,ast2600-acry): 'aspeed,ahbc' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/crypto/aspeed,ast2600-acry.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): reg-io-width: 4 is not of type 'object' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): lpc-snoop at 80: 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: kcs at 24 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: kcs at 28 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: kcs at 2c (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: kcs at 114 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/lpc at 1e789000/lhc at a0: failed to match any schema with compatible: ['aspeed,ast2600-lhc'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/lpc at 1e789000/ibt at 140: failed to match any schema with compatible: ['aspeed,ast2600-ibt-bmc'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740100:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740200:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740100: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740200: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: fsi at 1e79b000 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/fsi at 1e79b000: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: fsi at 1e79b100 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/fsi at 1e79b100: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/dma-controller at 1e79e000: failed to match any schema with compatible: ['aspeed,ast2600-udma'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-power: 'anyOf' conditional failed, one must be fixed: arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-power: 'oneOf' conditional failed, one must be fixed: 'interrupts' is a required property 'interrupts-extended' is a required property 'gpios' is a required property from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-power: 'linux,code' is a required property from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-power: Unevaluated properties are not allowed ('gpio' was unexpected) from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-uid: 'anyOf' conditional failed, one must be fixed: arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-uid: 'oneOf' conditional failed, one must be fixed: 'interrupts' is a required property 'interrupts-extended' is a required property 'gpios' is a required property from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-uid: 'linux,code' is a required property from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-uid: Unevaluated properties are not allowed ('gpio' was unexpected) from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml# From robh at kernel.org Wed Jul 23 15:01:20 2025 From: robh at kernel.org (Rob Herring) Date: Wed, 23 Jul 2025 00:01:20 -0500 Subject: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent node compatibles and refine documentation In-Reply-To: <20250722095156.1672873-2-ryan_chen@aspeedtech.com> References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> <20250722095156.1672873-2-ryan_chen@aspeedtech.com> Message-ID: <20250723050120.GA1231854-robh@kernel.org> On Tue, Jul 22, 2025 at 05:51:55PM +0800, Ryan Chen wrote: > The AST2700 SoC contains two independent top-level interrupt controllers > (INTC0 and INTC1), each responsible for handling different peripheral > groups and occupying separate register spaces. Above them, PSP(CA35) GIC > controller acts as the root interrupt aggregator. Accurately describing > this hierarchical hardware structure in the device tree requires distinct > compatible strings for the parent nodes of INTC0 and INTC1. > > - Adds 'aspeed,ast2700-intc0' and 'aspeed,ast2700-intc1' compatible > strings for parent interrupt controller nodes. (in addition to the > existing 'aspeed,ast2700-intc-ic' for child nodes) > - Clarifies the relationship and function of INTC0 parent > (intc0_0~x: child), INTC1 parent (intc1_0~x: child), and the GIC > in the documentation. > - Updates block diagrams and device tree examples to illustrate > the hierarchy and compatible usage. > - Refines documentation and example formatting. > > This change allows the device tree and driver to distinguish between > parent (top-level) and child (group) interrupt controller nodes, > enabling more precise driver matching SOC register space allocation. That's nice, but is an ABI break. > > Signed-off-by: Ryan Chen > --- > .../aspeed,ast2700-intc.yaml | 158 +++++++++++++----- > 1 file changed, 115 insertions(+), 43 deletions(-) > > diff --git a/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml > index 55636d06a674..bdc4d8835843 100644 > --- a/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml > +++ b/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast2700-intc.yaml > @@ -10,6 +10,33 @@ description: > This interrupt controller hardware is second level interrupt controller that > is hooked to a parent interrupt controller. It's useful to combine multiple > interrupt sources into 1 interrupt to parent interrupt controller. > + Depend to which INTC0 or INTC1 used. > + INTC0 and INTC1 are two kinds of interrupt controller with enable and raw > + status registers for use. > + INTC0 is used to assert GIC if interrupt in INTC1 asserted. > + INTC1 is used to assert INTC0 if interrupt of modules asserted. > + +-----+ +---------+ > + | GIC |---| INTC0 | > + +-----+ +---------+ > + +---------+ > + | |---module0 > + | INTC0_0 |---module1 > + | |---... > + +---------+---module31 > + |---.... | > + +---------+ > + | | +---------+ > + | INTC0_11| +---| INTC1 | > + | | +---------+ > + +---------+ +---------+---module0 > + | INTC1_0 |---module1 > + | |---... > + +---------+---module31 > + ... > + +---------+---module0 > + | INTC1_5 |---module1 > + | |---... > + +---------+---module31 > > maintainers: > - Kevin Chen > @@ -17,49 +44,70 @@ maintainers: > properties: > compatible: > enum: > - - aspeed,ast2700-intc-ic > + - aspeed,ast2700-intc0 > + - aspeed,ast2700-intc1 > > reg: > maxItems: 1 > > - interrupt-controller: true > + '#address-cells': > + const: 2 > > - '#interrupt-cells': > + '#size-cells': > const: 2 > - description: > - The first cell is the IRQ number, the second cell is the trigger > - type as defined in interrupt.txt in this directory. > - > - interrupts: > - maxItems: 6 > - description: | > - Depend to which INTC0 or INTC1 used. > - INTC0 and INTC1 are two kinds of interrupt controller with enable and raw > - status registers for use. > - INTC0 is used to assert GIC if interrupt in INTC1 asserted. > - INTC1 is used to assert INTC0 if interrupt of modules asserted. > - +-----+ +-------+ +---------+---module0 > - | GIC |---| INTC0 |--+--| INTC1_0 |---module2 > - | | | | | | |---... > - +-----+ +-------+ | +---------+---module31 > - | > - | +---------+---module0 > - +---| INTC1_1 |---module2 > - | | |---... > - | +---------+---module31 > - ... > - | +---------+---module0 > - +---| INTC1_5 |---module2 > - | |---... > - +---------+---module31 > > + ranges: true > + > +patternProperties: > + "^interrupt-controller@": > + type: object > + description: Interrupt group child nodes > + additionalProperties: false > + > + properties: > + compatible: > + enum: > + - aspeed,ast2700-intc-ic > + > + reg: > + maxItems: 1 > + > + interrupt-controller: true > + > + '#interrupt-cells': > + const: 2 > + description: | Don't need '|'. > + The first cell is the IRQ number, the second cell is the trigger > + type as defined in interrupt.txt in this directory. Don't add links to legacy documents. > + > + interrupts: > + minItems: 1 > + maxItems: 6 > + description: | > + The interrupts provided by this interrupt controller. > + > + interrupts-extended: Why do you have both interrupts and interrupts-extended? They are mutually exclusive and both are auto-magically supported. The schemas only have to document 'interrupts'. > + minItems: 1 > + maxItems: 6 > + description: | > + This property is required when defining a cascaded interrupt controller > + that is connected under another interrupt controller. It specifies the > + parent interrupt(s) in the upstream controller to which this controller > + is connected. > + > + oneOf: > + - required: [interrupts] > + - required: [interrupts-extended] > + > + required: > + - compatible > + - reg > + - interrupt-controller > + - '#interrupt-cells' > > required: > - compatible > - reg > - - interrupt-controller > - - '#interrupt-cells' > - - interrupts > > additionalProperties: false > > @@ -68,19 +116,43 @@ examples: > #include > > bus { > + #address-cells = <2>; > + #size-cells = <2>; > + > + intc0: interrupt-controller at 12100000 { This node isn't an interrupt-controller. > + compatible = "aspeed,ast2700-intc0"; > + reg = <0 0x12100000 0 0x4000>; > + ranges = <0x0 0x0 0x0 0x12100000 0x0 0x4000>; > + #address-cells = <2>; > + #size-cells = <2>; > + > + intc0_11: interrupt-controller at 1b00 { > + compatible = "aspeed,ast2700-intc-ic"; > + reg = <0 0x12101b00 0 0x10>; > + #interrupt-cells = <2>; > + interrupt-controller; > + interrupts = , > + , > + , > + , > + , > + ; > + }; > + }; > + > + intc1: interrupt-controller at 14c18000 { > + compatible = "aspeed,ast2700-intc1"; > + reg = <0 0x14c18000 0 0x400>; > + ranges = <0x0 0x0 0x0 0x14c18000 0x0 0x400>; > #address-cells = <2>; > #size-cells = <2>; > > - interrupt-controller at 12101b00 { > - compatible = "aspeed,ast2700-intc-ic"; > - reg = <0 0x12101b00 0 0x10>; > - #interrupt-cells = <2>; > - interrupt-controller; > - interrupts = , > - , > - , > - , > - , > - ; > + intc1_0: interrupt-controller at 100 { > + compatible = "aspeed,ast2700-intc-ic"; > + reg = <0x0 0x100 0x0 0x10>; > + #interrupt-cells = <2>; > + interrupt-controller; > + interrupts-extended = <&intc0_11 0 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; > }; > + }; > }; > -- > 2.34.1 > From krzk at kernel.org Wed Jul 23 15:56:31 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Wed, 23 Jul 2025 07:56:31 +0200 Subject: [PATCH v6 1/2] dt-bindings: arm: aspeed: Add NVIDIA GB200-UT3.0b board In-Reply-To: <20250723014239.22667-2-donalds@nvidia.com> References: <20250723014239.22667-1-donalds@nvidia.com> <20250723014239.22667-2-donalds@nvidia.com> Message-ID: On 23/07/2025 03:42, Donald Shannon wrote: > This is an Aspeed AST2600 based unit testing platform for GB200. > UT3.0b is different than nvidia-gb200nvl-bmc due to networking topology > differences, additional gpio expanders, and voltage regulator gating > some devices. > > Reference to Ast2600 SOC [1]. > Reference to Blackwell GB200NVL Platform [2]. > > Link: https://www.aspeedtech.com/server_ast2600/ [1] > Link: https://nvdam.widen.net/s/wwnsxrhm2w/blackwell-datasheet-3384703 [2] > Signed-off-by: Donald Shannon > Acked-by: Krzysztof Kozlowski Why are you faking tags? No, you cannot just add whatever you want. Best regards, Krzysztof From ryan_chen at aspeedtech.com Wed Jul 23 16:02:20 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Wed, 23 Jul 2025 06:02:20 +0000 Subject: [PATCH v3 2/2] irqchip: aspeed: add debugfs support and AST2700 INTC0/INTC1 routing/protection display In-Reply-To: <8734aotfdq.ffs@tglx> References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> <20250722095156.1672873-3-ryan_chen@aspeedtech.com> <8734aotfdq.ffs@tglx> Message-ID: > Subject: Re: [PATCH v3 2/2] irqchip: aspeed: add debugfs support and AST2700 > INTC0/INTC1 routing/protection display > > On Tue, Jul 22 2025 at 17:51, Ryan Chen wrote: > > The subsystem prefix is made up. See: > > https://www.kernel.org/doc/html/latest/process/maintainer-tip.html#patch-su > bmission-notes Will prefix update to Irqchip/aspeed-intc: add debugfs support and AST2700 INTC0/INTC1 routing/protection display > > > AST2700 INTC0/INTC1 nodes ("aspeed,ast2700-intc0/1") not only include > > the interrupt controller child node ("aspeed,ast2700-intc-ic"), but > > also provide interrupt routing and register protection features. > > > This patch adds debugfs entries for interrupt routing and protection > > # git grep 'This patch' Documentation/process Modify to Adds debugfs entries for interrupt routing and protection status for AST2700 INTC0/INTC1. > > > status for AST2700 INTC0/INTC1. > > > > - Register platform driver for "aspeed,ast2700-intc0" and > > "aspeed,ast2700-intc1" compatible nodes. > > - Add show_routing/show_prot callbacks for both intc0 and intc1, > > displaying current interrupt routing and protection register status. > > - Expose routing/protection information via debugfs for debugging and > > validation. > > + > > +struct aspeed_intc { > > + void __iomem *base; > > + struct device *dev; > > + struct dentry *dbg_root; > > + int (*show_routing)(struct seq_file *s, void *unused); > > + int (*show_prot)(struct seq_file *s, void *unused); }; > > See the chapter about struct declarations and initializers in the documentation > I linked to above. Sorry, I don't see the struct "> > + int (*show_prot)(struct seq_file *s, void *unused); };" My original submit is following, it should ok. Am I right? +struct aspeed_intc { + void __iomem *base; + struct device *dev; + struct dentry *dbg_root; + int (*show_routing)(struct seq_file *s, void *unused); + int (*show_prot)(struct seq_file *s, void *unused); +}; https://www.spinics.net/lists/kernel/msg5776957.html > > > +static int aspeed_intc1_show_prot(struct seq_file *s, void *unused) { > > + struct aspeed_intc *intc = s->private; > > + u32 prot = readl(intc->base); > > + > > + seq_printf(s, "INTC1: 0x%08x\n", prot); > > + > > + static const char * const prot_bits[] = { > > + "pprot_ca35: Protect INTC100~150,280~2D0,300~350 write by PSP > only", > > + "pprot_ssp: Protect INTC180~1D0 write by SSP only", > > + "pprot_tsp: Protect INTC200~250 write by TSP only", > > + "pprot_reg_prot: Protect INTC080~0D4 to be read only", > > + "pprot_regrd: Protect INTC080~0D4 to be read protected", > > + "pprot_regrd2: Protect INTC100~150,280~2D0,300~350 read by PSP > only", > > + "pprot_regrd3: Protect INTC180~1D0 read by SSP only", > > + "pprot_regrd4: Protect INTC200~250 read by TSP only", > > + "pprot_mcu0: Protect INTC010,014 write by MCU0 only", > > + "pprot_regrd5: Protect INTC010,014 read by MCU0 only", > > + "pprot_treg: Protect INTC040~054 to be read protected" > > + }; > > + > > + for (int i = 0; i < 11; i++) > > + seq_printf(s, " [%2d] %s: %s\n", i, prot_bits[i], > > + (prot & BIT(i)) ? "Enable" : "Disable"); > > + return 0; > > +} > > I really have to ask, what the value of this metric ton of string constants and > decoding is. This is a debug interface, which is intended for developers and > experts. As these are hardware bits, which are immutable, it's completely > sufficient to print out the raw values here and let the engineer decode it, no? The reason for the string decoding was to make debug output more friendly for quick diagnosis during bring-up, If it is not accepted, I will revise the patch to remove the extra string decoding and only output the raw values. > > > +static int aspeed_intc_probe(struct platform_device *pdev) { > > + struct aspeed_intc *intc; > > + struct resource *res; > > + > > + intc = devm_kzalloc(&pdev->dev, sizeof(*intc), GFP_KERNEL); > > + if (!intc) > > + return -ENOMEM; > > + intc->dev = &pdev->dev; > > intc->dev is not used anywhere. Will remove it. > > > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > > + intc->base = devm_ioremap_resource(&pdev->dev, res); > > + if (IS_ERR(intc->base)) > > + return PTR_ERR(intc->base); > > + > > + if (of_device_is_compatible(pdev->dev.of_node, "aspeed,ast2700-intc0")) > { > > + intc->show_routing = aspeed_intc0_show_routing; > > + intc->show_prot = aspeed_intc0_show_prot; > > + } else if (of_device_is_compatible(pdev->dev.of_node, > "aspeed,ast2700-intc1")) { > > + intc->show_routing = aspeed_intc1_show_routing; > > + intc->show_prot = aspeed_intc1_show_prot; > > + } else { > > + intc->show_routing = NULL; > > + intc->show_prot = NULL; > > What's the point of creating the debugfs entry instead of bailing out? Yes, will update to return -ENODEV; > > > + } > > + > > + platform_set_drvdata(pdev, intc); > > + > > + intc->dbg_root = debugfs_create_dir(dev_name(&pdev->dev), NULL); > > Why storing this? It's just used for setting up the debugfs entry, no? I'll update the code to use a local variable, by following. struct dentry *dbg_root; dbg_root = debugfs_create_dir(dev_name(&pdev->dev), NULL); if (dbg_root) { debugfs_create_file("routing", 0400, dbg_root, intc, &aspeed_intc_routing_fops); debugfs_create_file("protection", 0400, dbg_root, intc, &aspeed_intc_prot_fops); } > > > + if (intc->dbg_root) { > > + debugfs_create_file("routing", 0400, intc->dbg_root, intc, > > + &aspeed_intc_routing_fops); > > + debugfs_create_file("protection", 0400, intc->dbg_root, intc, > > + &aspeed_intc_prot_fops); > > + } > > + > > + return 0; > > +} > > + > > +static const struct of_device_id aspeed_intc_of_match[] = { > > + { .compatible = "aspeed,ast2700-intc0", }, > > + { .compatible = "aspeed,ast2700-intc1", }, > > + {}, > > +}; > > + > > +static struct platform_driver aspeed_intc_driver = { > > + .probe = aspeed_intc_probe, > > + .driver = { > > + .name = "ast2700-intc", > > + .of_match_table = aspeed_intc_of_match, > > + }, > > +}; > > +builtin_platform_driver(aspeed_intc_driver); > > Why has this to be builtin and not a module? It has zero dependencies on the > existing code in this file, right? > Just stick it into a seperate source file and make it modular with a seperate > Kconfig switch. No point in carrying this code as built-in in multi-platform > builds. > > This whole platform driver muck is just there to expose the routing and > protection registers in debugfs even if debugfs is disabled. Seriously? > OK. I will do it in separate source c file and make it modular with Kconfig. And also depends on DEBUG_FS Thanks for guidance. > It's completely disconnected from the interrupt delivery chain as far as the > kernel is concerned, i.e. it does not provide a interrupt domain/chip. So that > interface dumps just some register values with a lot of effort and leaves it to > the user to decode which actual linux interrupt in the real intc-ic interrupt > domains is affected, right? > > I'm still failing to see the value of all of this. As the kernel does not even > modify these registers, you are basically implementing a dump facility for > decoding what the firmware put into those registers, right? > > I don't have a strong opinion about it, but if it has a value, then all of this can > be done with way smaller code by just dumping the raw register values all in > one go. No need for two files and string encoding. That's what user space is > for. > Thanks, I will send a new version with a modular driver and a simplified debugfs interface as you suggested. > Something like the completely uncompiled below, which I cobbled together > quickly for illustration. You get the idea. > > Thanks, > > tglx > --- > > #define INTC_TYPE_C0 0 > #define INTC_TYPE_C1 1 > > struct aspeed_intc { > void __iomem *base; > unsigned int type; > }; > > const struct aspeed_intc_data { > char *name; > unsigned int groups; > unsigned int prot_offs; > unsigned int rout_offs; > unsigned int rout_gap; > } aspeed_intc_data[2] = { > { > .name = "INTC0", > .groups = 4, > .prot_offs = 0x40, > .rout_offs = 0x200, > .rout_gap = 0x100, > }, > { > .name = "INTC1", > .groups = 6, > .prot_offs = 0x0, > .rout_offs = 0x80, > .rout_gap = 0x20, > }, > }; > > static int aspeed_intc_show(struct seq_file *m, void *unused) { > struct aspeed_intc *intc = m->private; > const struct aspeed_intc_data *d = &aspeed_intc_data[intc->type]; > void __iomem *base = intc->base; > > seq_printf(m, "%s\n", d->name) > seq_printf(m, "P: 0x%08x\n", readl(base + d->prot_offs)); > > base += d->rout_offs; > for (unsigned int i = 0; i < d->groups; i++, base += 4) { > seq_printf(m, "R%d: 0x%08x 0x%08x 0x%08x\n", i, readl(base), > readl(base + d->rout_gap), readl(base + 2 * d->rout_gap)); > } > return 0; > } > DEFINE_SHOW_ATTRIBUTE(aspeed_intc); > > static int aspeed_intc_probe(struct platform_device *pdev) { > struct aspeed_intc *intc; > struct resource *res; > struct dentry *dir; > > intc = devm_kzalloc(&pdev->dev, sizeof(*intc), GFP_KERNEL); > if (!intc) > return -ENOMEM; > > res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > intc->base = devm_ioremap_resource(&pdev->dev, res); > if (IS_ERR(intc->base)) > return PTR_ERR(intc->base); > > if (of_device_is_compatible(pdev->dev.of_node, "aspeed,ast2700-intc0")) > intc->type = INTC_TYPE_C0; > else if (of_device_is_compatible(pdev->dev.of_node, > "aspeed,ast2700-intc1")) > intc->type = INTC_TYPE_C1; > else > return -ENOTSUPP; > > platform_set_drvdata(pdev, intc); > > dir = debugfs_create_dir(dev_name(&pdev->dev), NULL); > debugfs_create_file("intc_regs", 0400, dir, intc, &aspeed_intc_fops); > return 0; > } > > static const struct of_device_id aspeed_intc_of_match[] = { > { .compatible = "aspeed,ast2700-intc0", }, > { .compatible = "aspeed,ast2700-intc1", }, > { }, > }; > MODULE_DEVICE_TABLE(of, aspeed_intc_of_match); > > static struct platform_driver aspeed_intc_driver = { > .probe = aspeed_intc_probe, > .driver = { > .name = "ast2700-intc", > .of_match_table = aspeed_intc_of_match, > }, > }; > module_platform_driver(aspeed_intc_driver); From krzk at kernel.org Wed Jul 23 16:11:44 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Wed, 23 Jul 2025 08:11:44 +0200 Subject: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent node compatibles and refine documentation In-Reply-To: <20250722095156.1672873-2-ryan_chen@aspeedtech.com> References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> <20250722095156.1672873-2-ryan_chen@aspeedtech.com> Message-ID: On 22/07/2025 11:51, Ryan Chen wrote: > The AST2700 SoC contains two independent top-level interrupt controllers > (INTC0 and INTC1), each responsible for handling different peripheral > groups and occupying separate register spaces. Above them, PSP(CA35) GIC > controller acts as the root interrupt aggregator. Accurately describing > this hierarchical hardware structure in the device tree requires distinct > compatible strings for the parent nodes of INTC0 and INTC1. > > - Adds 'aspeed,ast2700-intc0' and 'aspeed,ast2700-intc1' compatible > strings for parent interrupt controller nodes. (in addition to the > existing 'aspeed,ast2700-intc-ic' for child nodes) I don't understand how this solves your problem at all. Look at old diagram - is it correct? If not, what makes you think that new diagram is correct? What is the meaning of existing binding and existing intc-ic compatible? > - Clarifies the relationship and function of INTC0 parent > (intc0_0~x: child), INTC1 parent (intc1_0~x: child), and the GIC > in the documentation. > - Updates block diagrams and device tree examples to illustrate > the hierarchy and compatible usage. > - Refines documentation and example formatting. > > This change allows the device tree and driver to distinguish between > parent (top-level) and child (group) interrupt controller nodes, > enabling more precise driver matching SOC register space allocation. And how it was not possible before? That's poor argument especially that DT does not have to ever distinguish that. Best regards, Krzysztof From krzk at kernel.org Wed Jul 23 16:13:06 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Wed, 23 Jul 2025 08:13:06 +0200 Subject: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent node compatibles and refine documentation In-Reply-To: <20250722095156.1672873-2-ryan_chen@aspeedtech.com> References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> <20250722095156.1672873-2-ryan_chen@aspeedtech.com> Message-ID: <001d37c7-f704-4554-a4db-0cc130e07dd6@kernel.org> On 22/07/2025 11:51, Ryan Chen wrote: > + INTC0 is used to assert GIC if interrupt in INTC1 asserted. > + INTC1 is used to assert INTC0 if interrupt of modules asserted. > + +-----+ +---------+ > + | GIC |---| INTC0 | > + +-----+ +---------+ > + +---------+ > + | |---module0 > + | INTC0_0 |---module1 > + | |---... > + +---------+---module31 > + |---.... | > + +---------+ > + | | +---------+ > + | INTC0_11| +---| INTC1 | > + | | +---------+ > + +---------+ +---------+---module0 > + | INTC1_0 |---module1 > + | |---... > + +---------+---module31 > + ... > + +---------+---module0 > + | INTC1_5 |---module1 > + | |---... > + +---------+---module31 You binding also said intc1 is the parent of intc-ic, so where is here intc-ic? This diagram and new binding do not match at all. Best regards, Krzysztof From ryan_chen at aspeedtech.com Wed Jul 23 17:47:32 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Wed, 23 Jul 2025 07:47:32 +0000 Subject: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent node compatibles and refine documentation In-Reply-To: <87zfcws0rs.ffs@tglx> References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> <20250722095156.1672873-2-ryan_chen@aspeedtech.com> <87zfcws0rs.ffs@tglx> Message-ID: > Subject: Re: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add > parent node compatibles and refine documentation > > On Tue, Jul 22 2025 at 17:51, Ryan Chen wrote: > > - interrupt-controller at 12101b00 { > > - compatible = "aspeed,ast2700-intc-ic"; > > - reg = <0 0x12101b00 0 0x10>; > > - #interrupt-cells = <2>; > > - interrupt-controller; > > - interrupts = , > > - , > > - , > > - , > > - , > > - ; > > + intc1_0: interrupt-controller at 100 { > > + compatible = "aspeed,ast2700-intc-ic"; > > + reg = <0x0 0x100 0x0 0x10>; > > I doubt that the controller base address is at 0x100 ... Sorry, besides the interrupt cascade, our interrupt architecture is most like this one. https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/interrupt-controller/marvell%2Ccp110-icu.yaml#L74-L98 and also others https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/mmc/aspeed%2Csdhci.yaml#L83-L107 I don't understand you doubt it, and also we have proven in our internal Linux release. https://github.com/AspeedTech-BMC/linux/blob/aspeed-master-v6.6/arch/arm64/boot/dts/aspeed/aspeed-g7.dtsi#L1676-L1730 Could you point out more information what you doubt? And I can provide more information. From ryan_chen at aspeedtech.com Wed Jul 23 17:56:37 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Wed, 23 Jul 2025 07:56:37 +0000 Subject: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent node compatibles and refine documentation In-Reply-To: <20250723050120.GA1231854-robh@kernel.org> References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> <20250722095156.1672873-2-ryan_chen@aspeedtech.com> <20250723050120.GA1231854-robh@kernel.org> Message-ID: > Subject: Re: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add > parent node compatibles and refine documentation > > On Tue, Jul 22, 2025 at 05:51:55PM +0800, Ryan Chen wrote: > > The AST2700 SoC contains two independent top-level interrupt > > controllers > > (INTC0 and INTC1), each responsible for handling different peripheral > > groups and occupying separate register spaces. Above them, PSP(CA35) > > GIC controller acts as the root interrupt aggregator. Accurately > > describing this hierarchical hardware structure in the device tree > > requires distinct compatible strings for the parent nodes of INTC0 and INTC1. > > > > - Adds 'aspeed,ast2700-intc0' and 'aspeed,ast2700-intc1' compatible > > strings for parent interrupt controller nodes. (in addition to the > > existing 'aspeed,ast2700-intc-ic' for child nodes) > > - Clarifies the relationship and function of INTC0 parent > > (intc0_0~x: child), INTC1 parent (intc1_0~x: child), and the GIC in > > the documentation. > > - Updates block diagrams and device tree examples to illustrate the > > hierarchy and compatible usage. > > - Refines documentation and example formatting. > > > > This change allows the device tree and driver to distinguish between > > parent (top-level) and child (group) interrupt controller nodes, > > enabling more precise driver matching SOC register space allocation. > > That's nice, but is an ABI break. Sorry, Is it an ABI break? I keep the compatible aspeed,ast2700-intc-ic, not change it. Just move it to be child, and make aspeed,ast2700-intc0/1 to be parent for aspeed,ast2700-intc-ic. Older : https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/interrupt-controller/aspeed%2Cast2700-intc.yaml#L70C2-L86C7 bus { #address-cells = <2>; #size-cells = <2>; interrupt-controller at 12101b00 { compatible = "aspeed,ast2700-intc-ic"; reg = <0 0x12101b00 0 0x10>; #interrupt-cells = <2>; interrupt-controller; interrupts = , , , , , ; }; }; New parent and child bus { #address-cells = <2>; #size-cells = <2>; intc0: interrupt-controller at 12100000 { compatible = "aspeed,ast2700-intc0"; reg = <0 0x12100000 0 0x4000>; ranges = <0x0 0x0 0x0 0x12100000 0x0 0x4000>; #address-cells = <2>; #size-cells = <2>; intc0_11: interrupt-controller at 1b00 { compatible = "aspeed,ast2700-intc-ic"; reg = <0 0x12101b00 0 0x10>; #interrupt-cells = <2>; interrupt-controller; interrupts = , , , , , ; }; }; intc1: interrupt-controller at 14c18000 { compatible = "aspeed,ast2700-intc1"; reg = <0 0x14c18000 0 0x400>; ranges = <0x0 0x0 0x0 0x14c18000 0x0 0x400>; #address-cells = <2>; #size-cells = <2>; intc1_0: interrupt-controller at 100 { compatible = "aspeed,ast2700-intc-ic"; reg = <0x0 0x100 0x0 0x10>; #interrupt-cells = <2>; interrupt-controller; interrupts-extended = <&intc0_11 0 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; }; }; }; > > > > > Signed-off-by: Ryan Chen > > --- > > .../aspeed,ast2700-intc.yaml | 158 > +++++++++++++----- > > 1 file changed, 115 insertions(+), 43 deletions(-) > > > > diff --git > > a/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast270 > > 0-intc.yaml > > b/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast270 > > 0-intc.yaml index 55636d06a674..bdc4d8835843 100644 > > --- > > a/Documentation/devicetree/bindings/interrupt-controller/aspeed,ast270 > > 0-intc.yaml > > +++ b/Documentation/devicetree/bindings/interrupt-controller/aspeed,as > > +++ t2700-intc.yaml > > @@ -10,6 +10,33 @@ description: > > This interrupt controller hardware is second level interrupt controller > that > > is hooked to a parent interrupt controller. It's useful to combine multiple > > interrupt sources into 1 interrupt to parent interrupt controller. > > + Depend to which INTC0 or INTC1 used. > > + INTC0 and INTC1 are two kinds of interrupt controller with enable > > + and raw status registers for use. > > + INTC0 is used to assert GIC if interrupt in INTC1 asserted. > > + INTC1 is used to assert INTC0 if interrupt of modules asserted. > > + +-----+ +---------+ > > + | GIC |---| INTC0 | > > + +-----+ +---------+ > > + +---------+ > > + | |---module0 > > + | INTC0_0 |---module1 > > + | |---... > > + +---------+---module31 > > + |---.... | > > + +---------+ > > + | | +---------+ > > + | INTC0_11| +---| INTC1 | > > + | | +---------+ > > + +---------+ +---------+---module0 > > + | INTC1_0 |---module1 > > + | |---... > > + +---------+---module31 > > + ... > > + +---------+---module0 > > + | INTC1_5 |---module1 > > + | |---... > > + +---------+---module31 > > > > maintainers: > > - Kevin Chen @@ -17,49 +44,70 @@ > > maintainers: > > properties: > > compatible: > > enum: > > - - aspeed,ast2700-intc-ic > > + - aspeed,ast2700-intc0 > > + - aspeed,ast2700-intc1 > > > > reg: > > maxItems: 1 > > > > - interrupt-controller: true > > + '#address-cells': > > + const: 2 > > > > - '#interrupt-cells': > > + '#size-cells': > > const: 2 > > - description: > > - The first cell is the IRQ number, the second cell is the trigger > > - type as defined in interrupt.txt in this directory. > > - > > - interrupts: > > - maxItems: 6 > > - description: | > > - Depend to which INTC0 or INTC1 used. > > - INTC0 and INTC1 are two kinds of interrupt controller with enable > and raw > > - status registers for use. > > - INTC0 is used to assert GIC if interrupt in INTC1 asserted. > > - INTC1 is used to assert INTC0 if interrupt of modules asserted. > > - +-----+ +-------+ +---------+---module0 > > - | GIC |---| INTC0 |--+--| INTC1_0 |---module2 > > - | | | | | | |---... > > - +-----+ +-------+ | +---------+---module31 > > - | > > - | +---------+---module0 > > - +---| INTC1_1 |---module2 > > - | | |---... > > - | +---------+---module31 > > - ... > > - | +---------+---module0 > > - +---| INTC1_5 |---module2 > > - | |---... > > - +---------+---module31 > > > > + ranges: true > > + > > +patternProperties: > > + "^interrupt-controller@": > > + type: object > > + description: Interrupt group child nodes > > + additionalProperties: false > > + > > + properties: > > + compatible: > > + enum: > > + - aspeed,ast2700-intc-ic > > + > > + reg: > > + maxItems: 1 > > + > > + interrupt-controller: true > > + > > + '#interrupt-cells': > > + const: 2 > > + description: | > > Don't need '|'. > > > + The first cell is the IRQ number, the second cell is the trigger > > + type as defined in interrupt.txt in this directory. > > Don't add links to legacy documents. > > > + > > + interrupts: > > + minItems: 1 > > + maxItems: 6 > > + description: | > > + The interrupts provided by this interrupt controller. > > + > > + interrupts-extended: > > Why do you have both interrupts and interrupts-extended? They are mutually > exclusive and both are auto-magically supported. The schemas only have to > document 'interrupts'. > > > + minItems: 1 > > + maxItems: 6 > > + description: | > > + This property is required when defining a cascaded interrupt > controller > > + that is connected under another interrupt controller. It specifies > the > > + parent interrupt(s) in the upstream controller to which this > controller > > + is connected. > > + > > + oneOf: > > + - required: [interrupts] > > + - required: [interrupts-extended] > > + > > + required: > > + - compatible > > + - reg > > + - interrupt-controller > > + - '#interrupt-cells' > > > > required: > > - compatible > > - reg > > - - interrupt-controller > > - - '#interrupt-cells' > > - - interrupts > > > > additionalProperties: false > > > > @@ -68,19 +116,43 @@ examples: > > #include > > > > bus { > > + #address-cells = <2>; > > + #size-cells = <2>; > > + > > + intc0: interrupt-controller at 12100000 { > > This node isn't an interrupt-controller. > > > + compatible = "aspeed,ast2700-intc0"; > > + reg = <0 0x12100000 0 0x4000>; > > + ranges = <0x0 0x0 0x0 0x12100000 0x0 0x4000>; > > + #address-cells = <2>; > > + #size-cells = <2>; > > + > > + intc0_11: interrupt-controller at 1b00 { > > + compatible = "aspeed,ast2700-intc-ic"; > > + reg = <0 0x12101b00 0 0x10>; > > + #interrupt-cells = <2>; > > + interrupt-controller; > > + interrupts = IRQ_TYPE_LEVEL_HIGH)>, > > + IRQ_TYPE_LEVEL_HIGH)>, > > + IRQ_TYPE_LEVEL_HIGH)>, > > + IRQ_TYPE_LEVEL_HIGH)>, > > + IRQ_TYPE_LEVEL_HIGH)>, > > + IRQ_TYPE_LEVEL_HIGH)>; > > + }; > > + }; > > + > > + intc1: interrupt-controller at 14c18000 { > > + compatible = "aspeed,ast2700-intc1"; > > + reg = <0 0x14c18000 0 0x400>; > > + ranges = <0x0 0x0 0x0 0x14c18000 0x0 0x400>; > > #address-cells = <2>; > > #size-cells = <2>; > > > > - interrupt-controller at 12101b00 { > > - compatible = "aspeed,ast2700-intc-ic"; > > - reg = <0 0x12101b00 0 0x10>; > > - #interrupt-cells = <2>; > > - interrupt-controller; > > - interrupts = , > > - , > > - , > > - , > > - , > > - ; > > + intc1_0: interrupt-controller at 100 { > > + compatible = "aspeed,ast2700-intc-ic"; > > + reg = <0x0 0x100 0x0 0x10>; > > + #interrupt-cells = <2>; > > + interrupt-controller; > > + interrupts-extended = <&intc0_11 0 > (GIC_CPU_MASK_SIMPLE(4) > > + | IRQ_TYPE_LEVEL_HIGH)>; > > }; > > + }; > > }; > > -- > > 2.34.1 > > From ryan_chen at aspeedtech.com Wed Jul 23 18:08:22 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Wed, 23 Jul 2025 08:08:22 +0000 Subject: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent node compatibles and refine documentation In-Reply-To: <001d37c7-f704-4554-a4db-0cc130e07dd6@kernel.org> References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> <20250722095156.1672873-2-ryan_chen@aspeedtech.com> <001d37c7-f704-4554-a4db-0cc130e07dd6@kernel.org> Message-ID: > Subject: Re: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add > parent node compatibles and refine documentation > > On 22/07/2025 11:51, Ryan Chen wrote: > > + INTC0 is used to assert GIC if interrupt in INTC1 asserted. > > + INTC1 is used to assert INTC0 if interrupt of modules asserted. > > + +-----+ +---------+ > > + | GIC |---| INTC0 | > > + +-----+ +---------+ > > + +---------+ > > + | |---module0 > > + | INTC0_0 |---module1 > > + | |---... > > + +---------+---module31 > > + |---.... | > > + +---------+ > > + | | +---------+ > > + | INTC0_11| +---| INTC1 | > > + | | +---------+ > > + +---------+ +---------+---module0 > > + | INTC1_0 |---module1 > > + | |---... > > + +---------+---module31 > > + ... > > + +---------+---module0 > > + | INTC1_5 |---module1 > > + | |---... > > + +---------+---module31 > > You binding also said intc1 is the parent of intc-ic, so where is here intc-ic? > > This diagram and new binding do not match at all. The corresponded compatible is following. +-----+ +---------+ | GIC |---| INTC0 | -> (parent : aspeed,ast2700-intc0) +-----+ +---------+ +---------+ | |---module0 | INTC0_0 |---module1 (child : aspeed,ast2700-intc-ic) | |---... +---------+---module31 |---.... | +---------+ | | +---------+ | INTC0_11 | +---------------------------- | INTC1 | -> -> (parent : aspeed,ast2700-intc1) (child : aspeed,ast2700-intc-ic) | | +---------+ +---------+ +-------- -+---module0 | INTC1_0 | --> (child : aspeed,ast2700-intc-ic) | |---... +--------- +---module31 ... +--------- +---module0 | INTC1_5 | --> ((child : aspeed,ast2700-intc-ic)) | |---... +--------- +---module31 > > > Best regards, > Krzysztof From ryan_chen at aspeedtech.com Wed Jul 23 18:18:46 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Wed, 23 Jul 2025 08:18:46 +0000 Subject: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent node compatibles and refine documentation In-Reply-To: References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> <20250722095156.1672873-2-ryan_chen@aspeedtech.com> Message-ID: > Subject: Re: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add > parent node compatibles and refine documentation > > On 22/07/2025 11:51, Ryan Chen wrote: > > The AST2700 SoC contains two independent top-level interrupt > > controllers > > (INTC0 and INTC1), each responsible for handling different peripheral > > groups and occupying separate register spaces. Above them, PSP(CA35) > > GIC controller acts as the root interrupt aggregator. Accurately > > describing this hierarchical hardware structure in the device tree > > requires distinct compatible strings for the parent nodes of INTC0 and INTC1. > > > > - Adds 'aspeed,ast2700-intc0' and 'aspeed,ast2700-intc1' compatible > > strings for parent interrupt controller nodes. (in addition to the > > existing 'aspeed,ast2700-intc-ic' for child nodes) > > I don't understand how this solves your problem at all. Look at old diagram - is > it correct? If not, what makes you think that new diagram is correct? > > What is the meaning of existing binding and existing intc-ic compatible? > The new parent nodes (aspeed,ast2700-intc0/intc1) make the device tree layout match the actual hardware separation shown in the SoC datasheet. This allows us to register the full resource region, allocate platform resources properly, and cleanly extend/debug in the future. The previous "aspeed,ast2700-intc-ic" compatible only describes the interrupt controller instance, not the full register block. In practice, with only a single child node, there is no way to: map and manage the entire address space for each INTC block (0x12100000 and 0x14c18000), or cleanly expose debug features that must access routing/protection registers outside the intc-ic range. The old diagram was incomplete, since it implied that the interrupt controller block had only the intc-ic instance, but in hardware each INTC region contains multiple functions and register ranges. This binding change is mainly for clarity and correctness, aligning DT and driver with the real SoC register map and future-proofing for debug/maintenance. > > > - Clarifies the relationship and function of INTC0 parent > > (intc0_0~x: child), INTC1 parent (intc1_0~x: child), and the GIC in > > the documentation. > > - Updates block diagrams and device tree examples to illustrate the > > hierarchy and compatible usage. > > - Refines documentation and example formatting. > > > > This change allows the device tree and driver to distinguish between > > parent (top-level) and child (group) interrupt controller nodes, > > enabling more precise driver matching SOC register space allocation. > > And how it was not possible before? That's poor argument especially that DT > does not have to ever distinguish that. > > > Best regards, > Krzysztof From linus.walleij at linaro.org Wed Jul 23 21:23:11 2025 From: linus.walleij at linaro.org (Linus Walleij) Date: Wed, 23 Jul 2025 13:23:11 +0200 Subject: [PATCH v2 07/10] pinctrl: aspeed-g6: Add PCIe RC PERST pin group In-Reply-To: <20250715034320.2553837-8-jacky_chou@aspeedtech.com> References: <20250715034320.2553837-1-jacky_chou@aspeedtech.com> <20250715034320.2553837-8-jacky_chou@aspeedtech.com> Message-ID: On Tue, Jul 15, 2025 at 5:43?AM Jacky Chou wrote: > The PCIe RC PERST uses SSPRST# as PERST# and enable this pin > to output. > > Signed-off-by: Jacky Chou This patch 7/10 applied to the pinctrl tree, why not. Yours, Linus Walleij From tglx at linutronix.de Thu Jul 24 03:37:26 2025 From: tglx at linutronix.de (Thomas Gleixner) Date: Wed, 23 Jul 2025 19:37:26 +0200 Subject: [PATCH v3 2/2] irqchip: aspeed: add debugfs support and AST2700 INTC0/INTC1 routing/protection display In-Reply-To: References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> <20250722095156.1672873-3-ryan_chen@aspeedtech.com> <8734aotfdq.ffs@tglx> Message-ID: <87wm7yrep5.ffs@tglx> On Wed, Jul 23 2025 at 06:02, Ryan Chen wrote: >> > +struct aspeed_intc { >> > + void __iomem *base; >> > + struct device *dev; >> > + struct dentry *dbg_root; >> > + int (*show_routing)(struct seq_file *s, void *unused); >> > + int (*show_prot)(struct seq_file *s, void *unused); }; >> >> See the chapter about struct declarations and initializers in the documentation >> I linked to above. > > Sorry, I don't see the struct "> > + int (*show_prot)(struct seq_file *s, void *unused); };" I fatfingered that, but that's not the problem. > My original submit is following, it should ok. Am I right? No. Read the chapter I pointed you to. > https://www.spinics.net/lists/kernel/msg5776957.html I have replied to this very mail. No need to paste me this and the pointer to some random mail archive From donalds at nvidia.com Thu Jul 24 07:58:14 2025 From: donalds at nvidia.com (Donald Shannon) Date: Wed, 23 Jul 2025 14:58:14 -0700 Subject: [PATCH v6 1/2] dt-bindings: arm: aspeed: Add NVIDIA GB200-UT3.0b board In-Reply-To: References: <20250723014239.22667-1-donalds@nvidia.com> <20250723014239.22667-2-donalds@nvidia.com> Message-ID: <24ce8704-1f9c-437e-ae72-1c6c3c672c2b@nvidia.com> On 7/22/25 22:56, Krzysztof Kozlowski wrote: > External email: Use caution opening links or attachments > > > On 23/07/2025 03:42, Donald Shannon wrote: >> This is an Aspeed AST2600 based unit testing platform for GB200. >> UT3.0b is different than nvidia-gb200nvl-bmc due to networking topology >> differences, additional gpio expanders, and voltage regulator gating >> some devices. >> >> Reference to Ast2600 SOC [1]. >> Reference to Blackwell GB200NVL Platform [2]. >> >> Link: https://www.aspeedtech.com/server_ast2600/ [1] >> Link: https://nvdam.widen.net/s/wwnsxrhm2w/blackwell-datasheet-3384703 [2] >> Signed-off-by: Donald Shannon >> Acked-by: Krzysztof Kozlowski > Why are you faking tags? No, you cannot just add whatever you want. > > Best regards, > Krzysztof Hi Krzysztof, I think?I was confused by your message on my V5 patch. I will remove the Acked-by and resubmit: >A nit, subject: drop second/last, redundant "binding". The >"dt-bindings" prefix is already stating that these are bindings. >See also: >https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18 > >With above two: > >Acked-by: Krzysztof Kozlowski > > >
>This is an automated instruction, just in case, because many review >tags are being ignored. If you know the process, just skip it entirely >(please do not feel offended by me posting it here - no bad intentions >intended, no patronizing, I just want to avoid wasted efforts). If you >do not know the process, here is a short explanation: > >Please add Acked-by/Reviewed-by/Tested-by tags when posting new >versions of patchset, under or above your Signed-off-by tag, unless >patch changed significantly (e.g. new properties added to the DT >bindings). Tag is "received", when provided in a message replied to you >on the mailing list. Tools like b4 can help here ('b4 trailers -u ...'). >However, there's no need to repost patches *only* to add the tags. The >upstream maintainer will do that for tags received on the version they >apply. Thanks, Donald From donalds at nvidia.com Thu Jul 24 08:23:48 2025 From: donalds at nvidia.com (Donald Shannon) Date: Wed, 23 Jul 2025 15:23:48 -0700 Subject: [PATCH v7 0/2] Adding device tree and binding for NVIDIA GB200-UT3.0b Message-ID: <20250723222350.200094-1-donalds@nvidia.com> Patch 1 adds the binding for the NVIDIA GB200-UT3.0b platform. Patch 2 adds the device tree for the NVIDIA GB200-UT3.0b platform. This is an Aspeed AST2600 based unit testing platform for GB200. UT3.0b is different than nvidia-gb200nvl-bmc due to networking topology differences, additional gpio expanders, and voltage regulator gating some devices. Reference to Ast2600 SOC [1]. Reference to Blackwell GB200NVL Platform [2]. Link: https://www.aspeedtech.com/server_ast2600/ [1] Link: https://nvdam.widen.net/s/wwnsxrhm2w/blackwell-datasheet-3384703 [2] Signed-off-by: Donald Shannon --- Changes v1 -> v2: - Changed phy-mode to rgmii-id [Lunn] - Removed redundant max-speed for mac0 [Lunn] - Fixed typo from gb200nvl to gb200 in Makefile Changes v2 -> v3: - Fixed whitespace issues [Krzysztof] - Fixed schema validation issues from my end ( there are still issues with the aspeed dtsi file that are not related to this new dts) [Herring] - Reordered to follow style guide [Krzysztof] - Removed redundant status okays - Changed vcc to vdd for the power gating on the gpio expanders Changes v3 -> v4: - Added changelog [Krzysztof] - Added nvidia,gb200-ut30b board binding [Krzysztof] - Removed unused imports - Reordered a couple other style guide violations - Added back in a couple needed "status okay"s Changes v4 -> v5: - Resumed my patch after a pause - Don't plan to make this include of nvidia-gb200nvl-bmc due to some platform differences - Fixed io expanders that weren't gated by the 3.3V standby regulator - Fixed incorrect interrupt pin for one IO expander - Removed some IO expanders and I2C busses Changes v5 -> v6: - Fixed subject line - Added missing gpio-key compatible type to buttons Changes v6 -> v7: - Removed Acked-by Krzysztof --- Donald Shannon (2): dt-bindings: arm: aspeed: Add NVIDIA GB200-UT3.0b board ARM: dts: aspeed: Add NVIDIA GB200 UT3.0b board .../bindings/arm/aspeed/aspeed.yaml | 1 + arch/arm/boot/dts/aspeed/Makefile | 1 + .../aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts | 1028 +++++++++++++++++ 3 files changed, 1030 insertions(+) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts base-commit: 05adbee3ad528100ab0285c15c91100e19e10138 -- 2.43.0 From donalds at nvidia.com Thu Jul 24 08:23:49 2025 From: donalds at nvidia.com (Donald Shannon) Date: Wed, 23 Jul 2025 15:23:49 -0700 Subject: [PATCH v7 1/2] dt-bindings: arm: aspeed: Add NVIDIA GB200-UT3.0b board In-Reply-To: <20250723222350.200094-1-donalds@nvidia.com> References: <20250723222350.200094-1-donalds@nvidia.com> Message-ID: <20250723222350.200094-2-donalds@nvidia.com> This is an Aspeed AST2600 based unit testing platform for GB200. UT3.0b is different than nvidia-gb200nvl-bmc due to networking topology differences, additional gpio expanders, and voltage regulator gating some devices. Reference to Ast2600 SOC [1]. Reference to Blackwell GB200NVL Platform [2]. Link: https://www.aspeedtech.com/server_ast2600/ [1] Link: https://nvdam.widen.net/s/wwnsxrhm2w/blackwell-datasheet-3384703 [2] Signed-off-by: Donald Shannon --- Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml index 456dbf7b5ec8..624581db2330 100644 --- a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml +++ b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml @@ -99,6 +99,7 @@ properties: - inventec,starscream-bmc - inventec,transformer-bmc - jabil,rbp-bmc + - nvidia,gb200-ut30b - nvidia,gb200nvl-bmc - qcom,dc-scm-v1-bmc - quanta,s6q-bmc -- 2.43.0 From donalds at nvidia.com Thu Jul 24 08:23:50 2025 From: donalds at nvidia.com (Donald Shannon) Date: Wed, 23 Jul 2025 15:23:50 -0700 Subject: [PATCH v7 2/2] ARM: dts: aspeed: Add NVIDIA GB200 UT3.0b board In-Reply-To: <20250723222350.200094-1-donalds@nvidia.com> References: <20250723222350.200094-1-donalds@nvidia.com> Message-ID: <20250723222350.200094-3-donalds@nvidia.com> This is an Aspeed AST2600 based unit testing platform for GB200. UT3.0b is different than nvidia-gb200nvl-bmc due to networking topology differences, additional gpio expanders, and voltage regulator gating some devices. Reference to Ast2600 SOC [1]. Reference to Blackwell GB200NVL Platform [2]. Link: https://www.aspeedtech.com/server_ast2600/ [1] Link: https://nvdam.widen.net/s/wwnsxrhm2w/blackwell-datasheet-3384703 [2] Signed-off-by: Donald Shannon --- Changes v1 -> v2: - Changed phy-mode to rgmii-id [Lunn] - Removed redundant max-speed for mac0 [Lunn] - Fixed typo from gb200nvl to gb200 in Makefile Changes v2 -> v3: - Fixed whitespace issues [Krzysztof] - Fixed schema validation issues from my end ( there are still issues with the aspeed dtsi file that are not related to this new dts) [Herring] - Reordered to follow style guide [Krzysztof] - Removed redundant status okays - Changed vcc to vdd for the power gating on the gpio expanders Changes v3 -> v4: - Added changelog [Krzysztof] - Added nvidia,gb200-ut30b board binding [Krzysztof] - Removed unused imports - Reordered a couple other style guide violations - Added back in a couple needed "status okay"s Changes v4 -> v5: - Resumed my patch after a pause - Don't plan to make this include of nvidia-gb200nvl-bmc due to some platform differences - Fixed io expanders that weren't gated by the 3.3V standby regulator - Fixed incorrect interrupt pin for one IO expander - Removed some IO expanders and I2C busses Changes v5 -> v6: - Fixed subject line - Added missing gpio-key compatible type to buttons Changes v6 -> v7: - Removed Acked-by Krzysztof --- arch/arm/boot/dts/aspeed/Makefile | 1 + .../aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts | 1028 +++++++++++++++++ 2 files changed, 1029 insertions(+) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile index aba7451ab749..37edc4625a9f 100644 --- a/arch/arm/boot/dts/aspeed/Makefile +++ b/arch/arm/boot/dts/aspeed/Makefile @@ -51,6 +51,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ aspeed-bmc-lenovo-hr630.dtb \ aspeed-bmc-lenovo-hr855xg2.dtb \ aspeed-bmc-microsoft-olympus.dtb \ + aspeed-bmc-nvidia-gb200-ut30b.dtb \ aspeed-bmc-nvidia-gb200nvl-bmc.dtb \ aspeed-bmc-opp-lanyang.dtb \ aspeed-bmc-opp-mowgli.dtb \ diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts new file mode 100644 index 000000000000..e0714ad796df --- /dev/null +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts @@ -0,0 +1,1028 @@ +// SPDX-License-Identifier: GPL-2.0+ +/dts-v1/; + +#include "aspeed-g6.dtsi" +#include + +/ { + model = "AST2600 GB200 UT3.0b BMC"; + compatible = "nvidia,gb200-ut30b", "aspeed,ast2600"; + + aliases { + serial2 = &uart3; + serial4 = &uart5; + i2c16 = &imux16; + i2c17 = &imux17; + i2c18 = &imux18; + i2c19 = &imux19; + i2c20 = &imux20; + i2c21 = &imux21; + i2c22 = &imux22; + i2c23 = &imux23; + i2c24 = &imux24; + i2c25 = &imux25; + i2c26 = &imux26; + i2c27 = &imux27; + i2c28 = &imux28; + i2c29 = &imux29; + i2c30 = &imux30; + i2c31 = &imux31; + i2c32 = &imux32; + i2c33 = &imux33; + i2c34 = &imux34; + i2c35 = &imux35; + i2c36 = &imux36; + i2c37 = &imux37; + i2c38 = &imux38; + i2c39 = &imux39; + i2c40 = &e1si2c0; + i2c41 = &e1si2c1; + i2c42 = &e1si2c2; + i2c43 = &e1si2c3; + i2c48 = &i2c17mux0; + i2c49 = &i2c17mux1; + i2c50 = &i2c17mux2; + i2c51 = &i2c17mux3; + i2c52 = &i2c25mux0; + i2c53 = &i2c25mux1; + i2c54 = &i2c25mux2; + i2c55 = &i2c25mux3; + i2c56 = &i2c29mux0; + i2c57 = &i2c29mux1; + i2c58 = &i2c29mux2; + i2c59 = &i2c29mux3; + }; + + buttons { + compatible = "gpio-keys"; + button-power { + label = "power-btn"; + gpio = <&sgpiom0 156 GPIO_ACTIVE_LOW>; + }; + button-uid { + label = "uid-btn"; + gpio = <&sgpiom0 154 GPIO_ACTIVE_LOW>; + }; + }; + + chosen { + stdout-path = &uart5; + }; + + leds { + compatible = "gpio-leds"; + led-0 { + label = "uid_led"; + gpios = <&sgpiom0 27 GPIO_ACTIVE_LOW>; + }; + led-1 { + label = "fault_led"; + gpios = <&sgpiom0 29 GPIO_ACTIVE_LOW>; + }; + led-2 { + label = "power_led"; + gpios = <&sgpiom0 31 GPIO_ACTIVE_LOW>; + }; + }; + + memory at 80000000 { + device_type = "memory"; + reg = <0x80000000 0x80000000>; + }; + + reg_3v3_stby: regulator-3v3-standby { + compatible = "regulator-fixed"; + regulator-name = "3v3-standby"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + gpio = <&gpio0 ASPEED_GPIO(M, 3) GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-always-on; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + vga_memory: framebuffer at 9f000000 { + no-map; + reg = <0x9f000000 0x01000000>; /* 16M */ + }; + + ramoops at a0000000 { + compatible = "ramoops"; + reg = <0xa0000000 0x100000>; /* 1MB */ + record-size = <0x10000>; /* 64KB */ + max-reason = <2>; /* KMSG_DUMP_OOPS */ + }; + + gfx_memory: framebuffer { + compatible = "shared-dma-pool"; + reusable; + size = <0x01000000>; + alignment = <0x01000000>; + }; + + video_engine_memory: jpegbuffer { + compatible = "shared-dma-pool"; + reusable; + size = <0x02000000>; /* 32M */ + alignment = <0x01000000>; + }; + }; +}; + +// Enable Primary flash on FMC for bring up activity +&fmc { + status = "okay"; + flash at 0 { + compatible = "jedec,spi-nor"; + label = "bmc"; + spi-max-frequency = <50000000>; + status = "okay"; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + u-boot at 0 { + // 896KB + reg = <0x0 0xe0000>; + label = "u-boot"; + }; + + kernel at 100000 { + // 9MB + reg = <0x100000 0x900000>; + label = "kernel"; + }; + + rofs at a00000 { + // 55292KB (extends to end of 64MB SPI - 4KB) + reg = <0xa00000 0x35FF000>; + label = "rofs"; + }; + }; + }; +}; + +&spi2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_spi2_default>; + status = "okay"; + // Data SPI is 64MB in size + flash at 0 { + label = "config"; + spi-max-frequency = <50000000>; + status = "okay"; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + u-boot-env at 0 { + // 256KB + reg = <0x0 0x40000>; + label = "u-boot-env"; + }; + + rwfs at 40000 { + // 16MB + reg = <0x40000 0x1000000>; + label = "rwfs"; + }; + + log at 1040000 { + // 40MB + reg = <0x1040000 0x2800000>; + label = "log"; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + ethphy0: ethernet-phy at 0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + }; +}; + +&mac0 { + pinctrl-names = "default"; + phy-mode = "rgmii-id"; + phy-handle = <ðphy0>; + pinctrl-0 = <&pinctrl_rgmii1_default>; + status = "okay"; +}; + +// USB Port B Controller +&ehci1 { + status = "okay"; +}; + +// USB Port B Controller +&uhci { + status = "okay"; +}; + +// USB port A vhub +&vhub { + status = "okay"; +}; + +&rng { + status = "okay"; +}; + +&video { + memory-region = <&video_engine_memory>; + status = "okay"; +}; + +&gpio0 { + gpio-line-names = + /*A0-A7*/ "", "", "", "", "", "", "", "", + /*B0-B7*/ "", "", "", "", "", "", "", "", + /*C0-C7*/ "SGPIO_I2C_MUX_SEL-O", "", "", "", "", "", "", "", + /*D0-D7*/ "", "", "", "UART1_MUX_SEL-O", "", "FPGA_PEX_RST_L-O", "", "", + /*E0-E7*/ "RTL8221_PHY_RST_L-O", "RTL8211_PHY_INT_L-I", "", "UART3_MUX_SEL-O", + "", "", "", "SGPIO_BMC_EN-O", + /*F0-F7*/ "", "", "", "", "", "", "", "", + /*G0-G7*/ "", "", "", "", "", "", "", "", + /*H0-H7*/ "", "", "", "", "", "", "", "", + /*I0-I7*/ "", "", "", "", "", "QSPI2_RST_L-O", "GLOBAL_WP_BMC-O", "BMC_DDR4_TEN-O", + /*J0-J7*/ "", "", "", "", "", "", "", "", + /*K0-K7*/ "", "", "", "", "", "", "", "", + /*L0-L7*/ "", "", "", "", "", "", "", "", + /*M0-M7*/ "PCIE_EP_RST_EN-O", "BMC_FRU_WP-O", "FPGA_RST_L-O", "STBY_POWER_EN-O", + "STBY_POWER_PG-I", "PCIE_EP_RST_L-O", "", "", + /*N0-N7*/ "", "", "", "", "", "", "", "", + /*O0-O7*/ "", "", "", "", "", "", "", "", + /*P0-P7*/ "", "", "", "", "", "", "", "", + /*Q0-Q7*/ "", "", "", "", "", "", "", "", + /*R0-R7*/ "", "", "", "", "", "", "", "", + /*S0-S7*/ "", "", "", "", "", "", "", "", + /*T0-T7*/ "", "", "", "", "", "", "", "", + /*U0-U7*/ "", "", "", "", "", "", "", "", + /*V0-V7*/ "AP_EROT_REQ-O", "EROT_AP_GNT-I", "", "","PCB_TEMP_ALERT-I", "","", "", + /*W0-W7*/ "", "", "", "", "", "", "", "", + /*X0-X7*/ "", "", "TPM_MUX_SEL-O", "", "", "", "", "", + /*Y0-Y7*/ "", "", "", "EMMC_RST-O", "","", "", "", + /*Z0-Z7*/ "BMC_READY-O","", "", "", "", "", "", ""; +}; + +&gpio1 { + /* 36 1.8V GPIOs */ + gpio-line-names = + /*A0-A7*/ "", "", "", "", "", "", "", "", + /*B0-B7*/ "", "", "", "", "", "", "IO_EXPANDER_INT_L-I","", + /*C0-C7*/ "", "", "", "", "", "", "", "", + /*D0-D7*/ "", "", "", "", "", "", "SPI_HOST_TPM_RST_L-O", "SPI_BMC_FPGA_INT_L-I", + /*E0-E7*/ "", "", "", "", "", "", "", ""; +}; + +&sgpiom0 { + ngpios = <128>; + status = "okay"; + gpio-line-names = + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "RUN_POWER_FAULT_L-I","SYS_RST_IN_L-O", + "RUN_POWER_PG-I","PWR_BRAKE_L-O", + "SYS_RST_OUT_L-I","RUN_POWER_EN-O", + "L0L1_RST_REQ_OUT_L-I","SHDN_FORCE_L-O", + "L2_RST_REQ_OUT_L-I","SHDN_REQ_L-O", + "SHDN_OK_L-I","UID_LED_N-O", + "BMC_I2C1_FPGA_ALERT_L-I","SYS_FAULT_LED_N-O", + "BMC_I2C0_FPGA_ALERT_L-I","PWR_LED_N-O", + "FPGA_RSVD_FFU3-I","", + "FPGA_RSVD_FFU2-I","", + "FPGA_RSVD_FFU1-I","", + "FPGA_RSVD_FFU0-I","BMC_I2C_SSIF_ALERT_L-O", + "CPU_BOOT_DONE-I","JTAG_MUX_SELECT-O", + "SPI_BMC_FPGA_INT_L-I","RTC_CLR_L-O", + "THERM_BB_WARN_L-I","UART_MUX_SEL-O", + "THERM_BB_OVERT_L-I","", + "CPU0_UPHY3_PRSNT1_L-I","IOBRD0_RUN_POWER_EN-O", + "CPU0_UPHY3_PRSNT0_L-I","IOBRD1_RUN_POWER_EN-O", + "CPU0_UPHY2_PRSNT1_L-I","FPGA_RSVD_FFU4-O", + "CPU0_UPHY2_PRSNT0_L-I","FPGA_RSVD_FFU5-O", + "CPU0_UPHY1_PRSNT1_L-I","FPGA_RSVD_FFU6-O", + "CPU0_UPHY1_PRSNT0_L-I","FPGA_RSVD_FFU7-O", + "CPU0_UPHY0_PRSNT1_L-I","RSVD_NV_PLT_DETECT-O", + "CPU0_UPHY0_PRSNT0_L-I","SPI1_INT_L-O", + "CPU1_UPHY3_PRSNT1_L-I","", + "CPU1_UPHY3_PRSNT0_L-I","HMC_EROT_MUX_STATUS", + "CPU1_UPHY2_PRSNT1_L-I","", + "CPU1_UPHY2_PRSNT0_L-I","", + "CPU1_UPHY1_PRSNT1_L-I","", + "CPU1_UPHY1_PRSNT0_L-I","", + "CPU1_UPHY0_PRSNT1_L-I","", + "CPU1_UPHY0_PRSNT0_L-I","", + "FAN1_PRESENT_L-I","", + "FAN0_PRESENT_L-I","", + "","", + "IPEX_CABLE_PRSNT_L-I","", + "M2_1_PRSNT_L-I","", + "M2_0_PRSNT_L-I","", + "CPU1_UPHY4_PRSNT1_L-I","", + "CPU0_UPHY4_PRSNT0_L-I","", + "","", + "I2C_RTC_ALERT_L-I","", + "FAN7_PRESENT_L-I","", + "FAN6_PRESENT_L-I","", + "FAN5_PRESENT_L-I","", + "FAN4_PRESENT_L-I","", + "FAN3_PRESENT_L-I","", + "FAN2_PRESENT_L-I","", + "IOBRD0_IOX_INT_L-I","", + "IOBRD1_PRSNT_L-I","", + "IOBRD0_PRSNT_L-I","", + "IOBRD1_PWR_GOOD-I","", + "IOBRD0_PWR_GOOD-I","", + "","", + "","", + "FAN_FAIL_IN_L-I","", + "","", + "","", + "","", + "PDB_CABLE_PRESENT_L-I","", + "","", + "CHASSIS_PWR_BRK_L-I","", + "","", + "IOBRD1_IOX_INT_L-I","", + "10GBE_SMBALRT_L-I","", + "PCIE_WAKE_L-I","", + "I2C_M21_ALERT_L-I","", + "I2C_M20_ALERT_L-I","", + "TRAY_FAST_SHDN_L-I","", + "UID_BTN_N-I","", + "PWR_BTN_L-I","", + "PSU_SMB_ALERT_L-I","", + "","", + "","", + "NODE_LOC_ID[0]-I","", + "NODE_LOC_ID[1]-I","", + "NODE_LOC_ID[2]-I","", + "NODE_LOC_ID[3]-I","", + "NODE_LOC_ID[4]-I","", + "NODE_LOC_ID[5]-I","", + "FAN10_PRESENT_L-I","", + "FAN9_PRESENT_L-I","", + "FAN8_PRESENT_L-I","", + "FPGA1_READY_HMC-I","", + "DP_HPD-I","", + "HMC_I2C3_FPGA_ALERT_L-I","", + "HMC_I2C2_FPGA_ALERT_L-I","", + "FPGA0_READY_HMC-I","", + "","", + "","", + "","", + "","", + "LEAK_DETECT_ALERT_L-I","", + "MOD1_B2B_CABLE_PRESENT_L-I","", + "MOD1_CLINK_CABLE_PRESENT_L-I","", + "FAN11_PRESENT_L-I","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "RSVD_SGPIO_IN_CRC[0]","RSVD_SGPIO_O_CRC[7]", + "RSVD_SGPIO_IN_CRC[1]","RSVD_SGPIO_O_CRC[6]", + "RSVD_SGPIO_IN_CRC[2]","RSVD_SGPIO_O_CRC[5]", + "RSVD_SGPIO_IN_CRC[3]","RSVD_SGPIO_O_CRC[4]", + "RSVD_SGPIO_IN_CRC[4]","RSVD_SGPIO_O_CRC[3]", + "RSVD_SGPIO_IN_CRC[5]","RSVD_SGPIO_O_CRC[2]", + "RSVD_SGPIO_IN_CRC[6]","RSVD_SGPIO_O_CRC[1]", + "RSVD_SGPIO_IN_CRC[7]","RSVD_SGPIO_O_CRC[0]"; +}; + +&uart1 { + status = "okay"; +}; + +// Enabling SOL +&uart3 { + status = "okay"; +}; + +// BMC Debug Console +&uart5 { + status = "okay"; +}; + +&uart_routing { }; + +// I2C1, SSIF IPMI interface +&i2c0 { + clock-frequency = <400000>; + status = "okay"; + ssif-bmc at 10 { + compatible = "ssif-bmc"; + reg = <0x10>; + }; +}; + +// I2C3 +// BMC_I2C0_FPGA - Primary FPGA +&i2c2 { + clock-frequency = <400000>; + multi-master; + status = "okay"; +}; + +// I2C5 +// RTC Driver +// IO Expander +&i2c4 { + clock-frequency = <400000>; + status = "okay"; + // Module 0, Expander @0x21 + exp4: gpio at 21 { + compatible = "nxp,pca9555"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio1>; + interrupts = ; + vcc-supply = <®_3v3_stby>; + gpio-line-names = + "RTC_MUX_SEL-O", + "PCI_MUX_SEL-O", + "TPM_MUX_SEL-O", + "FAN_MUX-SEL-O", + "SGMII_MUX_SEL-O", + "DP_MUX_SEL-O", + "UPHY3_USB_SEL-O", + "NCSI_MUX_SEL-O", + "BMC_PHY_RST-O", + "RTC_CLR_L-O", + "BMC_12V_CTRL-O", + "PS_RUN_IO0_PG-I", + "", + "", + "", + ""; + }; +}; + +// I2C6 +// Module 0/1 I2C MUX x3 +&i2c5 { + clock-frequency = <400000>; + multi-master; + status = "okay"; + + i2c-mux at 71 { + compatible = "nxp,pca9546"; + reg = <0x71>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + imux16: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux17: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + i2c-mux at 74 { + compatible = "nxp,pca9546"; + reg = <0x74>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + i2c17mux0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + i2c17mux1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + i2c17mux2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + i2c17mux3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + }; + + imux18: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux19: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 72 { + compatible = "nxp,pca9546"; + reg = <0x72>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + imux20: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux21: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + gpio at 20 { + compatible = "nxp,pca9555"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + vcc-supply = <®_3v3_stby>; + gpio-line-names = + "RST_CX_0_L-O", + "RST_CX_1_L-O", + "CX0_SSD0_PRSNT_L-I", + "CX1_SSD1_PRSNT_L-I", + "CX_BOOT_CMPLT_CX0-I", + "CX_BOOT_CMPLT_CX1-I", + "CX_TWARN_CX0_L-I", + "CX_TWARN_CX1_L-I", + "CX_OVT_SHDN_CX0-I", + "CX_OVT_SHDN_CX1-I", + "FNP_L_CX0-O", + "FNP_L_CX1-O", + "", + "MCU_GPIO-I", + "MCU_RST_N-O", + "MCU_RECOVERY_N-O"; + }; + }; + + imux22: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux23: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + + i2c-mux at 73 { + compatible = "nxp,pca9546"; + reg = <0x73>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + imux24: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux25: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + i2c-mux at 70 { + compatible = "nxp,pca9546"; + reg = <0x70>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + i2c25mux0: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c25mux1: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c25mux2: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c25mux3: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + }; + + imux26: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux27: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + + i2c-mux at 75 { + compatible = "nxp,pca9546"; + reg = <0x75>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + imux28: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux29: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + i2c-mux at 74 { + compatible = "nxp,pca9546"; + reg = <0x74>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + i2c29mux0: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c29mux1: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c29mux2: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c29mux3: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + }; + + imux30: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux31: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + + i2c-mux at 76 { + compatible = "nxp,pca9546"; + reg = <0x76>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + imux32: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux33: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux34: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux35: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + + i2c-mux at 77 { + compatible = "nxp,pca9546"; + reg = <0x77>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + imux36: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux37: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux38: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux39: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; +}; + +// I2C7 +// Module 0/1 Leak Sensors +// Module 0/1 Fan Controllers +&i2c6 { + clock-frequency = <400000>; + status = "okay"; + + pmic at 12 { + compatible = "ti,lm5066i"; + reg = <0x12>; + shunt-resistor-micro-ohms = <190>; + }; + + pmic at 14 { + compatible = "ti,lm5066i"; + reg = <0x14>; + shunt-resistor-micro-ohms = <190>; + }; + + pwm at 20 { + compatible = "maxim,max31790"; + reg = <0x20>; + }; + + pwm at 23 { + compatible = "maxim,max31790"; + reg = <0x23>; + }; + + pwm at 2c { + compatible = "maxim,max31790"; + reg = <0x2c>; + }; + + pwm at 2f { + compatible = "maxim,max31790"; + reg = <0x2f>; + }; +}; + +// I2C9 +// M.2 +&i2c8 { + clock-frequency = <400000>; + multi-master; + status = "okay"; +}; + +// I2C10 +// Module 0/1 IO Expanders +&i2c9 { + clock-frequency = <400000>; + status = "okay"; + + // Module 0, Expander @0x20 + exp0: gpio at 20 { + compatible = "nxp,pca9555"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio1>; + interrupts = ; + vcc-supply = <®_3v3_stby>; + gpio-line-names = + "FPGA_THERM_OVERT_L-I", + "FPGA_READY_BMC-I", + "HMC_BMC_DETECT-O", + "HMC_PGOOD-O", + "", + "BMC_STBY_CYCLE-O", + "FPGA_EROT_FATAL_ERROR_L-I", + "WP_HW_EXT_CTRL_L-O", + "EROT_FPGA_RST_L-O", + "FPGA_EROT_RECOVERY_L-O", + "BMC_EROT_FPGA_SPI_MUX_SEL-O", + "USB_HUB_RESET_L-O", + "NCSI_CS1_SEL-O", + "SGPIO_EN_L-O", + "B2B_IOEXP_INT_L-I", + "I2C_BUS_MUX_RESET_L-O"; + }; + + // UT3.0b Expander @0x22 + exp2: gpio at 22 { + compatible = "nxp,pca9555"; + reg = <0x22>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio1>; + interrupts = ; + vcc-supply = <®_3v3_stby>; + gpio-line-names = + "BMC1_FANCTRL_FAIL_L-I", + "IOEXP_BMC_RST_12V-O", + "NODE_RST_STBY_H-O", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + ""; + }; + + // UT3.0b Expander @0x23 + exp3: gpio at 23 { + compatible = "nxp,pca9555"; + reg = <0x23>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio1>; + interrupts = ; + vcc-supply = <®_3v3_stby>; + gpio-line-names = + "PEXSW_FL_SPI_MUX_SEL-O", + "PEX_SW_FATAL_ERROR_3V3_L-I", + "IOEXP_PDB_NODE_EN_L-O", + "NODE_PWOK_ISO-I", + "BMC_FAN_PWR_EN-O", + "BMC_ETHERNET_INT-I", + "BMC_ENET_RST-O", + "IOEXP_BMC_RST_SENSE-O", + "BMC_ID-I", + "TPM_MUX_3V3_SEL_N-O", + "IOEXP_TPM_RST_N-O", + "TPM_DOWN_SPI_INT_L-I", + "PS_BRD_PGOOD-I", + "FP_BUTTON_POWER_N-I", + "FP_BUTTON_RESET_N-I", + "FP_LED_POWER_GPIOEXP_N-O"; + }; +}; + +// I2C11 +// BMC FRU EEPROM +// BMC Temp Sensor +&i2c10 { + clock-frequency = <400000>; + status = "okay"; + + // BMC FRU EEPROM - 256 bytes + eeprom at 50 { + compatible = "atmel,24c02"; + reg = <0x50>; + pagesize = <8>; + }; +}; + +// I2C12 +&i2c11 { + clock-frequency = <400000>; + status = "okay"; +}; + +// I2C15 +// Module 1 UPHY3 SMBus +&i2c14 { + clock-frequency = <100000>; + multi-master; + status = "okay"; + + //E1.S drive slot 0-3 + i2c-mux at 77 { + compatible = "nxp,pca9546"; + reg = <0x77>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + e1si2c0: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + e1si2c1: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + e1si2c2: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + e1si2c3: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; +}; -- 2.43.0 From rentao.bupt at gmail.com Thu Jul 24 09:29:57 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Wed, 23 Jul 2025 16:29:57 -0700 Subject: [PATCH v3 01/13] ARM: dts: aspeed: wedge400: Fix DTB warnings In-Reply-To: <20250723233013.142337-1-rentao.bupt@gmail.com> References: <20250723233013.142337-1-rentao.bupt@gmail.com> Message-ID: <20250723233013.142337-2-rentao.bupt@gmail.com> From: Tao Ren Fix the deprecated spi-gpio properties in wedge400 dts. Signed-off-by: Tao Ren --- Changes in v3: - None. Changes in v2: - None (the patch is introduced in v2). arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts index 5a8169bbda87..3e4d30f0884d 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts @@ -75,9 +75,9 @@ spi_gpio: spi { #size-cells = <0>; cs-gpios = <&gpio ASPEED_GPIO(R, 2) GPIO_ACTIVE_LOW>; - gpio-sck = <&gpio ASPEED_GPIO(R, 3) GPIO_ACTIVE_HIGH>; - gpio-mosi = <&gpio ASPEED_GPIO(R, 4) GPIO_ACTIVE_HIGH>; - gpio-miso = <&gpio ASPEED_GPIO(R, 5) GPIO_ACTIVE_HIGH>; + sck-gpios = <&gpio ASPEED_GPIO(R, 3) GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio ASPEED_GPIO(R, 4) GPIO_ACTIVE_HIGH>; + miso-gpios = <&gpio ASPEED_GPIO(R, 5) GPIO_ACTIVE_HIGH>; num-chipselects = <1>; tpm at 0 { -- 2.47.3 From rentao.bupt at gmail.com Thu Jul 24 09:29:56 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Wed, 23 Jul 2025 16:29:56 -0700 Subject: [PATCH v3 00/13] ARM: dts: aspeed: Add Meta Darwin dts Message-ID: <20250723233013.142337-1-rentao.bupt@gmail.com> From: Tao Ren The patch series introduces the initial device tree for Meta/Facebook Darwin AST2600 BMC. Patches #1, #2 and #3 fixes the DTB warnings in wedge400/fuji dts and ast2600-facebook-netbmc-common.dtsi. Patch #4 moves eMMC entries from ast2600-facebook-netbmc-common.dtsi to each BMC platform because eMMC was removed from future Meta Network BMC platforms. Patch #5 introduces new BMC flash layout with 64MB data partition. Patches #6, #7 and #8 add "wedge400-data64-bmc" board. "wedge400-bmc" and "wedge400-data64-bmc" are identical except BMC flash layout. Patches #9, #10 and #11 add "fuji-data64-bmc" board. "fuji-bmc" and "fuji-data64-bmc" are identical except BMC flash layout. Patches #12 and #13 add Meta Darwin BMC and updates devicetree bindings. Tao Ren (13): ARM: dts: aspeed: wedge400: Fix DTB warnings ARM: dts: aspeed: fuji: Fix DTB warnings ARM: dts: aspeed: Fix DTB warnings in ast2600-facebook-netbmc-common.dtsi ARM: dts: aspeed: Move eMMC out of ast2600-facebook-netbmc-common.dtsi ARM: dts: aspeed: Add facebook-bmc-flash-layout-128-data64.dtsi dt-bindings: arm: aspeed: add Facebook Wedge400-data64 board ARM: dts: aspeed: Add Facebook Wedge400-data64 (AST2500) BMC ARM: dts: aspeed: wedge400: Include wedge400-data64.dts dt-bindings: arm: aspeed: add Facebook Fuji-data64 board ARM: dts: aspeed: Add Facebook Fuji-data64 (AST2600) Board ARM: dts: aspeed: facebook-fuji: Include facebook-fuji-data64.dts dt-bindings: arm: aspeed: add Facebook Darwin board ARM: dts: aspeed: Add Facebook Darwin (AST2600) BMC .../bindings/arm/aspeed/aspeed.yaml | 3 + arch/arm/boot/dts/aspeed/Makefile | 3 + .../dts/aspeed/aspeed-bmc-facebook-darwin.dts | 72 + .../dts/aspeed/aspeed-bmc-facebook-elbert.dts | 12 + .../aspeed-bmc-facebook-fuji-data64.dts | 1264 +++++++++++++++++ .../dts/aspeed/aspeed-bmc-facebook-fuji.dts | 1245 +--------------- .../aspeed-bmc-facebook-wedge400-data64.dts | 376 +++++ .../aspeed/aspeed-bmc-facebook-wedge400.dts | 366 +---- .../ast2600-facebook-netbmc-common.dtsi | 22 +- .../facebook-bmc-flash-layout-128-data64.dtsi | 60 + 10 files changed, 1804 insertions(+), 1619 deletions(-) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dts create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dts create mode 100644 arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128-data64.dtsi -- 2.47.3 From rentao.bupt at gmail.com Thu Jul 24 09:29:58 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Wed, 23 Jul 2025 16:29:58 -0700 Subject: [PATCH v3 02/13] ARM: dts: aspeed: fuji: Fix DTB warnings In-Reply-To: <20250723233013.142337-1-rentao.bupt@gmail.com> References: <20250723233013.142337-1-rentao.bupt@gmail.com> Message-ID: <20250723233013.142337-3-rentao.bupt@gmail.com> From: Tao Ren Remove redundant adm1278 properties from fuji dts. Signed-off-by: Tao Ren --- Changes in v3: - None. Changes in v2: - None (the patch is introduced in v2). arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts index f23c26a3441d..840d19d6b1d4 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts @@ -248,8 +248,6 @@ imux16: i2c at 0 { adm1278 at 10 { compatible = "adi,adm1278"; reg = <0x10>; - #address-cells = <1>; - #size-cells = <0>; shunt-resistor-micro-ohms = <1500>; }; }; @@ -577,8 +575,6 @@ imux67: i2c at 3 { adm1278 at 10 { compatible = "adi,adm1278"; reg = <0x10>; - #address-cells = <1>; - #size-cells = <0>; shunt-resistor-micro-ohms = <250>; }; }; @@ -648,8 +644,6 @@ imux75: i2c at 3 { adm1278 at 10 { compatible = "adi,adm1278"; reg = <0x10>; - #address-cells = <1>; - #size-cells = <0>; shunt-resistor-micro-ohms = <250>; }; }; -- 2.47.3 From rentao.bupt at gmail.com Thu Jul 24 09:29:59 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Wed, 23 Jul 2025 16:29:59 -0700 Subject: [PATCH v3 03/13] ARM: dts: aspeed: Fix DTB warnings in ast2600-facebook-netbmc-common.dtsi In-Reply-To: <20250723233013.142337-1-rentao.bupt@gmail.com> References: <20250723233013.142337-1-rentao.bupt@gmail.com> Message-ID: <20250723233013.142337-4-rentao.bupt@gmail.com> From: Tao Ren Fix deprecated spi-gpio properties in ast2600-facebook-netbmc-common.dtsi. Signed-off-by: Tao Ren --- Changes in v3: - None. Changes in v2: - None (the patch is introduced in v2). .../dts/aspeed/ast2600-facebook-netbmc-common.dtsi | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi b/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi index 00e5887c926f..208cf6567ed4 100644 --- a/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi +++ b/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi @@ -31,9 +31,13 @@ spi_gpio: spi { #address-cells = <1>; #size-cells = <0>; - gpio-sck = <&gpio0 ASPEED_GPIO(X, 3) GPIO_ACTIVE_HIGH>; - gpio-mosi = <&gpio0 ASPEED_GPIO(X, 4) GPIO_ACTIVE_HIGH>; - gpio-miso = <&gpio0 ASPEED_GPIO(X, 5) GPIO_ACTIVE_HIGH>; + /* + * chipselect pins are defined in platform .dts files + * separately. + */ + sck-gpios = <&gpio0 ASPEED_GPIO(X, 3) GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio0 ASPEED_GPIO(X, 4) GPIO_ACTIVE_HIGH>; + miso-gpios = <&gpio0 ASPEED_GPIO(X, 5) GPIO_ACTIVE_HIGH>; tpm at 0 { compatible = "infineon,slb9670", "tcg,tpm_tis-spi"; -- 2.47.3 From rentao.bupt at gmail.com Thu Jul 24 09:30:00 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Wed, 23 Jul 2025 16:30:00 -0700 Subject: [PATCH v3 04/13] ARM: dts: aspeed: Move eMMC out of ast2600-facebook-netbmc-common.dtsi In-Reply-To: <20250723233013.142337-1-rentao.bupt@gmail.com> References: <20250723233013.142337-1-rentao.bupt@gmail.com> Message-ID: <20250723233013.142337-5-rentao.bupt@gmail.com> From: Tao Ren Move eMMC entries from ast2600-facebook-netbmc-common.dtsi to each platform because eMMC is removed from future Meta/Facebook AST2600 Network BMC platforms. Signed-off-by: Tao Ren --- Changes in v3: - None. Changes in v2: - The 3 emmc-related patches in v1 are squashed into this patch. .../boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts | 12 ++++++++++++ .../arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts | 12 ++++++++++++ .../dts/aspeed/ast2600-facebook-netbmc-common.dtsi | 12 ------------ 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts index 74f3c67e0eff..ff1009ea1c49 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts @@ -201,3 +201,15 @@ fixed-link { full-duplex; }; }; + +&emmc_controller { + status = "okay"; +}; + +&emmc { + status = "okay"; + + non-removable; + max-frequency = <25000000>; + bus-width = <4>; +}; diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts index 840d19d6b1d4..d0331980d082 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts @@ -1243,3 +1243,15 @@ &mac3 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_rgmii4_default>; }; + +&emmc_controller { + status = "okay"; +}; + +&emmc { + status = "okay"; + + non-removable; + max-frequency = <25000000>; + bus-width = <4>; +}; diff --git a/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi b/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi index 208cf6567ed4..0ef225acddfc 100644 --- a/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi +++ b/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi @@ -156,18 +156,6 @@ &vhub { status = "okay"; }; -&emmc_controller { - status = "okay"; -}; - -&emmc { - status = "okay"; - - non-removable; - max-frequency = <25000000>; - bus-width = <4>; -}; - &rtc { status = "okay"; }; -- 2.47.3 From rentao.bupt at gmail.com Thu Jul 24 09:30:01 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Wed, 23 Jul 2025 16:30:01 -0700 Subject: [PATCH v3 05/13] ARM: dts: aspeed: Add facebook-bmc-flash-layout-128-data64.dtsi In-Reply-To: <20250723233013.142337-1-rentao.bupt@gmail.com> References: <20250723233013.142337-1-rentao.bupt@gmail.com> Message-ID: <20250723233013.142337-6-rentao.bupt@gmail.com> From: Tao Ren Add facebook-bmc-flash-layout-128-data64.dts (with 64MB datastore) to be used by Meta Network BMC platforms. Signed-off-by: Tao Ren --- Changes in v3: - None. Changes in v2: - None (the patch is introduced in v2 per Andrew's suggestion). .../facebook-bmc-flash-layout-128-data64.dtsi | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128-data64.dtsi diff --git a/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128-data64.dtsi b/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128-data64.dtsi new file mode 100644 index 000000000000..efd92232cda2 --- /dev/null +++ b/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128-data64.dtsi @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Copyright (c) 2020 Facebook Inc. + +partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* + * u-boot partition: 896KB. + */ + u-boot at 0 { + reg = <0x0 0xe0000>; + label = "u-boot"; + }; + + /* + * u-boot environment variables: 64KB. + */ + u-boot-env at e0000 { + reg = <0xe0000 0x10000>; + label = "env"; + }; + + /* + * image metadata partition (64KB), used by Facebook internal + * tools. + */ + image-meta at f0000 { + reg = <0xf0000 0x10000>; + label = "meta"; + }; + + /* + * FIT image: 63 MB. + */ + fit at 100000 { + reg = <0x100000 0x3f00000>; + label = "fit"; + }; + + /* + * "data0" partition (64MB) is used by Facebook BMC platforms as + * persistent data store. + */ + data0 at 4000000 { + reg = <0x4000000 0x4000000>; + label = "data0"; + }; + + /* + * Although the master partition can be created by enabling + * MTD_PARTITIONED_MASTER option, below "flash0" partition is + * explicitly created to avoid breaking legacy applications. + */ + flash0 at 0 { + reg = <0x0 0x8000000>; + label = "flash0"; + }; +}; -- 2.47.3 From rentao.bupt at gmail.com Thu Jul 24 09:30:02 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Wed, 23 Jul 2025 16:30:02 -0700 Subject: [PATCH v3 06/13] dt-bindings: arm: aspeed: add Facebook Wedge400-data64 board In-Reply-To: <20250723233013.142337-1-rentao.bupt@gmail.com> References: <20250723233013.142337-1-rentao.bupt@gmail.com> Message-ID: <20250723233013.142337-7-rentao.bupt@gmail.com> From: Tao Ren Document the new compatibles used on Meta/Facebook Wedge400-data64 board. Signed-off-by: Tao Ren --- Changes in v3: - None (the patch is introduced in v3). Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml index 01333ac111fb..0c9d6a30dce0 100644 --- a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml +++ b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml @@ -46,6 +46,7 @@ properties: - facebook,yamp-bmc - facebook,yosemitev2-bmc - facebook,wedge400-bmc + - facebook,wedge400-data64-bmc - hxt,stardragon4800-rep2-bmc - ibm,mihawk-bmc - ibm,mowgli-bmc -- 2.47.3 From rentao.bupt at gmail.com Thu Jul 24 09:30:03 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Wed, 23 Jul 2025 16:30:03 -0700 Subject: [PATCH v3 07/13] ARM: dts: aspeed: Add Facebook Wedge400-data64 (AST2500) BMC In-Reply-To: <20250723233013.142337-1-rentao.bupt@gmail.com> References: <20250723233013.142337-1-rentao.bupt@gmail.com> Message-ID: <20250723233013.142337-8-rentao.bupt@gmail.com> From: Tao Ren Add wedge400-data64.dts to extend wedge400's data0 partition from 8MB to 64MB smoothly. wedge400-data64.dts is copied from wedge400.dts with below changes: - updating model/compatible strings. - updating BMC flash layout. Signed-off-by: Tao Ren --- Changes in v3: - None (the patch is introduced in v3). arch/arm/boot/dts/aspeed/Makefile | 1 + .../aspeed-bmc-facebook-wedge400-data64.dts | 376 ++++++++++++++++++ 2 files changed, 377 insertions(+) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dts diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile index 2e5f4833a073..55be25acfc80 100644 --- a/arch/arm/boot/dts/aspeed/Makefile +++ b/arch/arm/boot/dts/aspeed/Makefile @@ -30,6 +30,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ aspeed-bmc-facebook-tiogapass.dtb \ aspeed-bmc-facebook-wedge40.dtb \ aspeed-bmc-facebook-wedge100.dtb \ + aspeed-bmc-facebook-wedge400-data64.dtb \ aspeed-bmc-facebook-wedge400.dtb \ aspeed-bmc-facebook-yamp.dtb \ aspeed-bmc-facebook-yosemitev2.dtb \ diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dts new file mode 100644 index 000000000000..5b23842f26a3 --- /dev/null +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dts @@ -0,0 +1,376 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Copyright (c) 2019 Facebook Inc. +/dts-v1/; + +#include +#include "ast2500-facebook-netbmc-common.dtsi" + +/ { + model = "Facebook Wedge 400 BMC (64MB Datastore)"; + compatible = "facebook,wedge400-data64-bmc", "aspeed,ast2500"; + + aliases { + /* + * PCA9548 (2-0070) provides 8 channels connecting to + * SCM (System Controller Module). + */ + i2c16 = &imux16; + i2c17 = &imux17; + i2c18 = &imux18; + i2c19 = &imux19; + i2c20 = &imux20; + i2c21 = &imux21; + i2c22 = &imux22; + i2c23 = &imux23; + + /* + * PCA9548 (8-0070) provides 8 channels connecting to + * SMB (Switch Main Board). + */ + i2c24 = &imux24; + i2c25 = &imux25; + i2c26 = &imux26; + i2c27 = &imux27; + i2c28 = &imux28; + i2c29 = &imux29; + i2c30 = &imux30; + i2c31 = &imux31; + + /* + * PCA9548 (11-0076) provides 8 channels connecting to + * FCM (Fan Controller Module). + */ + i2c32 = &imux32; + i2c33 = &imux33; + i2c34 = &imux34; + i2c35 = &imux35; + i2c36 = &imux36; + i2c37 = &imux37; + i2c38 = &imux38; + i2c39 = &imux39; + + spi2 = &spi_gpio; + }; + + chosen { + stdout-path = &uart1; + bootargs = "console=ttyS0,9600n8 root=/dev/ram rw"; + }; + + ast-adc-hwmon { + compatible = "iio-hwmon"; + io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>, <&adc 4>, + <&adc 5>, <&adc 6>, <&adc 7>, <&adc 8>; + }; + + /* + * GPIO-based SPI Master is required to access SPI TPM, because + * full-duplex SPI transactions are not supported by ASPEED SPI + * Controllers. + */ + spi_gpio: spi { + status = "okay"; + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + cs-gpios = <&gpio ASPEED_GPIO(R, 2) GPIO_ACTIVE_LOW>; + sck-gpios = <&gpio ASPEED_GPIO(R, 3) GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio ASPEED_GPIO(R, 4) GPIO_ACTIVE_HIGH>; + miso-gpios = <&gpio ASPEED_GPIO(R, 5) GPIO_ACTIVE_HIGH>; + num-chipselects = <1>; + + tpm at 0 { + compatible = "infineon,slb9670", "tcg,tpm_tis-spi"; + spi-max-frequency = <33000000>; + reg = <0>; + }; + }; +}; + +/* + * Both firmware flashes are 128MB on Wedge400 BMC. + */ +&fmc_flash0 { +#include "facebook-bmc-flash-layout-128-data64.dtsi" +}; + +&fmc_flash1 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + flash1 at 0 { + reg = <0x0 0x8000000>; + label = "flash1"; + }; + }; +}; + +&uart2 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_txd2_default + &pinctrl_rxd2_default>; +}; + +&uart4 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_txd4_default + &pinctrl_rxd4_default>; +}; + +/* + * I2C bus #0 is multi-master environment dedicated for BMC and Bridge IC + * communication. + */ +&i2c0 { + status = "okay"; + multi-master; + bus-frequency = <1000000>; +}; + +&i2c1 { + status = "okay"; +}; + +&i2c2 { + status = "okay"; + + i2c-mux at 70 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x70>; + i2c-mux-idle-disconnect; + + imux16: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux17: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux18: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux19: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux20: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux21: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux22: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux23: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; +}; + +&i2c3 { + status = "okay"; +}; + +&i2c4 { + status = "okay"; +}; + +&i2c5 { + status = "okay"; +}; + +&i2c6 { + status = "okay"; +}; + +&i2c7 { + status = "okay"; +}; + +&i2c8 { + status = "okay"; + + i2c-mux at 70 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x70>; + i2c-mux-idle-disconnect; + + imux24: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux25: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux26: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux27: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux28: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux29: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux30: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux31: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + + }; +}; + +&i2c9 { + status = "okay"; +}; + +&i2c10 { + status = "okay"; +}; + +&i2c11 { + status = "okay"; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux32: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux33: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux34: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux35: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux36: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux37: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux38: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux39: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + + }; +}; + +&i2c12 { + status = "okay"; +}; + +&i2c13 { + status = "okay"; +}; + +&adc { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&uhci { + status = "okay"; +}; + +&sdhci1 { + max-frequency = <25000000>; + /* + * DMA mode needs to be disabled to avoid conflicts with UHCI + * Controller in AST2500 SoC. + */ + sdhci-caps-mask = <0x0 0x580000>; +}; -- 2.47.3 From rentao.bupt at gmail.com Thu Jul 24 09:30:04 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Wed, 23 Jul 2025 16:30:04 -0700 Subject: [PATCH v3 08/13] ARM: dts: aspeed: wedge400: Include wedge400-data64.dts In-Reply-To: <20250723233013.142337-1-rentao.bupt@gmail.com> References: <20250723233013.142337-1-rentao.bupt@gmail.com> Message-ID: <20250723233013.142337-9-rentao.bupt@gmail.com> From: Tao Ren Include "wedge400-data64.dts" in wedge400 dts to avoid duplicated code. Wedge400-data64 and Wedge400 are identical except the BMC flash layout. Signed-off-by: Tao Ren --- Changes in v3: - None (the patch is introduced in v3). .../aspeed/aspeed-bmc-facebook-wedge400.dts | 366 +----------------- 1 file changed, 2 insertions(+), 364 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts index 3e4d30f0884d..ef0cfc51cda4 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts @@ -1,376 +1,14 @@ // SPDX-License-Identifier: GPL-2.0+ // Copyright (c) 2019 Facebook Inc. -/dts-v1/; -#include -#include "ast2500-facebook-netbmc-common.dtsi" +#include "aspeed-bmc-facebook-wedge400-data64.dts" / { model = "Facebook Wedge 400 BMC"; compatible = "facebook,wedge400-bmc", "aspeed,ast2500"; - - aliases { - /* - * PCA9548 (2-0070) provides 8 channels connecting to - * SCM (System Controller Module). - */ - i2c16 = &imux16; - i2c17 = &imux17; - i2c18 = &imux18; - i2c19 = &imux19; - i2c20 = &imux20; - i2c21 = &imux21; - i2c22 = &imux22; - i2c23 = &imux23; - - /* - * PCA9548 (8-0070) provides 8 channels connecting to - * SMB (Switch Main Board). - */ - i2c24 = &imux24; - i2c25 = &imux25; - i2c26 = &imux26; - i2c27 = &imux27; - i2c28 = &imux28; - i2c29 = &imux29; - i2c30 = &imux30; - i2c31 = &imux31; - - /* - * PCA9548 (11-0076) provides 8 channels connecting to - * FCM (Fan Controller Module). - */ - i2c32 = &imux32; - i2c33 = &imux33; - i2c34 = &imux34; - i2c35 = &imux35; - i2c36 = &imux36; - i2c37 = &imux37; - i2c38 = &imux38; - i2c39 = &imux39; - - spi2 = &spi_gpio; - }; - - chosen { - stdout-path = &uart1; - bootargs = "console=ttyS0,9600n8 root=/dev/ram rw"; - }; - - ast-adc-hwmon { - compatible = "iio-hwmon"; - io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>, <&adc 4>, - <&adc 5>, <&adc 6>, <&adc 7>, <&adc 8>; - }; - - /* - * GPIO-based SPI Master is required to access SPI TPM, because - * full-duplex SPI transactions are not supported by ASPEED SPI - * Controllers. - */ - spi_gpio: spi { - status = "okay"; - compatible = "spi-gpio"; - #address-cells = <1>; - #size-cells = <0>; - - cs-gpios = <&gpio ASPEED_GPIO(R, 2) GPIO_ACTIVE_LOW>; - sck-gpios = <&gpio ASPEED_GPIO(R, 3) GPIO_ACTIVE_HIGH>; - mosi-gpios = <&gpio ASPEED_GPIO(R, 4) GPIO_ACTIVE_HIGH>; - miso-gpios = <&gpio ASPEED_GPIO(R, 5) GPIO_ACTIVE_HIGH>; - num-chipselects = <1>; - - tpm at 0 { - compatible = "infineon,slb9670", "tcg,tpm_tis-spi"; - spi-max-frequency = <33000000>; - reg = <0>; - }; - }; }; -/* - * Both firmware flashes are 128MB on Wedge400 BMC. - */ &fmc_flash0 { + /delete-node/partitions; #include "facebook-bmc-flash-layout-128.dtsi" }; - -&fmc_flash1 { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - flash1 at 0 { - reg = <0x0 0x8000000>; - label = "flash1"; - }; - }; -}; - -&uart2 { - status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_txd2_default - &pinctrl_rxd2_default>; -}; - -&uart4 { - status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_txd4_default - &pinctrl_rxd4_default>; -}; - -/* - * I2C bus #0 is multi-master environment dedicated for BMC and Bridge IC - * communication. - */ -&i2c0 { - status = "okay"; - multi-master; - bus-frequency = <1000000>; -}; - -&i2c1 { - status = "okay"; -}; - -&i2c2 { - status = "okay"; - - i2c-mux at 70 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x70>; - i2c-mux-idle-disconnect; - - imux16: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux17: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux18: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux19: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux20: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux21: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux22: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux23: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; -}; - -&i2c3 { - status = "okay"; -}; - -&i2c4 { - status = "okay"; -}; - -&i2c5 { - status = "okay"; -}; - -&i2c6 { - status = "okay"; -}; - -&i2c7 { - status = "okay"; -}; - -&i2c8 { - status = "okay"; - - i2c-mux at 70 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x70>; - i2c-mux-idle-disconnect; - - imux24: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux25: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux26: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux27: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux28: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux29: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux30: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux31: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - - }; -}; - -&i2c9 { - status = "okay"; -}; - -&i2c10 { - status = "okay"; -}; - -&i2c11 { - status = "okay"; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux32: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux33: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux34: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux35: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux36: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux37: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux38: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux39: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - - }; -}; - -&i2c12 { - status = "okay"; -}; - -&i2c13 { - status = "okay"; -}; - -&adc { - status = "okay"; -}; - -&ehci1 { - status = "okay"; -}; - -&uhci { - status = "okay"; -}; - -&sdhci1 { - max-frequency = <25000000>; - /* - * DMA mode needs to be disabled to avoid conflicts with UHCI - * Controller in AST2500 SoC. - */ - sdhci-caps-mask = <0x0 0x580000>; -}; -- 2.47.3 From rentao.bupt at gmail.com Thu Jul 24 09:30:05 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Wed, 23 Jul 2025 16:30:05 -0700 Subject: [PATCH v3 09/13] dt-bindings: arm: aspeed: add Facebook Fuji-data64 board In-Reply-To: <20250723233013.142337-1-rentao.bupt@gmail.com> References: <20250723233013.142337-1-rentao.bupt@gmail.com> Message-ID: <20250723233013.142337-10-rentao.bupt@gmail.com> From: Tao Ren Document the new compatibles used on Meta/Facebook Fuji-data64 board. Signed-off-by: Tao Ren --- Changes in v3: - None (the patch is introduced in v3). Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml index 0c9d6a30dce0..3cc6e62ae5f3 100644 --- a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml +++ b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml @@ -85,6 +85,7 @@ properties: - facebook,cloudripper-bmc - facebook,elbert-bmc - facebook,fuji-bmc + - facebook,fuji-data64-bmc - facebook,greatlakes-bmc - facebook,harma-bmc - facebook,minerva-cmc -- 2.47.3 From rentao.bupt at gmail.com Thu Jul 24 09:30:06 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Wed, 23 Jul 2025 16:30:06 -0700 Subject: [PATCH v3 10/13] ARM: dts: aspeed: Add Facebook Fuji-data64 (AST2600) Board In-Reply-To: <20250723233013.142337-1-rentao.bupt@gmail.com> References: <20250723233013.142337-1-rentao.bupt@gmail.com> Message-ID: <20250723233013.142337-11-rentao.bupt@gmail.com> From: Tao Ren Introduce fuji-data64.dts to extend Meta/Facebook Fuji BMC's data0 partition without breaking the existing users. Fuji-data64.dts is copied from fuji.dts with below changes: - updating model/compatible strings. - updating FMC flash0' data0 partition to 64MB. Signed-off-by: Tao Ren --- Changes in v3: - None (the patch is introduced in v3). arch/arm/boot/dts/aspeed/Makefile | 1 + .../aspeed-bmc-facebook-fuji-data64.dts | 1264 +++++++++++++++++ 2 files changed, 1265 insertions(+) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dts diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile index 55be25acfc80..f6e714b7db2d 100644 --- a/arch/arm/boot/dts/aspeed/Makefile +++ b/arch/arm/boot/dts/aspeed/Makefile @@ -21,6 +21,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ aspeed-bmc-facebook-catalina.dtb \ aspeed-bmc-facebook-cmm.dtb \ aspeed-bmc-facebook-elbert.dtb \ + aspeed-bmc-facebook-fuji-data64.dtb \ aspeed-bmc-facebook-fuji.dtb \ aspeed-bmc-facebook-galaxy100.dtb \ aspeed-bmc-facebook-greatlakes.dtb \ diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dts new file mode 100644 index 000000000000..e915119488ef --- /dev/null +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dts @@ -0,0 +1,1264 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Copyright (c) 2020 Facebook Inc. + +/dts-v1/; + +#include +#include "ast2600-facebook-netbmc-common.dtsi" + +/ { + model = "Facebook Fuji BMC (64MB Datastore)"; + compatible = "facebook,fuji-data64-bmc", "aspeed,ast2600"; + + aliases { + /* + * PCA9548 (2-0070) provides 8 channels connecting to + * SCM (System Controller Module). + */ + i2c16 = &imux16; + i2c17 = &imux17; + i2c18 = &imux18; + i2c19 = &imux19; + i2c20 = &imux20; + i2c21 = &imux21; + i2c22 = &imux22; + i2c23 = &imux23; + + /* + * PCA9548 (8-0070) provides 8 channels connecting to + * SMB (Switch Main Board). + */ + i2c24 = &imux24; + i2c25 = &imux25; + i2c26 = &imux26; + i2c27 = &imux27; + i2c28 = &imux28; + i2c29 = &imux29; + i2c30 = &imux30; + i2c31 = &imux31; + + /* + * PCA9548 (11-0077) provides 8 channels connecting to + * SMB (Switch Main Board). + */ + i2c40 = &imux40; + i2c41 = &imux41; + i2c42 = &imux42; + i2c43 = &imux43; + i2c44 = &imux44; + i2c45 = &imux45; + i2c46 = &imux46; + i2c47 = &imux47; + + /* + * PCA9548 (24-0071) provides 8 channels connecting to + * PDB-Left. + */ + i2c48 = &imux48; + i2c49 = &imux49; + i2c50 = &imux50; + i2c51 = &imux51; + i2c52 = &imux52; + i2c53 = &imux53; + i2c54 = &imux54; + i2c55 = &imux55; + + /* + * PCA9548 (25-0072) provides 8 channels connecting to + * PDB-Right. + */ + i2c56 = &imux56; + i2c57 = &imux57; + i2c58 = &imux58; + i2c59 = &imux59; + i2c60 = &imux60; + i2c61 = &imux61; + i2c62 = &imux62; + i2c63 = &imux63; + + /* + * PCA9548 (26-0076) provides 8 channels connecting to + * FCM1. + */ + i2c64 = &imux64; + i2c65 = &imux65; + i2c66 = &imux66; + i2c67 = &imux67; + i2c68 = &imux68; + i2c69 = &imux69; + i2c70 = &imux70; + i2c71 = &imux71; + + /* + * PCA9548 (27-0076) provides 8 channels connecting to + * FCM2. + */ + i2c72 = &imux72; + i2c73 = &imux73; + i2c74 = &imux74; + i2c75 = &imux75; + i2c76 = &imux76; + i2c77 = &imux77; + i2c78 = &imux78; + i2c79 = &imux79; + + /* + * PCA9548 (40-0076) provides 8 channels connecting to + * PIM1. + */ + i2c80 = &imux80; + i2c81 = &imux81; + i2c82 = &imux82; + i2c83 = &imux83; + i2c84 = &imux84; + i2c85 = &imux85; + i2c86 = &imux86; + i2c87 = &imux87; + + /* + * PCA9548 (41-0076) provides 8 channels connecting to + * PIM2. + */ + i2c88 = &imux88; + i2c89 = &imux89; + i2c90 = &imux90; + i2c91 = &imux91; + i2c92 = &imux92; + i2c93 = &imux93; + i2c94 = &imux94; + i2c95 = &imux95; + + /* + * PCA9548 (42-0076) provides 8 channels connecting to + * PIM3. + */ + i2c96 = &imux96; + i2c97 = &imux97; + i2c98 = &imux98; + i2c99 = &imux99; + i2c100 = &imux100; + i2c101 = &imux101; + i2c102 = &imux102; + i2c103 = &imux103; + + /* + * PCA9548 (43-0076) provides 8 channels connecting to + * PIM4. + */ + i2c104 = &imux104; + i2c105 = &imux105; + i2c106 = &imux106; + i2c107 = &imux107; + i2c108 = &imux108; + i2c109 = &imux109; + i2c110 = &imux110; + i2c111 = &imux111; + + /* + * PCA9548 (44-0076) provides 8 channels connecting to + * PIM5. + */ + i2c112 = &imux112; + i2c113 = &imux113; + i2c114 = &imux114; + i2c115 = &imux115; + i2c116 = &imux116; + i2c117 = &imux117; + i2c118 = &imux118; + i2c119 = &imux119; + + /* + * PCA9548 (45-0076) provides 8 channels connecting to + * PIM6. + */ + i2c120 = &imux120; + i2c121 = &imux121; + i2c122 = &imux122; + i2c123 = &imux123; + i2c124 = &imux124; + i2c125 = &imux125; + i2c126 = &imux126; + i2c127 = &imux127; + + /* + * PCA9548 (46-0076) provides 8 channels connecting to + * PIM7. + */ + i2c128 = &imux128; + i2c129 = &imux129; + i2c130 = &imux130; + i2c131 = &imux131; + i2c132 = &imux132; + i2c133 = &imux133; + i2c134 = &imux134; + i2c135 = &imux135; + + /* + * PCA9548 (47-0076) provides 8 channels connecting to + * PIM8. + */ + i2c136 = &imux136; + i2c137 = &imux137; + i2c138 = &imux138; + i2c139 = &imux139; + i2c140 = &imux140; + i2c141 = &imux141; + i2c142 = &imux142; + i2c143 = &imux143; + }; + + spi_gpio: spi { + num-chipselects = <3>; + cs-gpios = <&gpio0 ASPEED_GPIO(X, 0) GPIO_ACTIVE_LOW>, + <0>, /* device reg=<1> does not exist */ + <&gpio0 ASPEED_GPIO(X, 2) GPIO_ACTIVE_HIGH>; + + eeprom at 2 { + compatible = "atmel,at93c46d"; + spi-max-frequency = <250000>; + data-size = <16>; + spi-cs-high; + reg = <2>; + }; + }; +}; + +&fmc { + flash at 0 { + /delete-node/partitions; +#include "facebook-bmc-flash-layout-128-data64.dtsi" + }; +}; + +&i2c0 { + multi-master; + bus-frequency = <1000000>; +}; + +&i2c2 { + /* + * PCA9548 (2-0070) provides 8 channels connecting to SCM (System + * Controller Module). + */ + i2c-mux at 70 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x70>; + i2c-mux-idle-disconnect; + + imux16: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + adm1278 at 10 { + compatible = "adi,adm1278"; + reg = <0x10>; + shunt-resistor-micro-ohms = <1500>; + }; + }; + + imux17: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux18: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux19: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux20: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux21: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux22: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux23: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; +}; + +&i2c8 { + /* + * PCA9548 (8-0070) provides 8 channels connecting to SMB (Switch + * Main Board). + */ + i2c-mux at 70 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x70>; + i2c-mux-idle-disconnect; + + imux24: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + i2c-mux at 71 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x71>; + i2c-mux-idle-disconnect; + + imux48: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux49: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux50: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + + lp5012 at 14 { + compatible = "ti,lp5012"; + reg = <0x14>; + #address-cells = <1>; + #size-cells = <0>; + + multi-led at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + color = ; + function = LED_FUNCTION_ACTIVITY; + label = "sys"; + + led at 0 { + reg = <0>; + color = ; + }; + + led at 1 { + reg = <1>; + color = ; + }; + + led at 2 { + reg = <2>; + color = ; + }; + }; + + multi-led at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + color = ; + function = LED_FUNCTION_ACTIVITY; + label = "fan"; + + led at 0 { + reg = <0>; + color = ; + }; + + led at 1 { + reg = <1>; + color = ; + }; + + led at 2 { + reg = <2>; + color = ; + }; + }; + + multi-led at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + color = ; + function = LED_FUNCTION_ACTIVITY; + label = "psu"; + + led at 0 { + reg = <0>; + color = ; + }; + + led at 1 { + reg = <1>; + color = ; + }; + + led at 2 { + reg = <2>; + color = ; + }; + }; + + multi-led at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + color = ; + function = LED_FUNCTION_ACTIVITY; + label = "smb"; + + led at 0 { + reg = <0>; + color = ; + }; + + led at 1 { + reg = <1>; + color = ; + }; + + led at 2 { + reg = <2>; + color = ; + }; + }; + }; + }; + + imux51: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux52: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux53: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux54: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux55: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux25: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + i2c-mux at 72 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x72>; + i2c-mux-idle-disconnect; + + imux56: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux57: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux58: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux59: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux60: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux61: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux62: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux63: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux26: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux64: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux65: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux66: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux67: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + + adm1278 at 10 { + compatible = "adi,adm1278"; + reg = <0x10>; + shunt-resistor-micro-ohms = <250>; + }; + }; + + imux68: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux69: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux70: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux71: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux27: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux72: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux73: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux74: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux75: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + + adm1278 at 10 { + compatible = "adi,adm1278"; + reg = <0x10>; + shunt-resistor-micro-ohms = <250>; + }; + }; + + imux76: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux77: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux78: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux79: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux28: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux29: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux30: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux31: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + + }; +}; + +&i2c11 { + status = "okay"; + + /* + * PCA9548 (11-0077) provides 8 channels connecting to SMB (Switch + * Main Board). + */ + i2c-mux at 77 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x77>; + i2c-mux-idle-disconnect; + + imux40: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux80: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux81: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux82: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux83: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux84: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux85: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux86: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux87: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux41: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux88: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux89: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux90: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux91: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux92: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux93: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux94: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux95: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux42: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux96: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux97: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux98: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux99: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux100: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux101: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux102: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux103: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux43: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux104: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux105: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux106: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux107: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux108: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux109: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux110: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux111: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux44: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux112: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux113: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux114: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux115: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux116: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux117: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux118: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux119: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux45: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux120: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux121: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux122: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux123: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux124: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux125: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux126: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux127: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux46: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux128: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux129: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux130: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux131: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux132: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux133: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux134: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux135: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux47: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux136: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux137: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux138: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux139: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux140: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux141: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux142: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux143: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + }; +}; + +&ehci1 { + status = "okay"; +}; + +&mdio1 { + status = "okay"; + + ethphy3: ethernet-phy at 13 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0x0d>; + }; +}; + +&mac3 { + status = "okay"; + phy-mode = "rgmii"; + phy-handle = <ðphy3>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_rgmii4_default>; +}; + +&emmc_controller { + status = "okay"; +}; + +&emmc { + status = "okay"; + + non-removable; + max-frequency = <25000000>; + bus-width = <4>; +}; -- 2.47.3 From rentao.bupt at gmail.com Thu Jul 24 09:30:07 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Wed, 23 Jul 2025 16:30:07 -0700 Subject: [PATCH v3 11/13] ARM: dts: aspeed: facebook-fuji: Include facebook-fuji-data64.dts In-Reply-To: <20250723233013.142337-1-rentao.bupt@gmail.com> References: <20250723233013.142337-1-rentao.bupt@gmail.com> Message-ID: <20250723233013.142337-12-rentao.bupt@gmail.com> From: Tao Ren Include "facebook-fuji-data64.dts" in facebook-fuji dts to avoid duplicated code. Fuji-data64 and Fuji are identical except the BMC flash layout. Signed-off-by: Tao Ren --- Changes in v3: - None (the patch is introduced in v3). .../dts/aspeed/aspeed-bmc-facebook-fuji.dts | 1251 +---------------- 1 file changed, 5 insertions(+), 1246 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts index d0331980d082..5dc2a165e441 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts @@ -1,1257 +1,16 @@ // SPDX-License-Identifier: GPL-2.0+ // Copyright (c) 2020 Facebook Inc. -/dts-v1/; - -#include -#include "ast2600-facebook-netbmc-common.dtsi" +#include "aspeed-bmc-facebook-fuji-data64.dts" / { model = "Facebook Fuji BMC"; compatible = "facebook,fuji-bmc", "aspeed,ast2600"; - - aliases { - /* - * PCA9548 (2-0070) provides 8 channels connecting to - * SCM (System Controller Module). - */ - i2c16 = &imux16; - i2c17 = &imux17; - i2c18 = &imux18; - i2c19 = &imux19; - i2c20 = &imux20; - i2c21 = &imux21; - i2c22 = &imux22; - i2c23 = &imux23; - - /* - * PCA9548 (8-0070) provides 8 channels connecting to - * SMB (Switch Main Board). - */ - i2c24 = &imux24; - i2c25 = &imux25; - i2c26 = &imux26; - i2c27 = &imux27; - i2c28 = &imux28; - i2c29 = &imux29; - i2c30 = &imux30; - i2c31 = &imux31; - - /* - * PCA9548 (11-0077) provides 8 channels connecting to - * SMB (Switch Main Board). - */ - i2c40 = &imux40; - i2c41 = &imux41; - i2c42 = &imux42; - i2c43 = &imux43; - i2c44 = &imux44; - i2c45 = &imux45; - i2c46 = &imux46; - i2c47 = &imux47; - - /* - * PCA9548 (24-0071) provides 8 channels connecting to - * PDB-Left. - */ - i2c48 = &imux48; - i2c49 = &imux49; - i2c50 = &imux50; - i2c51 = &imux51; - i2c52 = &imux52; - i2c53 = &imux53; - i2c54 = &imux54; - i2c55 = &imux55; - - /* - * PCA9548 (25-0072) provides 8 channels connecting to - * PDB-Right. - */ - i2c56 = &imux56; - i2c57 = &imux57; - i2c58 = &imux58; - i2c59 = &imux59; - i2c60 = &imux60; - i2c61 = &imux61; - i2c62 = &imux62; - i2c63 = &imux63; - - /* - * PCA9548 (26-0076) provides 8 channels connecting to - * FCM1. - */ - i2c64 = &imux64; - i2c65 = &imux65; - i2c66 = &imux66; - i2c67 = &imux67; - i2c68 = &imux68; - i2c69 = &imux69; - i2c70 = &imux70; - i2c71 = &imux71; - - /* - * PCA9548 (27-0076) provides 8 channels connecting to - * FCM2. - */ - i2c72 = &imux72; - i2c73 = &imux73; - i2c74 = &imux74; - i2c75 = &imux75; - i2c76 = &imux76; - i2c77 = &imux77; - i2c78 = &imux78; - i2c79 = &imux79; - - /* - * PCA9548 (40-0076) provides 8 channels connecting to - * PIM1. - */ - i2c80 = &imux80; - i2c81 = &imux81; - i2c82 = &imux82; - i2c83 = &imux83; - i2c84 = &imux84; - i2c85 = &imux85; - i2c86 = &imux86; - i2c87 = &imux87; - - /* - * PCA9548 (41-0076) provides 8 channels connecting to - * PIM2. - */ - i2c88 = &imux88; - i2c89 = &imux89; - i2c90 = &imux90; - i2c91 = &imux91; - i2c92 = &imux92; - i2c93 = &imux93; - i2c94 = &imux94; - i2c95 = &imux95; - - /* - * PCA9548 (42-0076) provides 8 channels connecting to - * PIM3. - */ - i2c96 = &imux96; - i2c97 = &imux97; - i2c98 = &imux98; - i2c99 = &imux99; - i2c100 = &imux100; - i2c101 = &imux101; - i2c102 = &imux102; - i2c103 = &imux103; - - /* - * PCA9548 (43-0076) provides 8 channels connecting to - * PIM4. - */ - i2c104 = &imux104; - i2c105 = &imux105; - i2c106 = &imux106; - i2c107 = &imux107; - i2c108 = &imux108; - i2c109 = &imux109; - i2c110 = &imux110; - i2c111 = &imux111; - - /* - * PCA9548 (44-0076) provides 8 channels connecting to - * PIM5. - */ - i2c112 = &imux112; - i2c113 = &imux113; - i2c114 = &imux114; - i2c115 = &imux115; - i2c116 = &imux116; - i2c117 = &imux117; - i2c118 = &imux118; - i2c119 = &imux119; - - /* - * PCA9548 (45-0076) provides 8 channels connecting to - * PIM6. - */ - i2c120 = &imux120; - i2c121 = &imux121; - i2c122 = &imux122; - i2c123 = &imux123; - i2c124 = &imux124; - i2c125 = &imux125; - i2c126 = &imux126; - i2c127 = &imux127; - - /* - * PCA9548 (46-0076) provides 8 channels connecting to - * PIM7. - */ - i2c128 = &imux128; - i2c129 = &imux129; - i2c130 = &imux130; - i2c131 = &imux131; - i2c132 = &imux132; - i2c133 = &imux133; - i2c134 = &imux134; - i2c135 = &imux135; - - /* - * PCA9548 (47-0076) provides 8 channels connecting to - * PIM8. - */ - i2c136 = &imux136; - i2c137 = &imux137; - i2c138 = &imux138; - i2c139 = &imux139; - i2c140 = &imux140; - i2c141 = &imux141; - i2c142 = &imux142; - i2c143 = &imux143; - }; - - spi_gpio: spi { - num-chipselects = <3>; - cs-gpios = <&gpio0 ASPEED_GPIO(X, 0) GPIO_ACTIVE_LOW>, - <0>, /* device reg=<1> does not exist */ - <&gpio0 ASPEED_GPIO(X, 2) GPIO_ACTIVE_HIGH>; - - eeprom at 2 { - compatible = "atmel,at93c46d"; - spi-max-frequency = <250000>; - data-size = <16>; - spi-cs-high; - reg = <2>; - }; - }; -}; - -&i2c0 { - multi-master; - bus-frequency = <1000000>; -}; - -&i2c2 { - /* - * PCA9548 (2-0070) provides 8 channels connecting to SCM (System - * Controller Module). - */ - i2c-mux at 70 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x70>; - i2c-mux-idle-disconnect; - - imux16: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - - adm1278 at 10 { - compatible = "adi,adm1278"; - reg = <0x10>; - shunt-resistor-micro-ohms = <1500>; - }; - }; - - imux17: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux18: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux19: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux20: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux21: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux22: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux23: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; -}; - -&i2c8 { - /* - * PCA9548 (8-0070) provides 8 channels connecting to SMB (Switch - * Main Board). - */ - i2c-mux at 70 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x70>; - i2c-mux-idle-disconnect; - - imux24: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - - i2c-mux at 71 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x71>; - i2c-mux-idle-disconnect; - - imux48: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux49: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux50: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - - lp5012 at 14 { - compatible = "ti,lp5012"; - reg = <0x14>; - #address-cells = <1>; - #size-cells = <0>; - - multi-led at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - color = ; - function = LED_FUNCTION_ACTIVITY; - label = "sys"; - - led at 0 { - reg = <0>; - color = ; - }; - - led at 1 { - reg = <1>; - color = ; - }; - - led at 2 { - reg = <2>; - color = ; - }; - }; - - multi-led at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - color = ; - function = LED_FUNCTION_ACTIVITY; - label = "fan"; - - led at 0 { - reg = <0>; - color = ; - }; - - led at 1 { - reg = <1>; - color = ; - }; - - led at 2 { - reg = <2>; - color = ; - }; - }; - - multi-led at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - color = ; - function = LED_FUNCTION_ACTIVITY; - label = "psu"; - - led at 0 { - reg = <0>; - color = ; - }; - - led at 1 { - reg = <1>; - color = ; - }; - - led at 2 { - reg = <2>; - color = ; - }; - }; - - multi-led at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - color = ; - function = LED_FUNCTION_ACTIVITY; - label = "smb"; - - led at 0 { - reg = <0>; - color = ; - }; - - led at 1 { - reg = <1>; - color = ; - }; - - led at 2 { - reg = <2>; - color = ; - }; - }; - }; - }; - - imux51: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux52: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux53: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux54: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux55: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux25: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - - i2c-mux at 72 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x72>; - i2c-mux-idle-disconnect; - - imux56: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux57: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux58: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux59: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux60: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux61: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux62: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux63: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux26: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux64: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux65: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux66: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux67: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - - adm1278 at 10 { - compatible = "adi,adm1278"; - reg = <0x10>; - shunt-resistor-micro-ohms = <250>; - }; - }; - - imux68: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux69: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux70: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux71: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux27: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux72: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux73: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux74: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux75: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - - adm1278 at 10 { - compatible = "adi,adm1278"; - reg = <0x10>; - shunt-resistor-micro-ohms = <250>; - }; - }; - - imux76: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux77: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux78: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux79: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux28: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux29: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux30: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux31: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - - }; -}; - -&i2c11 { - status = "okay"; - - /* - * PCA9548 (11-0077) provides 8 channels connecting to SMB (Switch - * Main Board). - */ - i2c-mux at 77 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x77>; - i2c-mux-idle-disconnect; - - imux40: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux80: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux81: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux82: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux83: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux84: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux85: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux86: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux87: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux41: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux88: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux89: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux90: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux91: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux92: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux93: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux94: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux95: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux42: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux96: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux97: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux98: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux99: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux100: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux101: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux102: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux103: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux43: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux104: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux105: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux106: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux107: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux108: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux109: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux110: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux111: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux44: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux112: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux113: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux114: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux115: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux116: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux117: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux118: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux119: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux45: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux120: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux121: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux122: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux123: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux124: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux125: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux126: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux127: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux46: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux128: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux129: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux130: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux131: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux132: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux133: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux134: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux135: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux47: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux136: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux137: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux138: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux139: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux140: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux141: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux142: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux143: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - }; }; -&ehci1 { - status = "okay"; -}; - -&mdio1 { - status = "okay"; - - ethphy3: ethernet-phy at 13 { - compatible = "ethernet-phy-ieee802.3-c22"; - reg = <0x0d>; +&fmc { + flash at 0 { + /delete-node/partitions; +#include "facebook-bmc-flash-layout-128.dtsi" }; }; - -&mac3 { - status = "okay"; - phy-mode = "rgmii"; - phy-handle = <ðphy3>; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_rgmii4_default>; -}; - -&emmc_controller { - status = "okay"; -}; - -&emmc { - status = "okay"; - - non-removable; - max-frequency = <25000000>; - bus-width = <4>; -}; -- 2.47.3 From rentao.bupt at gmail.com Thu Jul 24 09:30:08 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Wed, 23 Jul 2025 16:30:08 -0700 Subject: [PATCH v3 12/13] dt-bindings: arm: aspeed: add Facebook Darwin board In-Reply-To: <20250723233013.142337-1-rentao.bupt@gmail.com> References: <20250723233013.142337-1-rentao.bupt@gmail.com> Message-ID: <20250723233013.142337-13-rentao.bupt@gmail.com> From: Tao Ren Document the new compatibles used on Meta/Facebook Darwin board. Signed-off-by: Tao Ren Acked-by: Krzysztof Kozlowski --- Changes in v3: - None. Changes in v2: - None (the patch is introduced in v2). Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml index 3cc6e62ae5f3..2887565d4170 100644 --- a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml +++ b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml @@ -83,6 +83,7 @@ properties: - facebook,bletchley-bmc - facebook,catalina-bmc - facebook,cloudripper-bmc + - facebook,darwin-bmc - facebook,elbert-bmc - facebook,fuji-bmc - facebook,fuji-data64-bmc -- 2.47.3 From rentao.bupt at gmail.com Thu Jul 24 09:30:09 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Wed, 23 Jul 2025 16:30:09 -0700 Subject: [PATCH v3 13/13] ARM: dts: aspeed: Add Facebook Darwin (AST2600) BMC In-Reply-To: <20250723233013.142337-1-rentao.bupt@gmail.com> References: <20250723233013.142337-1-rentao.bupt@gmail.com> Message-ID: <20250723233013.142337-14-rentao.bupt@gmail.com> From: Tao Ren Add initial device tree for the Meta (Facebook) Darwin AST2600 BMC. Darwin is Meta's rack switch platform with an AST2600 BMC integrated for health monitoring purpose. Signed-off-by: Tao Ren --- Changes in v3: - Removed flash layout (use the "default" in common.dtsi). Changes in v2: - Removed mac3 controller. - Fixed DTB warnings. arch/arm/boot/dts/aspeed/Makefile | 1 + .../dts/aspeed/aspeed-bmc-facebook-darwin.dts | 72 +++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile index f6e714b7db2d..dce32ee0ace7 100644 --- a/arch/arm/boot/dts/aspeed/Makefile +++ b/arch/arm/boot/dts/aspeed/Makefile @@ -20,6 +20,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ aspeed-bmc-facebook-bletchley.dtb \ aspeed-bmc-facebook-catalina.dtb \ aspeed-bmc-facebook-cmm.dtb \ + aspeed-bmc-facebook-darwin.dtb \ aspeed-bmc-facebook-elbert.dtb \ aspeed-bmc-facebook-fuji-data64.dtb \ aspeed-bmc-facebook-fuji.dtb \ diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts new file mode 100644 index 000000000000..58c107a1b6cf --- /dev/null +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Copyright (c) 2021 Facebook Inc. + +/dts-v1/; + +#include "ast2600-facebook-netbmc-common.dtsi" + +/ { + model = "Facebook Darwin BMC"; + compatible = "facebook,darwin-bmc", "aspeed,ast2600"; + + aliases { + serial0 = &uart5; + serial1 = &uart1; + serial2 = &uart2; + serial3 = &uart3; + }; + + chosen { + stdout-path = &uart5; + }; + + iio-hwmon { + compatible = "iio-hwmon"; + io-channels = <&adc0 0>, <&adc0 1>, <&adc0 2>, <&adc0 3>, + <&adc0 4>, <&adc0 5>, <&adc0 6>, <&adc0 7>, + <&adc1 0>, <&adc1 1>, <&adc1 2>, <&adc1 3>, + <&adc1 4>, <&adc1 5>, <&adc1 6>, <&adc1 7>; + }; + + spi_gpio: spi { + num-chipselects = <1>; + cs-gpios = <&gpio0 ASPEED_GPIO(X, 0) GPIO_ACTIVE_LOW>; + }; +}; + +&i2c0 { + eeprom at 50 { + compatible = "atmel,24c512"; + reg = <0x50>; + }; +}; + +&adc0 { + status = "okay"; + + pinctrl-0 = <&pinctrl_adc0_default &pinctrl_adc1_default + &pinctrl_adc2_default &pinctrl_adc3_default + &pinctrl_adc4_default &pinctrl_adc5_default + &pinctrl_adc6_default &pinctrl_adc7_default>; +}; + +&adc1 { + status = "okay"; + + pinctrl-0 = <&pinctrl_adc8_default &pinctrl_adc9_default + &pinctrl_adc10_default &pinctrl_adc11_default + &pinctrl_adc12_default &pinctrl_adc13_default + &pinctrl_adc14_default &pinctrl_adc15_default>; +}; + +&emmc_controller { + status = "okay"; +}; + +&emmc { + status = "okay"; + + non-removable; + max-frequency = <25000000>; + bus-width = <4>; +}; -- 2.47.3 From rentao.bupt at gmail.com Thu Jul 24 09:44:18 2025 From: rentao.bupt at gmail.com (Tao Ren) Date: Wed, 23 Jul 2025 16:44:18 -0700 Subject: [PATCH v3 00/13] ARM: dts: aspeed: Add Meta Darwin dts In-Reply-To: <20250723233013.142337-1-rentao.bupt@gmail.com> References: <20250723233013.142337-1-rentao.bupt@gmail.com> Message-ID: On Wed, Jul 23, 2025 at 04:29:56PM -0700, rentao.bupt at gmail.com wrote: > From: Tao Ren > > The patch series introduces the initial device tree for Meta/Facebook > Darwin AST2600 BMC. > > Patches #1, #2 and #3 fixes the DTB warnings in wedge400/fuji dts and > ast2600-facebook-netbmc-common.dtsi. > > Patch #4 moves eMMC entries from ast2600-facebook-netbmc-common.dtsi to > each BMC platform because eMMC was removed from future Meta Network BMC > platforms. > > Patch #5 introduces new BMC flash layout with 64MB data partition. > > Patches #6, #7 and #8 add "wedge400-data64-bmc" board. "wedge400-bmc" > and "wedge400-data64-bmc" are identical except BMC flash layout. > > Patches #9, #10 and #11 add "fuji-data64-bmc" board. "fuji-bmc" and > "fuji-data64-bmc" are identical except BMC flash layout. > > Patches #12 and #13 add Meta Darwin BMC and updates devicetree > bindings. Hi Andrew, Sorry the patch series grow bigger and bigger, and thanks again for the review. Besides, the patch series is applied on top of the latest mainline, and we may need to rebase when v6.17-rc1 is ready. Please let me know if I need to hold my patches till v6.17-rc1. Cheers, - Tao From leo.jt.wang at gmail.com Wed Jul 23 13:42:42 2025 From: leo.jt.wang at gmail.com (Leo Wang) Date: Wed, 23 Jul 2025 11:42:42 +0800 Subject: [PATCH v9 3/3] ARM: dts: aspeed: clemente: add NCSI3 and NCSI4 pinctrl nodes In-Reply-To: <20250723-add-support-for-meta-clemente-bmc-v9-0-b76e7de4d6c8@fii-foxconn.com> References: <20250723-add-support-for-meta-clemente-bmc-v9-0-b76e7de4d6c8@fii-foxconn.com> Message-ID: <20250723-add-support-for-meta-clemente-bmc-v9-3-b76e7de4d6c8@fii-foxconn.com> Add pinctrl nodes for NCSI3 and NCSI4 to the AST2600 pinctrl description, enabling support for RMII3 and RMII4 interfaces. Signed-off-by: Leo Wang --- arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi b/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi index 289668f051eb4271ac48ae3ce9b82587911548ee..e87c4b58994add33938792f732420ade7ea5c23f 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi +++ b/arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi @@ -412,6 +412,16 @@ pinctrl_mdio4_default: mdio4_default { groups = "MDIO4"; }; + pinctrl_ncsi3_default: ncsi3_default { + function = "RMII3"; + groups = "NCSI3"; + }; + + pinctrl_ncsi4_default: ncsi4_default { + function = "RMII4"; + groups = "NCSI4"; + }; + pinctrl_ncts1_default: ncts1_default { function = "NCTS1"; groups = "NCTS1"; -- 2.43.0 From leo.jt.wang at gmail.com Wed Jul 23 13:42:41 2025 From: leo.jt.wang at gmail.com (Leo Wang) Date: Wed, 23 Jul 2025 11:42:41 +0800 Subject: [PATCH v9 2/3] ARM: dts: aspeed: clemente: add Meta Clemente BMC In-Reply-To: <20250723-add-support-for-meta-clemente-bmc-v9-0-b76e7de4d6c8@fii-foxconn.com> References: <20250723-add-support-for-meta-clemente-bmc-v9-0-b76e7de4d6c8@fii-foxconn.com> Message-ID: <20250723-add-support-for-meta-clemente-bmc-v9-2-b76e7de4d6c8@fii-foxconn.com> From: Leo Wang Add linux device tree entry for Meta Clemente compute-tray BMC using AST2600 SoC. Signed-off-by: Leo Wang --- arch/arm/boot/dts/aspeed/Makefile | 1 + .../dts/aspeed/aspeed-bmc-facebook-clemente.dts | 1294 ++++++++++++++++++++ 2 files changed, 1295 insertions(+) diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile index 2e5f4833a073b6c25190fd4b6e89a11f9636fc84..904503f78f960d7bc14cad7cb455bb8bb3138ccd 100644 --- a/arch/arm/boot/dts/aspeed/Makefile +++ b/arch/arm/boot/dts/aspeed/Makefile @@ -19,6 +19,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ aspeed-bmc-delta-ahe50dc.dtb \ aspeed-bmc-facebook-bletchley.dtb \ aspeed-bmc-facebook-catalina.dtb \ + aspeed-bmc-facebook-clemente.dtb \ aspeed-bmc-facebook-cmm.dtb \ aspeed-bmc-facebook-elbert.dtb \ aspeed-bmc-facebook-fuji.dtb \ diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dts new file mode 100644 index 0000000000000000000000000000000000000000..add4b96e8ec7b3c848b1d4e251643c7b11726ba6 --- /dev/null +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dts @@ -0,0 +1,1294 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Copyright (c) 2021 Facebook Inc. +/dts-v1/; + +#include "aspeed-g6.dtsi" +#include +#include +#include +#include +#include + +/ { + model = "Facebook Clemente BMC"; + compatible = "facebook,clemente-bmc", "aspeed,ast2600"; + + aliases { + serial0 = &uart1; + serial2 = &uart3; + serial3 = &uart4; + serial4 = &uart5; + i2c16 = &i2c1mux0ch0; + i2c17 = &i2c1mux0ch1; + i2c18 = &i2c1mux0ch2; + i2c19 = &i2c1mux0ch3; + i2c20 = &i2c1mux0ch4; + i2c21 = &i2c1mux0ch5; + i2c22 = &i2c1mux0ch6; + i2c23 = &i2c1mux0ch7; + i2c24 = &i2c0mux0ch0; + i2c25 = &i2c0mux0ch1; + i2c26 = &i2c0mux0ch2; + i2c27 = &i2c0mux0ch3; + i2c28 = &i2c0mux1ch0; + i2c29 = &i2c0mux1ch1; + i2c30 = &i2c0mux1ch2; + i2c31 = &i2c0mux1ch3; + i2c32 = &i2c0mux2ch0; + i2c33 = &i2c0mux2ch1; + i2c34 = &i2c0mux2ch2; + i2c35 = &i2c0mux2ch3; + i2c36 = &i2c0mux3ch0; + i2c37 = &i2c0mux3ch1; + i2c38 = &i2c0mux3ch2; + i2c39 = &i2c0mux3ch3; + i2c40 = &i2c0mux4ch0; + i2c41 = &i2c0mux4ch1; + i2c42 = &i2c0mux4ch2; + i2c43 = &i2c0mux4ch3; + i2c44 = &i2c0mux5ch0; + i2c45 = &i2c0mux5ch1; + i2c46 = &i2c0mux5ch2; + i2c47 = &i2c0mux5ch3; + i2c48 = &i2c0mux0ch1mux0ch0; + i2c49 = &i2c0mux0ch1mux0ch1; + i2c50 = &i2c0mux0ch1mux0ch2; + i2c51 = &i2c0mux0ch1mux0ch3; + i2c52 = &i2c0mux3ch1mux0ch0; + i2c53 = &i2c0mux3ch1mux0ch1; + i2c54 = &i2c0mux3ch1mux0ch2; + i2c55 = &i2c0mux3ch1mux0ch3; + }; + + chosen { + stdout-path = "serial4:57600n8"; + }; + + memory at 80000000 { + device_type = "memory"; + reg = <0x80000000 0x80000000>; + }; + + iio-hwmon { + compatible = "iio-hwmon"; + io-channels = <&adc0 0>, <&adc0 1>, <&adc0 2>, <&adc0 3>, + <&adc0 4>, <&adc0 5>, <&adc0 6>, <&adc0 7>, + <&adc1 2>; + }; + + spi1_gpio: spi { + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + sck-gpios = <&gpio0 ASPEED_GPIO(Z, 3) GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio0 ASPEED_GPIO(Z, 4) GPIO_ACTIVE_HIGH>; + miso-gpios = <&gpio0 ASPEED_GPIO(Z, 5) GPIO_ACTIVE_HIGH>; + cs-gpios = <&gpio0 ASPEED_GPIO(Z, 0) GPIO_ACTIVE_LOW>; + num-chipselects = <1>; + + tpm at 0 { + compatible = "infineon,slb9670", "tcg,tpm_tis-spi"; + spi-max-frequency = <33000000>; + reg = <0>; + }; + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + label = "bmc_heartbeat_amber"; + gpios = <&gpio0 ASPEED_GPIO(P, 7) GPIO_ACTIVE_LOW>; + linux,default-trigger = "heartbeat"; + }; + + led-1 { + label = "fp_id_amber"; + default-state = "off"; + gpios = <&gpio0 ASPEED_GPIO(B, 5) GPIO_ACTIVE_HIGH>; + }; + + led-2 { + label = "bmc_ready_noled"; + gpios = <&gpio0 ASPEED_GPIO(B, 3) (GPIO_ACTIVE_HIGH|GPIO_TRANSITORY)>; + }; + + led-3 { + label = "bmc_ready_cpld_noled"; + gpios = <&gpio0 ASPEED_GPIO(P, 5) (GPIO_ACTIVE_HIGH|GPIO_TRANSITORY)>; + }; + }; + + p1v8_bmc_aux: regulator-p1v8-bmc-aux { + compatible = "regulator-fixed"; + regulator-name = "p1v8_bmc_aux"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-always-on; + }; + + p2v5_bmc_aux: regulator-p2v5-bmc-aux { + compatible = "regulator-fixed"; + regulator-name = "p2v5_bmc_aux"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + regulator-always-on; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + ramoops at b3e00000 { + compatible = "ramoops"; + reg = <0xbb000000 0x200000>; /* 16 * (4 * 0x8000) */ + record-size = <0x8000>; + console-size = <0x8000>; + ftrace-size = <0x8000>; + pmsg-size = <0x8000>; + max-reason = <3>; + }; + }; + +}; + +&adc0 { + vref-supply = <&p1v8_bmc_aux>; + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_adc0_default &pinctrl_adc1_default + &pinctrl_adc2_default &pinctrl_adc3_default + &pinctrl_adc4_default &pinctrl_adc5_default + &pinctrl_adc6_default &pinctrl_adc7_default>; +}; + +&adc1 { + vref-supply = <&p2v5_bmc_aux>; + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_adc10_default>; +}; + +&ehci0 { + status = "okay"; +}; + +&fmc { + status = "okay"; + flash at 0 { + status = "okay"; + m25p,fast-read; + label = "bmc"; + spi-max-frequency = <50000000>; +#include "openbmc-flash-layout-128.dtsi" + }; + flash at 1 { + status = "okay"; + m25p,fast-read; + label = "alt-bmc"; + spi-max-frequency = <50000000>; + }; +}; + +&gpio0 { + gpio-line-names = + /*A0-A7*/ "","","","","","","","", + /*B0-B7*/ "BATTERY_DETECT","PRSNT1_HPM_SCM_N", + "BMC_I2C1_FPGA_ALERT_L","BMC_READY", + "IOEXP_INT_L","FM_ID_LED", + "","", + /*C0-C7*/ "BMC_GPIOC0","","","", + "PMBUS_REQ_N","PSU_FW_UPDATE_REQ_N", + "","BMC_I2C_SSIF_ALERT_L", + /*D0-D7*/ "","","","","BMC_GPIOD4","","","", + /*E0-E7*/ "BMC_GPIOE0","BMC_GPIOE1","","","","","","", + /*F0-F7*/ "","","","","","","","", + /*G0-G7*/ "","","","","","", + "FM_DEBUG_PORT_PRSNT_N","FM_BMC_DBP_PRESENT_N", + /*H0-H7*/ "PWR_BRAKE_L","RUN_POWER_EN", + "SHDN_FORCE_L","SHDN_REQ_L", + "","","","", + /*I0-I7*/ "","","","", + "","FLASH_WP_STATUS", + "FM_PDB_HEALTH_N","RUN_POWER_PG", + /*J0-J7*/ "","","","","","","","", + /*K0-K7*/ "","","","","","","","", + /*L0-L7*/ "","","","","","","","", + /*M0-M7*/ "PCIE_EP_RST_EN","BMC_FRU_WP", + "SCM_HPM_STBY_RST_N","SCM_HPM_STBY_EN", + "STBY_POWER_PG_3V3","TH500_SHDN_OK_L","","", + /*N0-N7*/ "LED_POSTCODE_0","LED_POSTCODE_1", + "LED_POSTCODE_2","LED_POSTCODE_3", + "LED_POSTCODE_4","LED_POSTCODE_5", + "LED_POSTCODE_6","LED_POSTCODE_7", + /*O0-O7*/ "HMC_I2C3_FPGA_ALERT_L","FPGA_READY_HMC", + "CHASSIS_AC_LOSS_L","BSM_PRSNT_R_N", + "PSU_SMB_ALERT_L","FM_TPM_PRSNT_0_N", + "","USBDBG_IPMI_EN_L", + /*P0-P7*/ "PWR_BTN_BMC_N","IPEX_CABLE_PRSNT_L", + "ID_RST_BTN_BMC_N","RST_BMC_RSTBTN_OUT_N", + "host0-ready","BMC_READY_CPLD","BMC_GPIOP6","BMC_HEARTBEAT_N", + /*Q0-Q7*/ "IRQ_PCH_TPM_SPI_N","USB_OC0_REAR_R_N", + "UART_MUX_SEL","I2C_MUX_RESET_L", + "RSVD_NV_PLT_DETECT","SPI_TPM_INT_L", + "CPU_JTAG_MUX_SELECT","THERM_BB_OVERT_L", + /*R0-R7*/ "THERM_BB_WARN_L","SPI_BMC_FPGA_INT_L", + "CPU_BOOT_DONE","PMBUS_GNT_L", + "CHASSIS_PWR_BRK_L","PCIE_WAKE_L", + "PDB_THERM_OVERT_L","HMC_I2C2_FPGA_ALERT_L", + /*S0-S7*/ "","","SYS_BMC_PWRBTN_R_N","FM_TPM_PRSNT_1_N", + "FM_BMC_DEBUG_SW_N","UID_LED_N", + "SYS_FAULT_LED_N","RUN_POWER_FAULT_L", + /*T0-T7*/ "","","","","","","","", + /*U0-U7*/ "","","","","","","","", + /*V0-V7*/ "L2_RST_REQ_OUT_L","L0L1_RST_REQ_OUT_L", + "BMC_ID_BEEP_SEL","BMC_I2C0_FPGA_ALERT_L", + "SMB_BMC_TMP_ALERT","PWR_LED_N", + "SYS_RST_OUT_L","IRQ_TPM_SPI_N", + /*W0-W7*/ "","","","","","","","", + /*X0-X7*/ "","","","","","","","", + /*Y0-Y7*/ "","RST_BMC_SELF_HW", + "FM_FLASH_LATCH_N","BMC_EMMC_RST_N", + "BMC_GPIOY4","BMC_GPIOY5","","", + /*Z0-Z7*/ "","","","","","","BMC_GPIOZ6","BMC_GPIOZ7"; +}; + +&gpio1 { + gpio-line-names = + /*18A0-18A7*/ "","","","","","","","", + /*18B0-18B3*/ "","","","", + /*18B4-18B7*/ "FM_BOARD_BMC_REV_ID0","FM_BOARD_BMC_REV_ID1","FM_BOARD_BMC_REV_ID2","", + /*18C0-18C7*/ "","","PI_BMC_BIOS_ROM_IRQ0_N","","","","","", + /*18D0-18D7*/ "","","","","","","","", + /*18E0-18E3*/ "","","","AC_PWR_BMC_BTN_N","","","",""; +}; + +&i2c0 { + status = "okay"; + + i2c-mux at 71 { + compatible = "nxp,pca9546"; + reg = <0x71>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + // HDD FRU EEPROM + eeprom at 56 { + compatible = "atmel,24c128"; + reg = <0x56>; + }; + + // E1.S Backplane + i2c0mux0ch1mux0: i2c-mux at 74 { + compatible = "nxp,pca9546"; + reg = <0x74>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux0ch1mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux0ch1mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + i2c0mux0ch1mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux0ch1mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + }; + i2c0mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 72 { + compatible = "nxp,pca9546"; + reg = <0x72>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux1ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux1ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + // IO Mezz 0 IOEXP + io_expander7: gpio at 20 { + compatible = "nxp,pca9535"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "RST_CX7_0", + "RST_CX7_1", + "CX0_SSD0_PRSNT_L", + "CX1_SSD1_PRSNT_L", + "CX_BOOT_CMPLT_CX0", + "CX_BOOT_CMPLT_CX1", + "CX_TWARN_CX0_L", + "CX_TWARN_CX1_L", + "CX_OVT_SHDN_CX0", + "CX_OVT_SHDN_CX1", + "FNP_L_CX0", + "FNP_L_CX1", + "", + "MCU_GPIO", + "MCU_RST_N", + "MCU_RECOVERY_N"; + }; + + // IO Mezz 0 FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + + // OSFP 0 FRU EEPROM + eeprom at 52 { + compatible = "atmel,24c128"; + reg = <0x52>; + }; + }; + i2c0mux1ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux1ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 73 { + compatible = "nxp,pca9546"; + reg = <0x73>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux2ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + // IOB0 NIC0 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + }; + i2c0mux2ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + i2c0mux2ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux2ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + // IOB0 NIC1 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + }; + }; + + i2c-mux at 75 { + compatible = "nxp,pca9546"; + reg = <0x75>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux3ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux3ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + // E1.S Backplane HDD FRU EEPROM + eeprom at 56 { + compatible = "atmel,24c128"; + reg = <0x56>; + }; + + // E1.S Backplane MUX + i2c0mux3ch1mux0: i2c-mux at 74 { + compatible = "nxp,pca9546"; + reg = <0x74>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux3ch1mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux3ch1mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + i2c0mux3ch1mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux3ch1mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + }; + i2c0mux3ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux3ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 76 { + compatible = "nxp,pca9546"; + reg = <0x76>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux4ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + i2c0mux4ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + // IO Mezz 1 IOEXP + io_expander8: gpio at 21 { + compatible = "nxp,pca9535"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "SEC_RST_CX7_0", + "SEC_RST_CX7_1", + "SEC_CX0_SSD0_PRSNT_L", + "SEC_CX1_SSD1_PRSNT_L", + "SEC_CX_BOOT_CMPLT_CX0", + "SEC_CX_BOOT_CMPLT_CX1", + "SEC_CX_TWARN_CX0_L", + "SEC_CX_TWARN_CX1_L", + "SEC_CX_OVT_SHDN_CX0", + "SEC_CX_OVT_SHDN_CX1", + "SEC_FNP_L_CX0", + "SEC_FNP_L_CX1", + "", + "SEC_MCU_GPIO", + "SEC_MCU_RST_N", + "SEC_MCU_RECOVERY_N"; + }; + + // IO Mezz 1 FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + + // OSFP 1 FRU EEPROM + eeprom at 52 { + compatible = "atmel,24c128"; + reg = <0x52>; + }; + }; + i2c0mux4ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux4ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 77 { + compatible = "nxp,pca9546"; + reg = <0x77>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c0mux5ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + // IOB1 NIC0 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + }; + i2c0mux5ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + i2c0mux5ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + i2c0mux5ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + // IOB1 NIC1 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + }; + }; +}; + +&i2c1 { + status = "okay"; + + // PDB + power-monitor at 12 { + compatible = "ti,lm5066i"; + reg = <0x12>; + }; + + // PDB + power-monitor at 14 { + compatible = "ti,lm5066i"; + reg = <0x14>; + }; + + // Module 0 + fanctl0: fan-controller at 20{ + compatible = "maxim,max31790"; + reg = <0x20>; + }; + + // Module 0 + fanctl1: fan-controller at 23{ + compatible = "maxim,max31790"; + reg = <0x23>; + }; + + // Module 1 + fanctl2: fan-controller at 2c{ + compatible = "maxim,max31790"; + reg = <0x2c>; + }; + + // Module 1 + fanctl3: fan-controller at 2f{ + compatible = "maxim,max31790"; + reg = <0x2f>; + }; + + // Module 0 Leak Sensor + adc at 34 { + compatible = "maxim,max1363"; + reg = <0x34>; + #address-cells = <1>; + #size-cells = <0>; + + channel at 0 { + reg = <0>; + ti,gain = <2>; + }; + + channel at 1 { + reg = <1>; + ti,gain = <2>; + }; + + channel at 2 { + reg = <2>; + ti,gain = <2>; + }; + + channel at 3 { + reg = <3>; + ti,gain = <2>; + }; + }; + + // Module 1 Leak Sensor + adc at 35 { + compatible = "maxim,max1363"; + reg = <0x35>; + #address-cells = <1>; + #size-cells = <0>; + + channel at 0 { + reg = <0>; + ti,gain = <2>; + }; + + channel at 1 { + reg = <1>; + ti,gain = <2>; + }; + + channel at 2 { + reg = <2>; + ti,gain = <2>; + }; + + channel at 3 { + reg = <3>; + ti,gain = <2>; + }; + }; + + // PDB TEMP SENSOR + temperature-sensor at 4e { + compatible = "ti,tmp1075"; + reg = <0x4e>; + }; + + // PDB FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c02"; + reg = <0x50>; + }; + + // PDB + vrm at 60 { + compatible = "renesas,raa228004"; + reg = <0x60>; + }; + + // PDB + vrm at 61 { + compatible = "renesas,raa228004"; + reg = <0x61>; + }; + + // Interposer + i2c-mux at 70 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x70>; + i2c-mux-idle-disconnect; + + i2c1mux0ch0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x0>; + }; + i2c1mux0ch1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x1>; + }; + i2c1mux0ch2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x2>; + }; + i2c1mux0ch3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x3>; + }; + i2c1mux0ch4: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x4>; + }; + i2c1mux0ch5: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x5>; + + // Interposer TEMP SENSOR + temperature-sensor at 4f { + compatible = "ti,tmp75"; + reg = <0x4f>; + }; + + // Interposer FRU EEPROM + eeprom at 54 { + compatible = "atmel,24c64"; + reg = <0x54>; + }; + }; + i2c1mux0ch6: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x6>; + + // Interposer IOEXP + io_expander5: gpio at 27 { + compatible = "nxp,pca9554"; + reg = <0x27>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "JTAG_MUX_SEL", + "IOX_BMC_RESET", + "RTC_CLR_L", + "RTC_U77_ALRT_N", + "", + "PSU_ALERT_N", + "", + "RST_P12V_STBY_N"; + }; + }; + i2c1mux0ch7: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0x7>; + + // FIO TEMP SENSOR + temperature-sensor at 4b { + compatible = "ti,tmp75"; + reg = <0x4b>; + }; + + // FIO FRU EEPROM + eeprom at 51 { + compatible = "atmel,24c64"; + reg = <0x51>; + }; + }; + }; +}; + +&i2c2 { + status = "okay"; + // Module 0, Expander @0x20 + io_expander0: gpio at 20 { + compatible = "nxp,pca9555"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "FPGA_THERM_OVERT_L-I", + "FPGA_READY_BMC-I", + "HMC_BMC_DETECT-O", + "HMC_PGOOD-O", + "", + "BMC_STBY_CYCLE-O", + "FPGA_EROT_FATAL_ERROR_L-I", + "WP_HW_EXT_CTRL_L-O", + "EROT_FPGA_RST_L-O", + "FPGA_EROT_RECOVERY_L-O", + "BMC_EROT_FPGA_SPI_MUX_SEL-O", + "USB2_HUB_RST_L-O", + "", + "SGPIO_EN_L-O", + "B2B_IOEXP_INT_L-I", + "I2C_BUS_MUX_RESET_L-O"; + }; + + // Module 1, Expander @0x21 + io_expander1: gpio at 21 { + compatible = "nxp,pca9555"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "SEC_FPGA_THERM_OVERT_L", + "SEC_FPGA_READY_BMC", + "SEC_HMC_BMC_DETECT", + "SEC_HMC_PGOOD", + "", + "SEC_BMC_SELF_POWER_CYCLE", + "SEC_SEC_FPGA_EROT_FATAL_ERROR_L", + "SEC_WP_HW_EXT_CTRL_L", + "SEC_EROT_FPGA_RST_L", + "SEC_FPGA_EROT_RECOVERY_L", + "SEC_BMC_EROT_FPGA_SPI_MUX_SEL", + "SEC_USB2_HUB_RST_L", + "", + "SEC_SGPIO_EN_L", + "SEC_IOB_IOEXP_INT_L", + "SEC_I2C_BUS_MUX_RESET_L"; + }; + + // HMC Expander @0x27 + io_expander2: gpio at 27 { + compatible = "nxp,pca9555"; + reg = <0x27>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "HMC_PRSNT_L-I", + "HMC_READY-I", + "HMC_EROT_FATAL_ERROR_L-I", + "I2C_MUX_SEL-O", + "HMC_EROT_SPI_MUX_SEL-O", + "HMC_EROT_RECOVERY_L-O", + "HMC_EROT_RST_L-O", + "GLOBAL_WP_HMC-O", + "FPGA_RST_L-O", + "USB2_HUB_RST-O", + "CPU_UART_MUX_SEL-O", + "", + "", + "", + "", + ""; + }; + + // Module 0 Aux EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + + // Module 1 Aux EEPROM + eeprom at 51 { + compatible = "atmel,24c64"; + reg = <0x51>; + }; +}; + +&i2c3 { + status = "okay"; +}; + +&i2c4 { + status = "okay"; +}; + +&i2c5 { + status = "okay"; +}; + +&i2c6 { + status = "okay"; + io_expander3: gpio at 21 { + compatible = "nxp,pca9555"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "RTC_MUX_SEL", + "PCI_MUX_SEL", + "TPM_MUX_SEL", + "FAN_MUX-SEL", + "SGMII_MUX_SEL", + "DP_MUX_SEL", + "UPHY3_USB_SEL", + "NCSI_MUX_SEL", + "BMC_PHY_RST", + "RTC_CLR_L", + "BMC_12V_CTRL", + "PS_RUN_IO0_PG", + "", + "", + "", + ""; + }; + + rtc at 6f { + compatible = "nuvoton,nct3018y"; + reg = <0x6f>; + }; +}; + +&i2c7 { + status = "okay"; +}; + +&i2c8 { + status = "okay"; +}; + +&i2c9 { + status = "okay"; + // SCM TEMP SENSOR BOARD + temperature-sensor at 4b { + compatible = "national,lm75b"; + reg = <0x4b>; + }; + + // SCM CPLD IOEXP + io_expander4: gpio at 4f { + compatible = "nxp,pca9555"; + reg = <0x4f>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "stby_power_en_cpld", + "stby_power_gd_cpld", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + ""; + }; + + // SCM FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + + // BSM FRU EEPROM + eeprom at 56 { + compatible = "atmel,24c64"; + reg = <0x56>; + }; +}; + +&i2c10 { + status = "okay"; + multi-master; + mctp-controller; + mctp at 10 { + compatible = "mctp-i2c-controller"; + reg = <(0x10 | I2C_OWN_SLAVE_ADDRESS)>; + }; + + // OCP NIC0 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + + // OCP NIC0 FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; +}; + +&i2c11 { + status = "okay"; + + ssif-bmc at 10 { + compatible = "ssif-bmc"; + reg = <0x10>; + }; +}; + +&i2c12 { + status = "okay"; + multi-master; + + // HPM 1 FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + // CBC 2 FRU + eeprom at 54 { + compatible = "atmel,24c02"; + reg = <0x54>; + }; + // CBC 3 FRU + eeprom at 55 { + compatible = "atmel,24c02"; + reg = <0x55>; + }; +}; + +&i2c13 { + status = "okay"; + multi-master; + + // HPM FRU EEPROM + eeprom at 50 { + compatible = "atmel,24c64"; + reg = <0x50>; + }; + // CBC 0 FRU + eeprom at 54 { + compatible = "atmel,24c02"; + reg = <0x54>; + }; + // CBC 1 FRU + eeprom at 55 { + compatible = "atmel,24c02"; + reg = <0x55>; + }; + // HMC FRU EEPROM + eeprom at 57 { + compatible = "atmel,24c02"; + reg = <0x57>; + }; +}; + +&i2c14 { + status = "okay"; + + // PDB CPLD IOEXP 0x10 + io_expander9: gpio at 10 { + compatible = "nxp,pca9555"; + interrupt-parent = <&gpio0>; + interrupts = ; + reg = <0x10>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "wSequence_Latch_State_N", + "wP12V_N1N2_RUNTIME_FLT_N", + "wP12V_FAN_RUNTIME_FLT_N", + "wP12V_AUX_RUNTIME_FLT_N", + "wHost_PERST_SEQPWR_FLT_N", + "wP12V_N1N2_SEQPWR_FLT_N", + "wP12V_FAN_SEQPWR_FLT_N", + "wP12V_AUX_SEQPWR_FLT_N", + "wP12V_RUNTIME_FLT_NIC1_N", + "wAUX_RUNTIME_FLT_NIC1_N", + "wP12V_SEQPWR_FLT_NIC1_N", + "wAUX_SEQPWR_FLT_NIC1_N", + "wP12V_RUNTIME_FLT_NIC0_N", + "wAUX_RUNTIME_FLT_NIC0_N", + "wP12V_SEQPWR_FLT_NIC0_N", + "wAUX_SEQPWR_FLT_NIC0_N"; + }; + + // PDB CPLD IOEXP 0x11 + io_expander10: gpio at 11 { + compatible = "nxp,pca9555"; + interrupt-parent = <&gpio0>; + interrupts = ; + reg = <0x11>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "FM_P12V_NIC1_FLTB_R_N", + "FM_P3V3_NIC1_FAULT_R_N", + "FM_P12V_NIC0_FLTB_R_N", + "FM_P3V3_NIC0_FAULT_R_N", + "P48V_HS2_FAULT_N_PLD", + "P48V_HS1_FAULT_N_PLD", + "P12V_AUX_FAN_OC_PLD_N", + "P12V_AUX_FAN_FAULT_PLD_N", + "", + "", + "", + "", + "", + "FM_SYS_THROTTLE_N", + "OCP_V3_2_PWRBRK_FROM_HOST_ISO_PLD_N", + "OCP_SFF_PWRBRK_FROM_HOST_ISO_PLD_N"; + }; + + // PDB CPLD IOEXP 0x12 + io_expander11: gpio at 12 { + compatible = "nxp,pca9555"; + interrupt-parent = <&gpio0>; + interrupts = ; + reg = <0x12>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "P12V_AUX_PSU_SMB_ALERT_R_L", + "P12V_SCM_SENSE_ALERT_R_N", + "P12V_AUX_NIC1_SENSE_ALERT_R_N", + "P12V_AUX_NIC0_SENSE_ALERT_R_N", + "NODEB_PSU_SMB_ALERT_R_L", + "NODEA_PSU_SMB_ALERT_R_L", + "P12V_AUX_FAN_ALERT_PLD_N", + "P52V_SENSE_ALERT_PLD_N", + "PRSNT_RJ45_FIO_N_R", + "FM_MAIN_PWREN_RMC_EN_ISO_R", + "CHASSIS3_LEAK_Q_N_PLD", + "CHASSIS2_LEAK_Q_N_PLD", + "CHASSIS1_LEAK_Q_N_PLD", + "CHASSIS0_LEAK_Q_N_PLD", + "", + "SMB_RJ45_FIO_TMP_ALERT"; + }; + + // PDB CPLD IOEXP 0x13 + io_expander12: gpio at 13 { + compatible = "nxp,pca9555"; + interrupt-parent = <&gpio0>; + interrupts = ; + reg = <0x13>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "FAN_7_PRESENT_N", + "FAN_6_PRESENT_N", + "FAN_5_PRESENT_N", + "FAN_4_PRESENT_N", + "FAN_3_PRESENT_N", + "FAN_2_PRESENT_N", + "FAN_1_PRESENT_N", + "FAN_0_PRESENT_N", + "HP_LVC3_OCP_V3_2_PRSNT2_PLD_N", + "HP_LVC3_OCP_V3_1_PRSNT2_PLD_N", + "PRSNT_HDDBD_POWER_CABLE_N", + "PRSNT_OSFP0_POWER_CABLE_N", + "PRSNT_CHASSIS3_LEAK_CABLE_R_N", + "PRSNT_CHASSIS2_LEAK_CABLE_R_N", + "PRSNT_CHASSIS1_LEAK_CABLE_R_N", + "PRSNT_CHASSIS0_LEAK_CABLE_R_N"; + }; + + // PDB CPLD IOEXP 0x14 + io_expander13: gpio at 14 { + compatible = "nxp,pca9555"; + reg = <0x14>; + gpio-controller; + #gpio-cells = <2>; + gpio-line-names = + "rmc_en_dc_pwr_on", + "", + "", + "", + "", + "", + "", + "", + "leak_config_0", + "leak_config_1", + "leak_config_2", + "leak_config_3", + "mfg_led_test_mode_l", + "small_leak_err_inj", + "large_leak_err_inj", + ""; + }; +}; + +&i2c15 { + status = "okay"; + multi-master; + mctp-controller; + mctp at 10 { + compatible = "mctp-i2c-controller"; + reg = <(0x10 | I2C_OWN_SLAVE_ADDRESS)>; + }; + + // OCP NIC1 TEMP + temperature-sensor at 1f { + compatible = "ti,tmp421"; + reg = <0x1f>; + }; + + // OCP NIC1 FRU EEPROM + eeprom at 52 { + compatible = "atmel,24c64"; + reg = <0x52>; + }; +}; + +&mac2 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ncsi3_default>; + use-ncsi; +}; + +&mac3 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ncsi4_default>; + use-ncsi; +}; + +&udma { + status = "okay"; +}; + +&uart1 { + status = "okay"; +}; + +&uart3 { + status = "okay"; +}; + +&uart4 { + status = "okay"; +}; + +&uart5 { + status = "okay"; +}; + +&wdt1 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_wdtrst1_default>; + aspeed,reset-type = "soc"; + aspeed,external-signal; + aspeed,ext-push-pull; + aspeed,ext-active-high; + aspeed,ext-pulse-duration = <256>; +}; + -- 2.43.0 From leo.jt.wang at gmail.com Wed Jul 23 13:42:40 2025 From: leo.jt.wang at gmail.com (Leo Wang) Date: Wed, 23 Jul 2025 11:42:40 +0800 Subject: [PATCH v9 1/3] dt-bindings: arm: aspeed: add Meta Clemente board In-Reply-To: <20250723-add-support-for-meta-clemente-bmc-v9-0-b76e7de4d6c8@fii-foxconn.com> References: <20250723-add-support-for-meta-clemente-bmc-v9-0-b76e7de4d6c8@fii-foxconn.com> Message-ID: <20250723-add-support-for-meta-clemente-bmc-v9-1-b76e7de4d6c8@fii-foxconn.com> From: Leo Wang Document the new compatibles used on Meta Clemente. Acked-by: Conor Dooley Signed-off-by: Leo Wang --- Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml index 01333ac111fbb076582a6c0e801903c3500b459f..ff3fea63cecd99ec2dc56d3cf71403f897681a98 100644 --- a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml +++ b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml @@ -81,6 +81,7 @@ properties: - asus,x4tf-bmc - facebook,bletchley-bmc - facebook,catalina-bmc + - facebook,clemente-bmc - facebook,cloudripper-bmc - facebook,elbert-bmc - facebook,fuji-bmc -- 2.43.0 From leo.jt.wang at gmail.com Wed Jul 23 13:42:39 2025 From: leo.jt.wang at gmail.com (Leo Wang) Date: Wed, 23 Jul 2025 11:42:39 +0800 Subject: [PATCH v9 0/3] ARM: dts: Add support for Meta Clemente BMC Message-ID: <20250723-add-support-for-meta-clemente-bmc-v9-0-b76e7de4d6c8@fii-foxconn.com> This series adds initial support for the Meta Clemente BMC based on the ASPEED AST2600 SoC. Patch 1 documents the compatible string. Patch 2 adds the device tree for the board. Signed-off-by: Leo Wang --- Changes in v9: - Fix comment alignment for // PDB TEMP SENSOR. - Drop non-standard aspeed,enable-byte property from i2c11 node. - Move NCSI3 and NCSI4 pinctrl nodes into a separate patch as requested. - Link to v8: https://lore.kernel.org/r/20250717-add-support-for-meta-clemente-bmc-v8-0-2ff6afb36b0e at fii-foxconn.com Changes in v8: - Relocate IOBx_NICx_TEMP TMP421 sensors - Enable byte mode for i2c11 - Link to v7: https://lore.kernel.org/r/20250716-add-support-for-meta-clemente-bmc-v7-0-d5bb7459c5aa at fii-foxconn.com Changes in v7: - Relocate CBC FRU EEPROMs from i2c13 to i2c12. - Link to v6: https://lore.kernel.org/r/20250708-add-support-for-meta-clemente-bmc-v6-0-7f3e57bd0336 at fii-foxconn.com Changes in v6: - Correct Author email to match Signed-off-by email address. - Link to v5: https://lore.kernel.org/r/20250627-add-support-for-meta-clemente-bmc-v5-0-038ed6f1cb9f at fii-foxconn.com Changes in v5: - Remove accidentally pasted texts. - Link to v4: https://lore.kernel.org/r/20250627-add-support-for-meta-clemente-bmc-v4-0-ce7ff23460c4 at fii-foxconn.com Changes in v4: - Move properties of nodes defined in the same file from label ref back to where they belong. - Move pinctrl default configs for ncsi3 and ncsi4 to aspeed-g6-pinctrl.dtsi. - Add properties to i2c10 and i2c15 to enable MCTP. - Link to v3: https://lore.kernel.org/r/20250623-add-support-for-meta-clemente-bmc-v3-0-c223ffcf46cf at fii-foxconn.com Changes in v3: - Modify leakage sensor to reflect current design. - Link to v2: https://lore.kernel.org/r/20250621-add-support-for-meta-clemente-bmc-v2-0-6c5ef059149c at fii-foxconn.com Changes in v2: - Fix patch 1/2 subject line to match dt-bindings convention. - Reorder device tree nodes in patch 2/2 to follow upstream DTS style. - Link to v1: https://lore.kernel.org/r/20250618-add-support-for-meta-clemente-bmc-v1-0-e5ca669ee47b at fii-foxconn.com --- Leo Wang (3): dt-bindings: arm: aspeed: add Meta Clemente board ARM: dts: aspeed: clemente: add Meta Clemente BMC ARM: dts: aspeed: clemente: add NCSI3 and NCSI4 pinctrl nodes .../devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + arch/arm/boot/dts/aspeed/Makefile | 1 + .../dts/aspeed/aspeed-bmc-facebook-clemente.dts | 1294 ++++++++++++++++++++ arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi | 10 + 4 files changed, 1306 insertions(+) --- base-commit: 52da431bf03b5506203bca27fe14a97895c80faf change-id: 20250618-add-support-for-meta-clemente-bmc-941a469bc523 Best regards, -- Leo Wang From donalds at nvidia.com Wed Jul 23 11:42:39 2025 From: donalds at nvidia.com (Donald Shannon) Date: Tue, 22 Jul 2025 18:42:39 -0700 Subject: [PATCH v6 2/2] ARM: dts: aspeed: Add NVIDIA GB200 UT3.0b board In-Reply-To: <20250723014239.22667-1-donalds@nvidia.com> References: <20250723014239.22667-1-donalds@nvidia.com> Message-ID: <20250723014239.22667-3-donalds@nvidia.com> This is an Aspeed AST2600 based unit testing platform for GB200. UT3.0b is different than nvidia-gb200nvl-bmc due to networking topology differences, additional gpio expanders, and voltage regulator gating some devices. Reference to Ast2600 SOC [1]. Reference to Blackwell GB200NVL Platform [2]. Link: https://www.aspeedtech.com/server_ast2600/ [1] Link: https://nvdam.widen.net/s/wwnsxrhm2w/blackwell-datasheet-3384703 [2] Signed-off-by: Donald Shannon --- Changes v1 -> v2: - Changed phy-mode to rgmii-id [Lunn] - Removed redundant max-speed for mac0 [Lunn] - Fixed typo from gb200nvl to gb200 in Makefile Changes v2 -> v3: - Fixed whitespace issues [Krzysztof] - Fixed schema validation issues from my end ( there are still issues with the aspeed dtsi file that are not related to this new dts) [Herring] - Reordered to follow style guide [Krzysztof] - Removed redundant status okays - Changed vcc to vdd for the power gating on the gpio expanders Changes v3 -> v4: - Added changelog [Krzysztof] - Added nvidia,gb200-ut30b board binding [Krzysztof] - Removed unused imports - Reordered a couple other style guide violations - Added back in a couple needed "status okay"s Changes v4 -> v5: - Resumed my patch after a pause - Don't plan to make this include of nvidia-gb200nvl-bmc due to some platform differences - Fixed io expanders that weren't gated by the 3.3V standby regulator - Fixed incorrect interrupt pin for one IO expander - Removed some IO expanders and I2C busses Changes v5 -> v6: - Fixed subject line - Added missing gpio-key compatible type to buttons --- arch/arm/boot/dts/aspeed/Makefile | 1 + .../aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts | 1028 +++++++++++++++++ 2 files changed, 1029 insertions(+) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile index aba7451ab749..37edc4625a9f 100644 --- a/arch/arm/boot/dts/aspeed/Makefile +++ b/arch/arm/boot/dts/aspeed/Makefile @@ -51,6 +51,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ aspeed-bmc-lenovo-hr630.dtb \ aspeed-bmc-lenovo-hr855xg2.dtb \ aspeed-bmc-microsoft-olympus.dtb \ + aspeed-bmc-nvidia-gb200-ut30b.dtb \ aspeed-bmc-nvidia-gb200nvl-bmc.dtb \ aspeed-bmc-opp-lanyang.dtb \ aspeed-bmc-opp-mowgli.dtb \ diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts new file mode 100644 index 000000000000..e0714ad796df --- /dev/null +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts @@ -0,0 +1,1028 @@ +// SPDX-License-Identifier: GPL-2.0+ +/dts-v1/; + +#include "aspeed-g6.dtsi" +#include + +/ { + model = "AST2600 GB200 UT3.0b BMC"; + compatible = "nvidia,gb200-ut30b", "aspeed,ast2600"; + + aliases { + serial2 = &uart3; + serial4 = &uart5; + i2c16 = &imux16; + i2c17 = &imux17; + i2c18 = &imux18; + i2c19 = &imux19; + i2c20 = &imux20; + i2c21 = &imux21; + i2c22 = &imux22; + i2c23 = &imux23; + i2c24 = &imux24; + i2c25 = &imux25; + i2c26 = &imux26; + i2c27 = &imux27; + i2c28 = &imux28; + i2c29 = &imux29; + i2c30 = &imux30; + i2c31 = &imux31; + i2c32 = &imux32; + i2c33 = &imux33; + i2c34 = &imux34; + i2c35 = &imux35; + i2c36 = &imux36; + i2c37 = &imux37; + i2c38 = &imux38; + i2c39 = &imux39; + i2c40 = &e1si2c0; + i2c41 = &e1si2c1; + i2c42 = &e1si2c2; + i2c43 = &e1si2c3; + i2c48 = &i2c17mux0; + i2c49 = &i2c17mux1; + i2c50 = &i2c17mux2; + i2c51 = &i2c17mux3; + i2c52 = &i2c25mux0; + i2c53 = &i2c25mux1; + i2c54 = &i2c25mux2; + i2c55 = &i2c25mux3; + i2c56 = &i2c29mux0; + i2c57 = &i2c29mux1; + i2c58 = &i2c29mux2; + i2c59 = &i2c29mux3; + }; + + buttons { + compatible = "gpio-keys"; + button-power { + label = "power-btn"; + gpio = <&sgpiom0 156 GPIO_ACTIVE_LOW>; + }; + button-uid { + label = "uid-btn"; + gpio = <&sgpiom0 154 GPIO_ACTIVE_LOW>; + }; + }; + + chosen { + stdout-path = &uart5; + }; + + leds { + compatible = "gpio-leds"; + led-0 { + label = "uid_led"; + gpios = <&sgpiom0 27 GPIO_ACTIVE_LOW>; + }; + led-1 { + label = "fault_led"; + gpios = <&sgpiom0 29 GPIO_ACTIVE_LOW>; + }; + led-2 { + label = "power_led"; + gpios = <&sgpiom0 31 GPIO_ACTIVE_LOW>; + }; + }; + + memory at 80000000 { + device_type = "memory"; + reg = <0x80000000 0x80000000>; + }; + + reg_3v3_stby: regulator-3v3-standby { + compatible = "regulator-fixed"; + regulator-name = "3v3-standby"; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + gpio = <&gpio0 ASPEED_GPIO(M, 3) GPIO_ACTIVE_HIGH>; + enable-active-high; + regulator-always-on; + }; + + reserved-memory { + #address-cells = <1>; + #size-cells = <1>; + ranges; + + vga_memory: framebuffer at 9f000000 { + no-map; + reg = <0x9f000000 0x01000000>; /* 16M */ + }; + + ramoops at a0000000 { + compatible = "ramoops"; + reg = <0xa0000000 0x100000>; /* 1MB */ + record-size = <0x10000>; /* 64KB */ + max-reason = <2>; /* KMSG_DUMP_OOPS */ + }; + + gfx_memory: framebuffer { + compatible = "shared-dma-pool"; + reusable; + size = <0x01000000>; + alignment = <0x01000000>; + }; + + video_engine_memory: jpegbuffer { + compatible = "shared-dma-pool"; + reusable; + size = <0x02000000>; /* 32M */ + alignment = <0x01000000>; + }; + }; +}; + +// Enable Primary flash on FMC for bring up activity +&fmc { + status = "okay"; + flash at 0 { + compatible = "jedec,spi-nor"; + label = "bmc"; + spi-max-frequency = <50000000>; + status = "okay"; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + u-boot at 0 { + // 896KB + reg = <0x0 0xe0000>; + label = "u-boot"; + }; + + kernel at 100000 { + // 9MB + reg = <0x100000 0x900000>; + label = "kernel"; + }; + + rofs at a00000 { + // 55292KB (extends to end of 64MB SPI - 4KB) + reg = <0xa00000 0x35FF000>; + label = "rofs"; + }; + }; + }; +}; + +&spi2 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_spi2_default>; + status = "okay"; + // Data SPI is 64MB in size + flash at 0 { + label = "config"; + spi-max-frequency = <50000000>; + status = "okay"; + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + u-boot-env at 0 { + // 256KB + reg = <0x0 0x40000>; + label = "u-boot-env"; + }; + + rwfs at 40000 { + // 16MB + reg = <0x40000 0x1000000>; + label = "rwfs"; + }; + + log at 1040000 { + // 40MB + reg = <0x1040000 0x2800000>; + label = "log"; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; + ethphy0: ethernet-phy at 0 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + }; +}; + +&mac0 { + pinctrl-names = "default"; + phy-mode = "rgmii-id"; + phy-handle = <ðphy0>; + pinctrl-0 = <&pinctrl_rgmii1_default>; + status = "okay"; +}; + +// USB Port B Controller +&ehci1 { + status = "okay"; +}; + +// USB Port B Controller +&uhci { + status = "okay"; +}; + +// USB port A vhub +&vhub { + status = "okay"; +}; + +&rng { + status = "okay"; +}; + +&video { + memory-region = <&video_engine_memory>; + status = "okay"; +}; + +&gpio0 { + gpio-line-names = + /*A0-A7*/ "", "", "", "", "", "", "", "", + /*B0-B7*/ "", "", "", "", "", "", "", "", + /*C0-C7*/ "SGPIO_I2C_MUX_SEL-O", "", "", "", "", "", "", "", + /*D0-D7*/ "", "", "", "UART1_MUX_SEL-O", "", "FPGA_PEX_RST_L-O", "", "", + /*E0-E7*/ "RTL8221_PHY_RST_L-O", "RTL8211_PHY_INT_L-I", "", "UART3_MUX_SEL-O", + "", "", "", "SGPIO_BMC_EN-O", + /*F0-F7*/ "", "", "", "", "", "", "", "", + /*G0-G7*/ "", "", "", "", "", "", "", "", + /*H0-H7*/ "", "", "", "", "", "", "", "", + /*I0-I7*/ "", "", "", "", "", "QSPI2_RST_L-O", "GLOBAL_WP_BMC-O", "BMC_DDR4_TEN-O", + /*J0-J7*/ "", "", "", "", "", "", "", "", + /*K0-K7*/ "", "", "", "", "", "", "", "", + /*L0-L7*/ "", "", "", "", "", "", "", "", + /*M0-M7*/ "PCIE_EP_RST_EN-O", "BMC_FRU_WP-O", "FPGA_RST_L-O", "STBY_POWER_EN-O", + "STBY_POWER_PG-I", "PCIE_EP_RST_L-O", "", "", + /*N0-N7*/ "", "", "", "", "", "", "", "", + /*O0-O7*/ "", "", "", "", "", "", "", "", + /*P0-P7*/ "", "", "", "", "", "", "", "", + /*Q0-Q7*/ "", "", "", "", "", "", "", "", + /*R0-R7*/ "", "", "", "", "", "", "", "", + /*S0-S7*/ "", "", "", "", "", "", "", "", + /*T0-T7*/ "", "", "", "", "", "", "", "", + /*U0-U7*/ "", "", "", "", "", "", "", "", + /*V0-V7*/ "AP_EROT_REQ-O", "EROT_AP_GNT-I", "", "","PCB_TEMP_ALERT-I", "","", "", + /*W0-W7*/ "", "", "", "", "", "", "", "", + /*X0-X7*/ "", "", "TPM_MUX_SEL-O", "", "", "", "", "", + /*Y0-Y7*/ "", "", "", "EMMC_RST-O", "","", "", "", + /*Z0-Z7*/ "BMC_READY-O","", "", "", "", "", "", ""; +}; + +&gpio1 { + /* 36 1.8V GPIOs */ + gpio-line-names = + /*A0-A7*/ "", "", "", "", "", "", "", "", + /*B0-B7*/ "", "", "", "", "", "", "IO_EXPANDER_INT_L-I","", + /*C0-C7*/ "", "", "", "", "", "", "", "", + /*D0-D7*/ "", "", "", "", "", "", "SPI_HOST_TPM_RST_L-O", "SPI_BMC_FPGA_INT_L-I", + /*E0-E7*/ "", "", "", "", "", "", "", ""; +}; + +&sgpiom0 { + ngpios = <128>; + status = "okay"; + gpio-line-names = + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "RUN_POWER_FAULT_L-I","SYS_RST_IN_L-O", + "RUN_POWER_PG-I","PWR_BRAKE_L-O", + "SYS_RST_OUT_L-I","RUN_POWER_EN-O", + "L0L1_RST_REQ_OUT_L-I","SHDN_FORCE_L-O", + "L2_RST_REQ_OUT_L-I","SHDN_REQ_L-O", + "SHDN_OK_L-I","UID_LED_N-O", + "BMC_I2C1_FPGA_ALERT_L-I","SYS_FAULT_LED_N-O", + "BMC_I2C0_FPGA_ALERT_L-I","PWR_LED_N-O", + "FPGA_RSVD_FFU3-I","", + "FPGA_RSVD_FFU2-I","", + "FPGA_RSVD_FFU1-I","", + "FPGA_RSVD_FFU0-I","BMC_I2C_SSIF_ALERT_L-O", + "CPU_BOOT_DONE-I","JTAG_MUX_SELECT-O", + "SPI_BMC_FPGA_INT_L-I","RTC_CLR_L-O", + "THERM_BB_WARN_L-I","UART_MUX_SEL-O", + "THERM_BB_OVERT_L-I","", + "CPU0_UPHY3_PRSNT1_L-I","IOBRD0_RUN_POWER_EN-O", + "CPU0_UPHY3_PRSNT0_L-I","IOBRD1_RUN_POWER_EN-O", + "CPU0_UPHY2_PRSNT1_L-I","FPGA_RSVD_FFU4-O", + "CPU0_UPHY2_PRSNT0_L-I","FPGA_RSVD_FFU5-O", + "CPU0_UPHY1_PRSNT1_L-I","FPGA_RSVD_FFU6-O", + "CPU0_UPHY1_PRSNT0_L-I","FPGA_RSVD_FFU7-O", + "CPU0_UPHY0_PRSNT1_L-I","RSVD_NV_PLT_DETECT-O", + "CPU0_UPHY0_PRSNT0_L-I","SPI1_INT_L-O", + "CPU1_UPHY3_PRSNT1_L-I","", + "CPU1_UPHY3_PRSNT0_L-I","HMC_EROT_MUX_STATUS", + "CPU1_UPHY2_PRSNT1_L-I","", + "CPU1_UPHY2_PRSNT0_L-I","", + "CPU1_UPHY1_PRSNT1_L-I","", + "CPU1_UPHY1_PRSNT0_L-I","", + "CPU1_UPHY0_PRSNT1_L-I","", + "CPU1_UPHY0_PRSNT0_L-I","", + "FAN1_PRESENT_L-I","", + "FAN0_PRESENT_L-I","", + "","", + "IPEX_CABLE_PRSNT_L-I","", + "M2_1_PRSNT_L-I","", + "M2_0_PRSNT_L-I","", + "CPU1_UPHY4_PRSNT1_L-I","", + "CPU0_UPHY4_PRSNT0_L-I","", + "","", + "I2C_RTC_ALERT_L-I","", + "FAN7_PRESENT_L-I","", + "FAN6_PRESENT_L-I","", + "FAN5_PRESENT_L-I","", + "FAN4_PRESENT_L-I","", + "FAN3_PRESENT_L-I","", + "FAN2_PRESENT_L-I","", + "IOBRD0_IOX_INT_L-I","", + "IOBRD1_PRSNT_L-I","", + "IOBRD0_PRSNT_L-I","", + "IOBRD1_PWR_GOOD-I","", + "IOBRD0_PWR_GOOD-I","", + "","", + "","", + "FAN_FAIL_IN_L-I","", + "","", + "","", + "","", + "PDB_CABLE_PRESENT_L-I","", + "","", + "CHASSIS_PWR_BRK_L-I","", + "","", + "IOBRD1_IOX_INT_L-I","", + "10GBE_SMBALRT_L-I","", + "PCIE_WAKE_L-I","", + "I2C_M21_ALERT_L-I","", + "I2C_M20_ALERT_L-I","", + "TRAY_FAST_SHDN_L-I","", + "UID_BTN_N-I","", + "PWR_BTN_L-I","", + "PSU_SMB_ALERT_L-I","", + "","", + "","", + "NODE_LOC_ID[0]-I","", + "NODE_LOC_ID[1]-I","", + "NODE_LOC_ID[2]-I","", + "NODE_LOC_ID[3]-I","", + "NODE_LOC_ID[4]-I","", + "NODE_LOC_ID[5]-I","", + "FAN10_PRESENT_L-I","", + "FAN9_PRESENT_L-I","", + "FAN8_PRESENT_L-I","", + "FPGA1_READY_HMC-I","", + "DP_HPD-I","", + "HMC_I2C3_FPGA_ALERT_L-I","", + "HMC_I2C2_FPGA_ALERT_L-I","", + "FPGA0_READY_HMC-I","", + "","", + "","", + "","", + "","", + "LEAK_DETECT_ALERT_L-I","", + "MOD1_B2B_CABLE_PRESENT_L-I","", + "MOD1_CLINK_CABLE_PRESENT_L-I","", + "FAN11_PRESENT_L-I","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "","", + "RSVD_SGPIO_IN_CRC[0]","RSVD_SGPIO_O_CRC[7]", + "RSVD_SGPIO_IN_CRC[1]","RSVD_SGPIO_O_CRC[6]", + "RSVD_SGPIO_IN_CRC[2]","RSVD_SGPIO_O_CRC[5]", + "RSVD_SGPIO_IN_CRC[3]","RSVD_SGPIO_O_CRC[4]", + "RSVD_SGPIO_IN_CRC[4]","RSVD_SGPIO_O_CRC[3]", + "RSVD_SGPIO_IN_CRC[5]","RSVD_SGPIO_O_CRC[2]", + "RSVD_SGPIO_IN_CRC[6]","RSVD_SGPIO_O_CRC[1]", + "RSVD_SGPIO_IN_CRC[7]","RSVD_SGPIO_O_CRC[0]"; +}; + +&uart1 { + status = "okay"; +}; + +// Enabling SOL +&uart3 { + status = "okay"; +}; + +// BMC Debug Console +&uart5 { + status = "okay"; +}; + +&uart_routing { }; + +// I2C1, SSIF IPMI interface +&i2c0 { + clock-frequency = <400000>; + status = "okay"; + ssif-bmc at 10 { + compatible = "ssif-bmc"; + reg = <0x10>; + }; +}; + +// I2C3 +// BMC_I2C0_FPGA - Primary FPGA +&i2c2 { + clock-frequency = <400000>; + multi-master; + status = "okay"; +}; + +// I2C5 +// RTC Driver +// IO Expander +&i2c4 { + clock-frequency = <400000>; + status = "okay"; + // Module 0, Expander @0x21 + exp4: gpio at 21 { + compatible = "nxp,pca9555"; + reg = <0x21>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio1>; + interrupts = ; + vcc-supply = <®_3v3_stby>; + gpio-line-names = + "RTC_MUX_SEL-O", + "PCI_MUX_SEL-O", + "TPM_MUX_SEL-O", + "FAN_MUX-SEL-O", + "SGMII_MUX_SEL-O", + "DP_MUX_SEL-O", + "UPHY3_USB_SEL-O", + "NCSI_MUX_SEL-O", + "BMC_PHY_RST-O", + "RTC_CLR_L-O", + "BMC_12V_CTRL-O", + "PS_RUN_IO0_PG-I", + "", + "", + "", + ""; + }; +}; + +// I2C6 +// Module 0/1 I2C MUX x3 +&i2c5 { + clock-frequency = <400000>; + multi-master; + status = "okay"; + + i2c-mux at 71 { + compatible = "nxp,pca9546"; + reg = <0x71>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + imux16: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux17: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + i2c-mux at 74 { + compatible = "nxp,pca9546"; + reg = <0x74>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + i2c17mux0: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + i2c17mux1: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + i2c17mux2: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + i2c17mux3: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + }; + + imux18: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux19: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + }; + + i2c-mux at 72 { + compatible = "nxp,pca9546"; + reg = <0x72>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + imux20: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux21: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + gpio at 20 { + compatible = "nxp,pca9555"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + vcc-supply = <®_3v3_stby>; + gpio-line-names = + "RST_CX_0_L-O", + "RST_CX_1_L-O", + "CX0_SSD0_PRSNT_L-I", + "CX1_SSD1_PRSNT_L-I", + "CX_BOOT_CMPLT_CX0-I", + "CX_BOOT_CMPLT_CX1-I", + "CX_TWARN_CX0_L-I", + "CX_TWARN_CX1_L-I", + "CX_OVT_SHDN_CX0-I", + "CX_OVT_SHDN_CX1-I", + "FNP_L_CX0-O", + "FNP_L_CX1-O", + "", + "MCU_GPIO-I", + "MCU_RST_N-O", + "MCU_RECOVERY_N-O"; + }; + }; + + imux22: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux23: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + + i2c-mux at 73 { + compatible = "nxp,pca9546"; + reg = <0x73>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + imux24: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux25: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + i2c-mux at 70 { + compatible = "nxp,pca9546"; + reg = <0x70>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + i2c25mux0: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c25mux1: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c25mux2: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c25mux3: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + }; + + imux26: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux27: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + + i2c-mux at 75 { + compatible = "nxp,pca9546"; + reg = <0x75>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + imux28: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux29: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + i2c-mux at 74 { + compatible = "nxp,pca9546"; + reg = <0x74>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + i2c29mux0: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c29mux1: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c29mux2: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + i2c29mux3: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + }; + + imux30: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux31: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + + i2c-mux at 76 { + compatible = "nxp,pca9546"; + reg = <0x76>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + imux32: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux33: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux34: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux35: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + + i2c-mux at 77 { + compatible = "nxp,pca9546"; + reg = <0x77>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + imux36: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux37: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux38: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + imux39: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; +}; + +// I2C7 +// Module 0/1 Leak Sensors +// Module 0/1 Fan Controllers +&i2c6 { + clock-frequency = <400000>; + status = "okay"; + + pmic at 12 { + compatible = "ti,lm5066i"; + reg = <0x12>; + shunt-resistor-micro-ohms = <190>; + }; + + pmic at 14 { + compatible = "ti,lm5066i"; + reg = <0x14>; + shunt-resistor-micro-ohms = <190>; + }; + + pwm at 20 { + compatible = "maxim,max31790"; + reg = <0x20>; + }; + + pwm at 23 { + compatible = "maxim,max31790"; + reg = <0x23>; + }; + + pwm at 2c { + compatible = "maxim,max31790"; + reg = <0x2c>; + }; + + pwm at 2f { + compatible = "maxim,max31790"; + reg = <0x2f>; + }; +}; + +// I2C9 +// M.2 +&i2c8 { + clock-frequency = <400000>; + multi-master; + status = "okay"; +}; + +// I2C10 +// Module 0/1 IO Expanders +&i2c9 { + clock-frequency = <400000>; + status = "okay"; + + // Module 0, Expander @0x20 + exp0: gpio at 20 { + compatible = "nxp,pca9555"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio1>; + interrupts = ; + vcc-supply = <®_3v3_stby>; + gpio-line-names = + "FPGA_THERM_OVERT_L-I", + "FPGA_READY_BMC-I", + "HMC_BMC_DETECT-O", + "HMC_PGOOD-O", + "", + "BMC_STBY_CYCLE-O", + "FPGA_EROT_FATAL_ERROR_L-I", + "WP_HW_EXT_CTRL_L-O", + "EROT_FPGA_RST_L-O", + "FPGA_EROT_RECOVERY_L-O", + "BMC_EROT_FPGA_SPI_MUX_SEL-O", + "USB_HUB_RESET_L-O", + "NCSI_CS1_SEL-O", + "SGPIO_EN_L-O", + "B2B_IOEXP_INT_L-I", + "I2C_BUS_MUX_RESET_L-O"; + }; + + // UT3.0b Expander @0x22 + exp2: gpio at 22 { + compatible = "nxp,pca9555"; + reg = <0x22>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio1>; + interrupts = ; + vcc-supply = <®_3v3_stby>; + gpio-line-names = + "BMC1_FANCTRL_FAIL_L-I", + "IOEXP_BMC_RST_12V-O", + "NODE_RST_STBY_H-O", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + ""; + }; + + // UT3.0b Expander @0x23 + exp3: gpio at 23 { + compatible = "nxp,pca9555"; + reg = <0x23>; + gpio-controller; + #gpio-cells = <2>; + interrupt-controller; + #interrupt-cells = <2>; + interrupt-parent = <&gpio1>; + interrupts = ; + vcc-supply = <®_3v3_stby>; + gpio-line-names = + "PEXSW_FL_SPI_MUX_SEL-O", + "PEX_SW_FATAL_ERROR_3V3_L-I", + "IOEXP_PDB_NODE_EN_L-O", + "NODE_PWOK_ISO-I", + "BMC_FAN_PWR_EN-O", + "BMC_ETHERNET_INT-I", + "BMC_ENET_RST-O", + "IOEXP_BMC_RST_SENSE-O", + "BMC_ID-I", + "TPM_MUX_3V3_SEL_N-O", + "IOEXP_TPM_RST_N-O", + "TPM_DOWN_SPI_INT_L-I", + "PS_BRD_PGOOD-I", + "FP_BUTTON_POWER_N-I", + "FP_BUTTON_RESET_N-I", + "FP_LED_POWER_GPIOEXP_N-O"; + }; +}; + +// I2C11 +// BMC FRU EEPROM +// BMC Temp Sensor +&i2c10 { + clock-frequency = <400000>; + status = "okay"; + + // BMC FRU EEPROM - 256 bytes + eeprom at 50 { + compatible = "atmel,24c02"; + reg = <0x50>; + pagesize = <8>; + }; +}; + +// I2C12 +&i2c11 { + clock-frequency = <400000>; + status = "okay"; +}; + +// I2C15 +// Module 1 UPHY3 SMBus +&i2c14 { + clock-frequency = <100000>; + multi-master; + status = "okay"; + + //E1.S drive slot 0-3 + i2c-mux at 77 { + compatible = "nxp,pca9546"; + reg = <0x77>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + vdd-supply = <®_3v3_stby>; + + e1si2c0: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + + e1si2c1: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + }; + + e1si2c2: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + + e1si2c3: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; +}; -- 2.43.0 From donalds at nvidia.com Wed Jul 23 11:42:37 2025 From: donalds at nvidia.com (Donald Shannon) Date: Tue, 22 Jul 2025 18:42:37 -0700 Subject: [PATCH v6 0/2] Adding device tree and binding for NVIDIA GB200-UT3.0b Message-ID: <20250723014239.22667-1-donalds@nvidia.com> Patch 1 adds the binding for the NVIDIA GB200-UT3.0b platform. Patch 2 adds the device tree for the NVIDIA GB200-UT3.0b platform. This is an Aspeed AST2600 based unit testing platform for GB200. UT3.0b is different than nvidia-gb200nvl-bmc due to networking topology differences, additional gpio expanders, and voltage regulator gating some devices. Reference to Ast2600 SOC [1]. Reference to Blackwell GB200NVL Platform [2]. Link: https://www.aspeedtech.com/server_ast2600/ [1] Link: https://nvdam.widen.net/s/wwnsxrhm2w/blackwell-datasheet-3384703 [2] Signed-off-by: Donald Shannon --- Changes v1 -> v2: - Changed phy-mode to rgmii-id [Lunn] - Removed redundant max-speed for mac0 [Lunn] - Fixed typo from gb200nvl to gb200 in Makefile Changes v2 -> v3: - Fixed whitespace issues [Krzysztof] - Fixed schema validation issues from my end ( there are still issues with the aspeed dtsi file that are not related to this new dts) [Herring] - Reordered to follow style guide [Krzysztof] - Removed redundant status okays - Changed vcc to vdd for the power gating on the gpio expanders Changes v3 -> v4: - Added changelog [Krzysztof] - Added nvidia,gb200-ut30b board binding [Krzysztof] - Removed unused imports - Reordered a couple other style guide violations - Added back in a couple needed "status okay"s Changes v4 -> v5: - Resumed my patch after a pause - Don't plan to make this include of nvidia-gb200nvl-bmc due to some platform differences - Fixed io expanders that weren't gated by the 3.3V standby regulator - Fixed incorrect interrupt pin for one IO expander - Removed some IO expanders and I2C busses Changes v5 -> v6: - Fixed subject line - Added missing gpio-key compatible type to buttons --- Donald Shannon (2): dt-bindings: arm: aspeed: Add NVIDIA GB200-UT3.0b board ARM: dts: aspeed: Add NVIDIA GB200 UT3.0b board .../bindings/arm/aspeed/aspeed.yaml | 1 + arch/arm/boot/dts/aspeed/Makefile | 1 + .../aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts | 1028 +++++++++++++++++ 3 files changed, 1030 insertions(+) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts base-commit: 05adbee3ad528100ab0285c15c91100e19e10138 -- 2.43.0 From donalds at nvidia.com Wed Jul 23 11:42:38 2025 From: donalds at nvidia.com (Donald Shannon) Date: Tue, 22 Jul 2025 18:42:38 -0700 Subject: [PATCH v6 1/2] dt-bindings: arm: aspeed: Add NVIDIA GB200-UT3.0b board In-Reply-To: <20250723014239.22667-1-donalds@nvidia.com> References: <20250723014239.22667-1-donalds@nvidia.com> Message-ID: <20250723014239.22667-2-donalds@nvidia.com> This is an Aspeed AST2600 based unit testing platform for GB200. UT3.0b is different than nvidia-gb200nvl-bmc due to networking topology differences, additional gpio expanders, and voltage regulator gating some devices. Reference to Ast2600 SOC [1]. Reference to Blackwell GB200NVL Platform [2]. Link: https://www.aspeedtech.com/server_ast2600/ [1] Link: https://nvdam.widen.net/s/wwnsxrhm2w/blackwell-datasheet-3384703 [2] Signed-off-by: Donald Shannon Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml index 456dbf7b5ec8..624581db2330 100644 --- a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml +++ b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml @@ -99,6 +99,7 @@ properties: - inventec,starscream-bmc - inventec,transformer-bmc - jabil,rbp-bmc + - nvidia,gb200-ut30b - nvidia,gb200nvl-bmc - qcom,dc-scm-v1-bmc - quanta,s6q-bmc -- 2.43.0 From andrew at lunn.ch Thu Jul 24 10:03:20 2025 From: andrew at lunn.ch (Andrew Lunn) Date: Thu, 24 Jul 2025 02:03:20 +0200 Subject: [PATCH v3 10/13] ARM: dts: aspeed: Add Facebook Fuji-data64 (AST2600) Board In-Reply-To: <20250723233013.142337-11-rentao.bupt@gmail.com> References: <20250723233013.142337-1-rentao.bupt@gmail.com> <20250723233013.142337-11-rentao.bupt@gmail.com> Message-ID: > +&mac3 { > + status = "okay"; > + phy-mode = "rgmii"; Does the PCB have extra long clock lines to implement the 2ns delay? Andrew From rentao.bupt at gmail.com Thu Jul 24 11:03:49 2025 From: rentao.bupt at gmail.com (Tao Ren) Date: Wed, 23 Jul 2025 18:03:49 -0700 Subject: [PATCH v3 10/13] ARM: dts: aspeed: Add Facebook Fuji-data64 (AST2600) Board In-Reply-To: References: <20250723233013.142337-1-rentao.bupt@gmail.com> <20250723233013.142337-11-rentao.bupt@gmail.com> Message-ID: On Thu, Jul 24, 2025 at 02:03:20AM +0200, Andrew Lunn wrote: > > +&mac3 { > > + status = "okay"; > > + phy-mode = "rgmii"; > > Does the PCB have extra long clock lines to implement the 2ns delay? > > Andrew Hi Andrew, Thank you for catching it. I didn't notice the settings because the file is copied from the exiting fuji.dts with minor changes. The delay is currently introduced on MAC side (by manually setting SCU registers), but I guess I can update phy-mode to "rgmii-id" so the delay can be handled by the PHY? Thanks, Tao From ryan_chen at aspeedtech.com Thu Jul 24 12:19:14 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Thu, 24 Jul 2025 02:19:14 +0000 Subject: [PATCH v3 2/2] irqchip: aspeed: add debugfs support and AST2700 INTC0/INTC1 routing/protection display In-Reply-To: <87wm7yrep5.ffs@tglx> References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> <20250722095156.1672873-3-ryan_chen@aspeedtech.com> <8734aotfdq.ffs@tglx> <87wm7yrep5.ffs@tglx> Message-ID: > Subject: RE: [PATCH v3 2/2] irqchip: aspeed: add debugfs support and AST2700 > INTC0/INTC1 routing/protection display > > On Wed, Jul 23 2025 at 06:02, Ryan Chen wrote: > >> > +struct aspeed_intc { > >> > + void __iomem *base; > >> > + struct device *dev; > >> > + struct dentry *dbg_root; > >> > + int (*show_routing)(struct seq_file *s, void *unused); > >> > + int (*show_prot)(struct seq_file *s, void *unused); }; > >> > >> See the chapter about struct declarations and initializers in the > >> documentation I linked to above. > > > > Sorry, I don't see the struct "> > + int (*show_prot)(struct seq_file *s, void > *unused); };" > > I fatfingered that, but that's not the problem. > > > My original submit is following, it should ok. Am I right? > > No. Read the chapter I pointed you to. > > > https://www.spinics.net/lists/kernel/msg5776957.html Thanks, I think your point is align the struct member names. Will update. struct aspeed_intc { void __iomem *base; struct device *dev; struct dentry *dbg_root; int (*show_routing)(struct seq_file *s, void *unused); int (*show_prot)(struct seq_file *s, void *unused); }; > > I have replied to this very mail. No need to paste me this and the pointer to > some random mail archive > From krzk at kernel.org Thu Jul 24 17:15:08 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Thu, 24 Jul 2025 09:15:08 +0200 Subject: [PATCH v6 1/2] dt-bindings: arm: aspeed: Add NVIDIA GB200-UT3.0b board In-Reply-To: <24ce8704-1f9c-437e-ae72-1c6c3c672c2b@nvidia.com> References: <20250723014239.22667-1-donalds@nvidia.com> <20250723014239.22667-2-donalds@nvidia.com> <24ce8704-1f9c-437e-ae72-1c6c3c672c2b@nvidia.com> Message-ID: On 23/07/2025 23:58, Donald Shannon wrote: > On 7/22/25 22:56, Krzysztof Kozlowski wrote: >> External email: Use caution opening links or attachments >> >> >> On 23/07/2025 03:42, Donald Shannon wrote: >>> This is an Aspeed AST2600 based unit testing platform for GB200. >>> UT3.0b is different than nvidia-gb200nvl-bmc due to networking topology >>> differences, additional gpio expanders, and voltage regulator gating >>> some devices. >>> >>> Reference to Ast2600 SOC [1]. >>> Reference to Blackwell GB200NVL Platform [2]. >>> >>> Link: https://www.aspeedtech.com/server_ast2600/ [1] >>> Link: https://nvdam.widen.net/s/wwnsxrhm2w/blackwell-datasheet-3384703 [2] >>> Signed-off-by: Donald Shannon >>> Acked-by: Krzysztof Kozlowski >> Why are you faking tags? No, you cannot just add whatever you want. >> >> Best regards, >> Krzysztof > > Hi Krzysztof, > > I think?I was confused by your message on my V5 patch. I will remove the Acked-by and resubmit: > >> A nit, subject: drop second/last, redundant "binding". The >> "dt-bindings" prefix is already stating that these are bindings. >> See also: >> https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18 >> >> With above two: >> >> Acked-by: Krzysztof Kozlowski And what did you paste in your patch? And why? Best regards, Krzysztof From krzk at kernel.org Thu Jul 24 17:54:10 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Thu, 24 Jul 2025 09:54:10 +0200 Subject: [PATCH v7 0/2] Adding device tree and binding for NVIDIA GB200-UT3.0b In-Reply-To: <20250723222350.200094-1-donalds@nvidia.com> References: <20250723222350.200094-1-donalds@nvidia.com> Message-ID: <20250724-affable-gorgeous-dragon-130ac6@kuoka> On Wed, Jul 23, 2025 at 03:23:48PM -0700, Donald Shannon wrote: > Patch 1 adds the binding for the NVIDIA GB200-UT3.0b platform. > Patch 2 adds the device tree for the NVIDIA GB200-UT3.0b platform. > > This is an Aspeed AST2600 based unit testing platform for GB200. > UT3.0b is different than nvidia-gb200nvl-bmc due to networking topology > differences, additional gpio expanders, and voltage regulator gating > some devices. > > Reference to Ast2600 SOC [1]. > Reference to Blackwell GB200NVL Platform [2]. > > Link: https://www.aspeedtech.com/server_ast2600/ [1] > Link: https://nvdam.widen.net/s/wwnsxrhm2w/blackwell-datasheet-3384703 [2] > Signed-off-by: Donald Shannon > --- > Changes v1 -> v2: > - Changed phy-mode to rgmii-id [Lunn] > - Removed redundant max-speed for mac0 [Lunn] > - Fixed typo from gb200nvl to gb200 in Makefile > Changes v2 -> v3: > - Fixed whitespace issues [Krzysztof] > - Fixed schema validation issues from my end ( there are still issues > with the aspeed dtsi file that are not related to this new dts) > [Herring] > - Reordered to follow style guide [Krzysztof] > - Removed redundant status okays > - Changed vcc to vdd for the power gating on the gpio expanders > Changes v3 -> v4: > - Added changelog [Krzysztof] > - Added nvidia,gb200-ut30b board binding [Krzysztof] > - Removed unused imports > - Reordered a couple other style guide violations > - Added back in a couple needed "status okay"s > Changes v4 -> v5: > - Resumed my patch after a pause > - Don't plan to make this include of nvidia-gb200nvl-bmc due to some > platform differences > - Fixed io expanders that weren't gated by the 3.3V standby regulator > - Fixed incorrect interrupt pin for one IO expander > - Removed some IO expanders and I2C busses > Changes v5 -> v6: > - Fixed subject line > - Added missing gpio-key compatible type to buttons > Changes v6 -> v7: > - Removed Acked-by Krzysztof Why? You did not even give me chance to respond to your reply. Best regards, Krzysztof From krzk at kernel.org Thu Jul 24 17:54:24 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Thu, 24 Jul 2025 09:54:24 +0200 Subject: [PATCH v7 1/2] dt-bindings: arm: aspeed: Add NVIDIA GB200-UT3.0b board In-Reply-To: <20250723222350.200094-2-donalds@nvidia.com> References: <20250723222350.200094-1-donalds@nvidia.com> <20250723222350.200094-2-donalds@nvidia.com> Message-ID: <20250724-sweet-radiant-stoat-10d86d@kuoka> On Wed, Jul 23, 2025 at 03:23:49PM -0700, Donald Shannon wrote: > This is an Aspeed AST2600 based unit testing platform for GB200. > UT3.0b is different than nvidia-gb200nvl-bmc due to networking topology > differences, additional gpio expanders, and voltage regulator gating > some devices. > > Reference to Ast2600 SOC [1]. > Reference to Blackwell GB200NVL Platform [2]. > > Link: https://www.aspeedtech.com/server_ast2600/ [1] > Link: https://nvdam.widen.net/s/wwnsxrhm2w/blackwell-datasheet-3384703 [2] > Signed-off-by: Donald Shannon > --- > Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + > 1 file changed, 1 insertion(+) > This is a friendly reminder during the review process. It looks like you received a tag and forgot to add it. If you do not know the process, here is a short explanation: Please add Acked-by/Reviewed-by/Tested-by tags when posting new versions of patchset, under or above your Signed-off-by tag, unless patch changed significantly (e.g. new properties added to the DT bindings). Tag is "received", when provided in a message replied to you on the mailing list. Tools like b4 can help here. However, there's no need to repost patches *only* to add the tags. The upstream maintainer will do that for tags received on the version they apply. Please read: https://elixir.bootlin.com/linux/v6.12-rc3/source/Documentation/process/submitting-patches.rst#L577 If a tag was not added on purpose, please state why and what changed. > diff --git a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml > index 456dbf7b5ec8..624581db2330 100644 > --- a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml > +++ b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml > @@ -99,6 +99,7 @@ properties: > - inventec,starscream-bmc > - inventec,transformer-bmc > - jabil,rbp-bmc > + - nvidia,gb200-ut30b > - nvidia,gb200nvl-bmc > - qcom,dc-scm-v1-bmc > - quanta,s6q-bmc > -- > 2.43.0 > From krzk at kernel.org Thu Jul 24 18:05:40 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Thu, 24 Jul 2025 10:05:40 +0200 Subject: [PATCH v3 07/13] ARM: dts: aspeed: Add Facebook Wedge400-data64 (AST2500) BMC In-Reply-To: <20250723233013.142337-8-rentao.bupt@gmail.com> References: <20250723233013.142337-1-rentao.bupt@gmail.com> <20250723233013.142337-8-rentao.bupt@gmail.com> Message-ID: <20250724-overjoyed-panther-from-camelot-f2ff4f@kuoka> On Wed, Jul 23, 2025 at 04:30:03PM -0700, rentao.bupt at gmail.com wrote: > + /* > + * PCA9548 (11-0076) provides 8 channels connecting to > + * FCM (Fan Controller Module). > + */ > + i2c32 = &imux32; > + i2c33 = &imux33; > + i2c34 = &imux34; > + i2c35 = &imux35; > + i2c36 = &imux36; > + i2c37 = &imux37; > + i2c38 = &imux38; > + i2c39 = &imux39; > + > + spi2 = &spi_gpio; > + }; > + > + chosen { > + stdout-path = &uart1; > + bootargs = "console=ttyS0,9600n8 root=/dev/ram rw"; Drop bootargs. You are duplicating stdout path and choice of root is definitely not a mainline user friendly. Best regards, Krzysztof From krzk at kernel.org Thu Jul 24 20:03:19 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Thu, 24 Jul 2025 12:03:19 +0200 Subject: [PATCH v3 06/13] dt-bindings: arm: aspeed: add Facebook Wedge400-data64 board In-Reply-To: <20250723233013.142337-7-rentao.bupt@gmail.com> References: <20250723233013.142337-1-rentao.bupt@gmail.com> <20250723233013.142337-7-rentao.bupt@gmail.com> Message-ID: <83f69759-da06-4a20-8185-3f24f2ac5794@kernel.org> On 24/07/2025 01:30, rentao.bupt at gmail.com wrote: > From: Tao Ren > > Document the new compatibles used on Meta/Facebook Wedge400-data64 > board. > > Signed-off-by: Tao Ren Acked-by: Krzysztof Kozlowski Best regards, Krzysztof From andrew at lunn.ch Thu Jul 24 22:53:39 2025 From: andrew at lunn.ch (Andrew Lunn) Date: Thu, 24 Jul 2025 14:53:39 +0200 Subject: [PATCH v3 10/13] ARM: dts: aspeed: Add Facebook Fuji-data64 (AST2600) Board In-Reply-To: References: <20250723233013.142337-1-rentao.bupt@gmail.com> <20250723233013.142337-11-rentao.bupt@gmail.com> Message-ID: <769d6817-ee97-4a23-b013-29bc875a00cb@lunn.ch> On Wed, Jul 23, 2025 at 06:03:49PM -0700, Tao Ren wrote: > On Thu, Jul 24, 2025 at 02:03:20AM +0200, Andrew Lunn wrote: > > > +&mac3 { > > > + status = "okay"; > > > + phy-mode = "rgmii"; > > > > Does the PCB have extra long clock lines to implement the 2ns delay? > > > > Andrew > > Hi Andrew, > > Thank you for catching it. I didn't notice the settings because the file > is copied from the exiting fuji.dts with minor changes. > > The delay is currently introduced on MAC side (by manually setting SCU > registers), but I guess I can update phy-mode to "rgmii-id" so the delay > can be handled by the PHY? That would be good, if it works. The problem with the current code is that those SCU registers are not set as part of the MAC driver, so it is hard to know what value they have. Andrew From robh at kernel.org Fri Jul 25 13:19:24 2025 From: robh at kernel.org (Rob Herring (Arm)) Date: Thu, 24 Jul 2025 22:19:24 -0500 Subject: [PATCH v7 0/2] Adding device tree and binding for NVIDIA GB200-UT3.0b In-Reply-To: <20250723222350.200094-1-donalds@nvidia.com> References: <20250723222350.200094-1-donalds@nvidia.com> Message-ID: <175341328135.3754696.5873094296930738476.robh@kernel.org> On Wed, 23 Jul 2025 15:23:48 -0700, Donald Shannon wrote: > Patch 1 adds the binding for the NVIDIA GB200-UT3.0b platform. > Patch 2 adds the device tree for the NVIDIA GB200-UT3.0b platform. > > This is an Aspeed AST2600 based unit testing platform for GB200. > UT3.0b is different than nvidia-gb200nvl-bmc due to networking topology > differences, additional gpio expanders, and voltage regulator gating > some devices. > > Reference to Ast2600 SOC [1]. > Reference to Blackwell GB200NVL Platform [2]. > > Link: https://www.aspeedtech.com/server_ast2600/ [1] > Link: https://nvdam.widen.net/s/wwnsxrhm2w/blackwell-datasheet-3384703 [2] > Signed-off-by: Donald Shannon > --- > Changes v1 -> v2: > - Changed phy-mode to rgmii-id [Lunn] > - Removed redundant max-speed for mac0 [Lunn] > - Fixed typo from gb200nvl to gb200 in Makefile > Changes v2 -> v3: > - Fixed whitespace issues [Krzysztof] > - Fixed schema validation issues from my end ( there are still issues > with the aspeed dtsi file that are not related to this new dts) > [Herring] > - Reordered to follow style guide [Krzysztof] > - Removed redundant status okays > - Changed vcc to vdd for the power gating on the gpio expanders > Changes v3 -> v4: > - Added changelog [Krzysztof] > - Added nvidia,gb200-ut30b board binding [Krzysztof] > - Removed unused imports > - Reordered a couple other style guide violations > - Added back in a couple needed "status okay"s > Changes v4 -> v5: > - Resumed my patch after a pause > - Don't plan to make this include of nvidia-gb200nvl-bmc due to some > platform differences > - Fixed io expanders that weren't gated by the 3.3V standby regulator > - Fixed incorrect interrupt pin for one IO expander > - Removed some IO expanders and I2C busses > Changes v5 -> v6: > - Fixed subject line > - Added missing gpio-key compatible type to buttons > Changes v6 -> v7: > - Removed Acked-by Krzysztof > --- > > Donald Shannon (2): > dt-bindings: arm: aspeed: Add NVIDIA GB200-UT3.0b board > ARM: dts: aspeed: Add NVIDIA GB200 UT3.0b board > > .../bindings/arm/aspeed/aspeed.yaml | 1 + > arch/arm/boot/dts/aspeed/Makefile | 1 + > .../aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts | 1028 +++++++++++++++++ > 3 files changed, 1030 insertions(+) > create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts > > > base-commit: 05adbee3ad528100ab0285c15c91100e19e10138 > -- > 2.43.0 > > > My bot found new DTB warnings on the .dts files added or changed in this series. Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments. If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date: pip3 install dtschema --upgrade This patch series was applied (using b4) to base: Base: using specified base-commit 05adbee3ad528100ab0285c15c91100e19e10138 If this is not the correct base, please add 'base-commit' tag (or use b4 which does this automatically) New warnings running 'make CHECK_DTBS=y for arch/arm/boot/dts/aspeed/' for 20250723222350.200094-1-donalds at nvidia.com: arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: timer (arm,armv7-timer): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/timer/arm,arch_timer.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /sdram at 1e6e0000: failed to match any schema with compatible: ['aspeed,ast2600-sdram-edac', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: bus at 1e600000 (aspeed,ast2600-ahbc): compatible: ['aspeed,ast2600-ahbc', 'syscon'] is too long from schema $id: http://devicetree.org/schemas/bus/aspeed,ast2600-ahbc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: syscon at 1e6e2000 (aspeed,ast2600-scu): 'smp-memram at 180' does not match any of the regexes: '^interrupt-controller@[0-9a-f]+$', '^p2a-control@[0-9a-f]+$', '^pinctrl(@[0-9a-f]+)?$', '^pinctrl-[0-9]+$', '^silicon-id@[0-9a-f]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed,ast2x00-scu.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/syscon at 1e6e2000/smp-memram at 180: failed to match any schema with compatible: ['aspeed,ast2600-smpmem'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/display at 1e6e6000: failed to match any schema with compatible: ['aspeed,ast2600-gfx', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: adc at 1e6e9000 (aspeed,ast2600-adc0): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: adc at 1e6e9100 (aspeed,ast2600-adc1): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: crypto at 1e6fa000 (aspeed,ast2600-acry): 'aspeed,ahbc' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/crypto/aspeed,ast2600-acry.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): reg-io-width: 4 is not of type 'object' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): lpc-snoop at 80: 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: kcs at 24 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: kcs at 28 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: kcs at 2c (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: kcs at 114 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/lpc at 1e789000/lhc at a0: failed to match any schema with compatible: ['aspeed,ast2600-lhc'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/lpc at 1e789000/ibt at 140: failed to match any schema with compatible: ['aspeed,ast2600-ibt-bmc'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740100:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740200:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740100: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740200: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: fsi at 1e79b000 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/fsi at 1e79b000: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: fsi at 1e79b100 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/fsi at 1e79b100: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/dma-controller at 1e79e000: failed to match any schema with compatible: ['aspeed,ast2600-udma'] arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-power: 'anyOf' conditional failed, one must be fixed: arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-power: 'oneOf' conditional failed, one must be fixed: 'interrupts' is a required property 'interrupts-extended' is a required property 'gpios' is a required property from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-power: 'linux,code' is a required property from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-power: Unevaluated properties are not allowed ('gpio' was unexpected) from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-uid: 'anyOf' conditional failed, one must be fixed: arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-uid: 'oneOf' conditional failed, one must be fixed: 'interrupts' is a required property 'interrupts-extended' is a required property 'gpios' is a required property from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-uid: 'linux,code' is a required property from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-uid: Unevaluated properties are not allowed ('gpio' was unexpected) from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml# From robh at kernel.org Fri Jul 25 13:19:27 2025 From: robh at kernel.org (Rob Herring (Arm)) Date: Thu, 24 Jul 2025 22:19:27 -0500 Subject: [PATCH v3 00/13] ARM: dts: aspeed: Add Meta Darwin dts In-Reply-To: <20250723233013.142337-1-rentao.bupt@gmail.com> References: <20250723233013.142337-1-rentao.bupt@gmail.com> Message-ID: <175341328259.3754758.1853821981943315378.robh@kernel.org> On Wed, 23 Jul 2025 16:29:56 -0700, rentao.bupt at gmail.com wrote: > From: Tao Ren > > The patch series introduces the initial device tree for Meta/Facebook > Darwin AST2600 BMC. > > Patches #1, #2 and #3 fixes the DTB warnings in wedge400/fuji dts and > ast2600-facebook-netbmc-common.dtsi. > > Patch #4 moves eMMC entries from ast2600-facebook-netbmc-common.dtsi to > each BMC platform because eMMC was removed from future Meta Network BMC > platforms. > > Patch #5 introduces new BMC flash layout with 64MB data partition. > > Patches #6, #7 and #8 add "wedge400-data64-bmc" board. "wedge400-bmc" > and "wedge400-data64-bmc" are identical except BMC flash layout. > > Patches #9, #10 and #11 add "fuji-data64-bmc" board. "fuji-bmc" and > "fuji-data64-bmc" are identical except BMC flash layout. > > Patches #12 and #13 add Meta Darwin BMC and updates devicetree > bindings. > > Tao Ren (13): > ARM: dts: aspeed: wedge400: Fix DTB warnings > ARM: dts: aspeed: fuji: Fix DTB warnings > ARM: dts: aspeed: Fix DTB warnings in > ast2600-facebook-netbmc-common.dtsi > ARM: dts: aspeed: Move eMMC out of ast2600-facebook-netbmc-common.dtsi > ARM: dts: aspeed: Add facebook-bmc-flash-layout-128-data64.dtsi > dt-bindings: arm: aspeed: add Facebook Wedge400-data64 board > ARM: dts: aspeed: Add Facebook Wedge400-data64 (AST2500) BMC > ARM: dts: aspeed: wedge400: Include wedge400-data64.dts > dt-bindings: arm: aspeed: add Facebook Fuji-data64 board > ARM: dts: aspeed: Add Facebook Fuji-data64 (AST2600) Board > ARM: dts: aspeed: facebook-fuji: Include facebook-fuji-data64.dts > dt-bindings: arm: aspeed: add Facebook Darwin board > ARM: dts: aspeed: Add Facebook Darwin (AST2600) BMC > > .../bindings/arm/aspeed/aspeed.yaml | 3 + > arch/arm/boot/dts/aspeed/Makefile | 3 + > .../dts/aspeed/aspeed-bmc-facebook-darwin.dts | 72 + > .../dts/aspeed/aspeed-bmc-facebook-elbert.dts | 12 + > .../aspeed-bmc-facebook-fuji-data64.dts | 1264 +++++++++++++++++ > .../dts/aspeed/aspeed-bmc-facebook-fuji.dts | 1245 +--------------- > .../aspeed-bmc-facebook-wedge400-data64.dts | 376 +++++ > .../aspeed/aspeed-bmc-facebook-wedge400.dts | 366 +---- > .../ast2600-facebook-netbmc-common.dtsi | 22 +- > .../facebook-bmc-flash-layout-128-data64.dtsi | 60 + > 10 files changed, 1804 insertions(+), 1619 deletions(-) > create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts > create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dts > create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dts > create mode 100644 arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128-data64.dtsi > > -- > 2.47.3 > > > My bot found new DTB warnings on the .dts files added or changed in this series. Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments. If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date: pip3 install dtschema --upgrade This patch series was applied (using b4) to base: Base: attempting to guess base-commit... Base: remotes/next/fs-next-11017-gdc9b385a8a2e (best guess, 4/6 blobs matched) If this is not the correct base, please add 'base-commit' tag (or use b4 which does this automatically) New warnings running 'make CHECK_DTBS=y for arch/arm/boot/dts/aspeed/' for 20250723233013.142337-1-rentao.bupt at gmail.com: arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: timer (arm,armv7-timer): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/timer/arm,arch_timer.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: /sdram at 1e6e0000: failed to match any schema with compatible: ['aspeed,ast2600-sdram-edac', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: bus at 1e600000 (aspeed,ast2600-ahbc): compatible: ['aspeed,ast2600-ahbc', 'syscon'] is too long from schema $id: http://devicetree.org/schemas/bus/aspeed,ast2600-ahbc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: syscon at 1e6e2000 (aspeed,ast2600-scu): 'smp-memram at 180' does not match any of the regexes: '^interrupt-controller@[0-9a-f]+$', '^p2a-control@[0-9a-f]+$', '^pinctrl(@[0-9a-f]+)?$', '^pinctrl-[0-9]+$', '^silicon-id@[0-9a-f]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed,ast2x00-scu.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: /ahb/apb/syscon at 1e6e2000/smp-memram at 180: failed to match any schema with compatible: ['aspeed,ast2600-smpmem'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: /ahb/apb/display at 1e6e6000: failed to match any schema with compatible: ['aspeed,ast2600-gfx', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: adc at 1e6e9000 (aspeed,ast2600-adc0): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: adc at 1e6e9100 (aspeed,ast2600-adc1): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: crypto at 1e6fa000 (aspeed,ast2600-acry): 'aspeed,ahbc' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/crypto/aspeed,ast2600-acry.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): reg-io-width: 4 is not of type 'object' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): lpc-snoop at 80: 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: kcs at 24 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: kcs at 28 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: kcs at 2c (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: kcs at 114 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: /ahb/apb/lpc at 1e789000/lhc at a0: failed to match any schema with compatible: ['aspeed,ast2600-lhc'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: /ahb/apb/lpc at 1e789000/ibt at 140: failed to match any schema with compatible: ['aspeed,ast2600-ibt-bmc'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740100:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740200:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740100: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740200: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: fsi at 1e79b000 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: /ahb/apb/fsi at 1e79b000: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: fsi at 1e79b100 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: /ahb/apb/fsi at 1e79b100: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dtb: /ahb/apb/dma-controller at 1e79e000: failed to match any schema with compatible: ['aspeed,ast2600-udma'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dtb: /ahb/apb/memory-controller at 1e6e0000: failed to match any schema with compatible: ['aspeed,ast2500-sdram-edac'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dtb: /ahb/apb/syscon at 1e6e2000/p2a-control at 2c: failed to match any schema with compatible: ['aspeed,ast2500-p2a-ctrl'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dtb: /ahb/apb/display at 1e6e6000: failed to match any schema with compatible: ['aspeed,ast2500-gfx', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dtb: sd-controller at 1e740000 (aspeed,ast2500-sd-controller): sdhci at 200: Unevaluated properties are not allowed ('sdhci-caps-mask' was unexpected) from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dtb: /ahb/apb/pwm-tacho-controller at 1e786000: failed to match any schema with compatible: ['aspeed,ast2500-pwm-tacho'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dtb: lpc at 1e789000 (aspeed,ast2500-lpc-v2): reg-io-width: 4 is not of type 'object' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dtb: lpc at 1e789000 (aspeed,ast2500-lpc-v2): lpc-snoop at 90: 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dtb: kcs at 24 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dtb: kcs at 28 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dtb: kcs at 2c (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dtb: kcs at 114 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dtb: /ahb/apb/lpc at 1e789000/lhc at a0: failed to match any schema with compatible: ['aspeed,ast2500-lhc'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dtb: /ahb/apb/lpc at 1e789000/ibt at 140: failed to match any schema with compatible: ['aspeed,ast2500-ibt-bmc'] arch/arm/boot/dts/aspeed/aspeed-bmc-qcom-dc-scm-v1.dtb: /ahb/apb/display at 1e6e6000: failed to match any schema with compatible: ['aspeed,ast2600-gfx', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: timer (arm,armv7-timer): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/timer/arm,arch_timer.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /sdram at 1e6e0000: failed to match any schema with compatible: ['aspeed,ast2600-sdram-edac', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: bus at 1e600000 (aspeed,ast2600-ahbc): compatible: ['aspeed,ast2600-ahbc', 'syscon'] is too long from schema $id: http://devicetree.org/schemas/bus/aspeed,ast2600-ahbc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: syscon at 1e6e2000 (aspeed,ast2600-scu): 'smp-memram at 180' does not match any of the regexes: '^interrupt-controller@[0-9a-f]+$', '^p2a-control@[0-9a-f]+$', '^pinctrl(@[0-9a-f]+)?$', '^pinctrl-[0-9]+$', '^silicon-id@[0-9a-f]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed,ast2x00-scu.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb/syscon at 1e6e2000/smp-memram at 180: failed to match any schema with compatible: ['aspeed,ast2600-smpmem'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb/display at 1e6e6000: failed to match any schema with compatible: ['aspeed,ast2600-gfx', 'syscon'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: adc at 1e6e9000 (aspeed,ast2600-adc0): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: adc at 1e6e9100 (aspeed,ast2600-adc1): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: crypto at 1e6fa000 (aspeed,ast2600-acry): 'aspeed,ahbc' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/crypto/aspeed,ast2600-acry.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): reg-io-width: 4 is not of type 'object' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): lpc-snoop at 80: 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: kcs at 24 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: kcs at 28 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: kcs at 2c (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: kcs at 114 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb/lpc at 1e789000/lhc at a0: failed to match any schema with compatible: ['aspeed,ast2600-lhc'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb/lpc at 1e789000/ibt at 140: failed to match any schema with compatible: ['aspeed,ast2600-ibt-bmc'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740100:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740200:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740100: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740200: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: fsi at 1e79b000 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb/fsi at 1e79b000: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: fsi at 1e79b100 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb/fsi at 1e79b100: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dtb: /ahb/apb/dma-controller at 1e79e000: failed to match any schema with compatible: ['aspeed,ast2600-udma'] From robh at kernel.org Fri Jul 25 13:25:35 2025 From: robh at kernel.org (Rob Herring) Date: Thu, 24 Jul 2025 22:25:35 -0500 Subject: [PATCH v7 0/2] Adding device tree and binding for NVIDIA GB200-UT3.0b In-Reply-To: <175341328135.3754696.5873094296930738476.robh@kernel.org> References: <20250723222350.200094-1-donalds@nvidia.com> <175341328135.3754696.5873094296930738476.robh@kernel.org> Message-ID: On Thu, Jul 24, 2025 at 10:19?PM Rob Herring (Arm) wrote: > > > On Wed, 23 Jul 2025 15:23:48 -0700, Donald Shannon wrote: > > Patch 1 adds the binding for the NVIDIA GB200-UT3.0b platform. > > Patch 2 adds the device tree for the NVIDIA GB200-UT3.0b platform. > > > > This is an Aspeed AST2600 based unit testing platform for GB200. > > UT3.0b is different than nvidia-gb200nvl-bmc due to networking topology > > differences, additional gpio expanders, and voltage regulator gating > > some devices. > > > > Reference to Ast2600 SOC [1]. > > Reference to Blackwell GB200NVL Platform [2]. > > > > Link: https://www.aspeedtech.com/server_ast2600/ [1] > > Link: https://nvdam.widen.net/s/wwnsxrhm2w/blackwell-datasheet-3384703 [2] > > Signed-off-by: Donald Shannon > > --- > > Changes v1 -> v2: > > - Changed phy-mode to rgmii-id [Lunn] > > - Removed redundant max-speed for mac0 [Lunn] > > - Fixed typo from gb200nvl to gb200 in Makefile > > Changes v2 -> v3: > > - Fixed whitespace issues [Krzysztof] > > - Fixed schema validation issues from my end ( there are still issues > > with the aspeed dtsi file that are not related to this new dts) > > [Herring] > > - Reordered to follow style guide [Krzysztof] > > - Removed redundant status okays > > - Changed vcc to vdd for the power gating on the gpio expanders > > Changes v3 -> v4: > > - Added changelog [Krzysztof] > > - Added nvidia,gb200-ut30b board binding [Krzysztof] > > - Removed unused imports > > - Reordered a couple other style guide violations > > - Added back in a couple needed "status okay"s > > Changes v4 -> v5: > > - Resumed my patch after a pause > > - Don't plan to make this include of nvidia-gb200nvl-bmc due to some > > platform differences > > - Fixed io expanders that weren't gated by the 3.3V standby regulator > > - Fixed incorrect interrupt pin for one IO expander > > - Removed some IO expanders and I2C busses > > Changes v5 -> v6: > > - Fixed subject line > > - Added missing gpio-key compatible type to buttons > > Changes v6 -> v7: > > - Removed Acked-by Krzysztof > > --- > > > > Donald Shannon (2): > > dt-bindings: arm: aspeed: Add NVIDIA GB200-UT3.0b board > > ARM: dts: aspeed: Add NVIDIA GB200 UT3.0b board > > > > .../bindings/arm/aspeed/aspeed.yaml | 1 + > > arch/arm/boot/dts/aspeed/Makefile | 1 + > > .../aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts | 1028 +++++++++++++++++ > > 3 files changed, 1030 insertions(+) > > create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dts > > > > > > base-commit: 05adbee3ad528100ab0285c15c91100e19e10138 > > -- > > 2.43.0 > > > > > > > > > My bot found new DTB warnings on the .dts files added or changed in this > series. > > Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings > are fixed by another series. Ultimately, it is up to the platform > maintainer whether these warnings are acceptable or not. No need to reply > unless the platform maintainer has comments. > > If you already ran DT checks and didn't see these error(s), then > make sure dt-schema is up to date: > > pip3 install dtschema --upgrade > > > This patch series was applied (using b4) to base: > Base: using specified base-commit 05adbee3ad528100ab0285c15c91100e19e10138 > > If this is not the correct base, please add 'base-commit' tag > (or use b4 which does this automatically) > > New warnings running 'make CHECK_DTBS=y for arch/arm/boot/dts/aspeed/' for 20250723222350.200094-1-donalds at nvidia.com: > > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: timer (arm,armv7-timer): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' > from schema $id: http://devicetree.org/schemas/timer/arm,arch_timer.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /sdram at 1e6e0000: failed to match any schema with compatible: ['aspeed,ast2600-sdram-edac', 'syscon'] > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: bus at 1e600000 (aspeed,ast2600-ahbc): compatible: ['aspeed,ast2600-ahbc', 'syscon'] is too long > from schema $id: http://devicetree.org/schemas/bus/aspeed,ast2600-ahbc.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: syscon at 1e6e2000 (aspeed,ast2600-scu): 'smp-memram at 180' does not match any of the regexes: '^interrupt-controller@[0-9a-f]+$', '^p2a-control@[0-9a-f]+$', '^pinctrl(@[0-9a-f]+)?$', '^pinctrl-[0-9]+$', '^silicon-id@[0-9a-f]+$' > from schema $id: http://devicetree.org/schemas/mfd/aspeed,ast2x00-scu.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/syscon at 1e6e2000/smp-memram at 180: failed to match any schema with compatible: ['aspeed,ast2600-smpmem'] > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/display at 1e6e6000: failed to match any schema with compatible: ['aspeed,ast2600-gfx', 'syscon'] > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: adc at 1e6e9000 (aspeed,ast2600-adc0): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' > from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: adc at 1e6e9100 (aspeed,ast2600-adc1): 'interrupts' does not match any of the regexes: '^pinctrl-[0-9]+$' > from schema $id: http://devicetree.org/schemas/iio/adc/aspeed,ast2600-adc.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: crypto at 1e6fa000 (aspeed,ast2600-acry): 'aspeed,ahbc' does not match any of the regexes: '^pinctrl-[0-9]+$' > from schema $id: http://devicetree.org/schemas/crypto/aspeed,ast2600-acry.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): reg-io-width: 4 is not of type 'object' > from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: lpc at 1e789000 (aspeed,ast2600-lpc-v2): lpc-snoop at 80: 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' > from schema $id: http://devicetree.org/schemas/mfd/aspeed-lpc.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: kcs at 24 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' > from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: kcs at 28 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' > from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: kcs at 2c (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' > from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: kcs at 114 (aspeed,ast2500-kcs-bmc-v2): 'clocks' does not match any of the regexes: '^pinctrl-[0-9]+$' > from schema $id: http://devicetree.org/schemas/ipmi/aspeed,ast2400-kcs-bmc.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/lpc at 1e789000/lhc at a0: failed to match any schema with compatible: ['aspeed,ast2600-lhc'] > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/lpc at 1e789000/ibt at 140: failed to match any schema with compatible: ['aspeed,ast2600-ibt-bmc'] > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740100:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long > from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: sdc at 1e740000 (aspeed,ast2600-sd-controller): sdhci at 1e740200:compatible: ['aspeed,ast2600-sdhci', 'sdhci'] is too long > from schema $id: http://devicetree.org/schemas/mmc/aspeed,sdhci.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740100: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/sdc at 1e740000/sdhci at 1e740200: failed to match any schema with compatible: ['aspeed,ast2600-sdhci', 'sdhci'] > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: fsi at 1e79b000 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long > from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/fsi at 1e79b000: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: fsi at 1e79b100 (aspeed,ast2600-fsi-master): compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] is too long > from schema $id: http://devicetree.org/schemas/fsi/aspeed,ast2600-fsi-master.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/fsi at 1e79b100: failed to match any schema with compatible: ['aspeed,ast2600-fsi-master', 'fsi-master'] > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: /ahb/apb/dma-controller at 1e79e000: failed to match any schema with compatible: ['aspeed,ast2600-udma'] All of the below warnings you are introducing... And yeah, all the ones above are existing, but I don't see a lot of progress fixing them. It seems no one adding their board cares about the SoC warnings given the lack of progress on aspeed stuff. Maybe new boards need to be rejected without some improvements... > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-power: 'anyOf' conditional failed, one must be fixed: > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-power: 'oneOf' conditional failed, one must be fixed: > 'interrupts' is a required property > 'interrupts-extended' is a required property > 'gpios' is a required property > from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-power: 'linux,code' is a required property > from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-power: Unevaluated properties are not allowed ('gpio' was unexpected) > from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-uid: 'anyOf' conditional failed, one must be fixed: > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-uid: 'oneOf' conditional failed, one must be fixed: > 'interrupts' is a required property > 'interrupts-extended' is a required property > 'gpios' is a required property > from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-uid: 'linux,code' is a required property > from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml# > arch/arm/boot/dts/aspeed/aspeed-bmc-nvidia-gb200-ut30b.dtb: buttons (gpio-keys): button-uid: Unevaluated properties are not allowed ('gpio' was unexpected) > from schema $id: http://devicetree.org/schemas/input/gpio-keys.yaml# 'gpio' has been deprecated for only about 10 years. Maybe 15... Rob From rentao.bupt at gmail.com Fri Jul 25 15:18:53 2025 From: rentao.bupt at gmail.com (Tao Ren) Date: Thu, 24 Jul 2025 22:18:53 -0700 Subject: [PATCH v3 10/13] ARM: dts: aspeed: Add Facebook Fuji-data64 (AST2600) Board In-Reply-To: <769d6817-ee97-4a23-b013-29bc875a00cb@lunn.ch> References: <20250723233013.142337-1-rentao.bupt@gmail.com> <20250723233013.142337-11-rentao.bupt@gmail.com> <769d6817-ee97-4a23-b013-29bc875a00cb@lunn.ch> Message-ID: On Thu, Jul 24, 2025 at 02:53:39PM +0200, Andrew Lunn wrote: > On Wed, Jul 23, 2025 at 06:03:49PM -0700, Tao Ren wrote: > > On Thu, Jul 24, 2025 at 02:03:20AM +0200, Andrew Lunn wrote: > > > > +&mac3 { > > > > + status = "okay"; > > > > + phy-mode = "rgmii"; > > > > > > Does the PCB have extra long clock lines to implement the 2ns delay? > > > > > > Andrew > > > > Hi Andrew, > > > > Thank you for catching it. I didn't notice the settings because the file > > is copied from the exiting fuji.dts with minor changes. > > > > The delay is currently introduced on MAC side (by manually setting SCU > > registers), but I guess I can update phy-mode to "rgmii-id" so the delay > > can be handled by the PHY? > > That would be good, if it works. The problem with the current code is > that those SCU registers are not set as part of the MAC driver, so it > is hard to know what value they have. > > Andrew Hi Andrew, I set phy-mode to rgmii-id (letting BCM54616S handle RX/TX delay) and cleared SCU350 (MAC3/4 RGMII delay) register, but somehow BMC is not reachable over ethernet. Let me see if I missed other settings. I will drop the mac entry from v4 if I cannot make it work by next Monday. Thanks, Tao From rentao.bupt at gmail.com Fri Jul 25 15:20:18 2025 From: rentao.bupt at gmail.com (Tao Ren) Date: Thu, 24 Jul 2025 22:20:18 -0700 Subject: [PATCH v3 07/13] ARM: dts: aspeed: Add Facebook Wedge400-data64 (AST2500) BMC In-Reply-To: <20250724-overjoyed-panther-from-camelot-f2ff4f@kuoka> References: <20250723233013.142337-1-rentao.bupt@gmail.com> <20250723233013.142337-8-rentao.bupt@gmail.com> <20250724-overjoyed-panther-from-camelot-f2ff4f@kuoka> Message-ID: On Thu, Jul 24, 2025 at 10:05:40AM +0200, Krzysztof Kozlowski wrote: > On Wed, Jul 23, 2025 at 04:30:03PM -0700, rentao.bupt at gmail.com wrote: > > + /* > > + * PCA9548 (11-0076) provides 8 channels connecting to > > + * FCM (Fan Controller Module). > > + */ > > + i2c32 = &imux32; > > + i2c33 = &imux33; > > + i2c34 = &imux34; > > + i2c35 = &imux35; > > + i2c36 = &imux36; > > + i2c37 = &imux37; > > + i2c38 = &imux38; > > + i2c39 = &imux39; > > + > > + spi2 = &spi_gpio; > > + }; > > + > > + chosen { > > + stdout-path = &uart1; > > + bootargs = "console=ttyS0,9600n8 root=/dev/ram rw"; > > Drop bootargs. You are duplicating stdout path and choice of root is > definitely not a mainline user friendly. > > Best regards, > Krzysztof Got it. I will drop bootargs in v4. Thanks, Tao From ryan_chen at aspeedtech.com Fri Jul 25 17:18:09 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Fri, 25 Jul 2025 07:18:09 +0000 Subject: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent node compatibles and refine documentation In-Reply-To: References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> <20250722095156.1672873-2-ryan_chen@aspeedtech.com> Message-ID: > Subject: RE: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent > node compatibles and refine documentation > > > Subject: Re: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: > > Add parent node compatibles and refine documentation > > > > On 22/07/2025 11:51, Ryan Chen wrote: > > > The AST2700 SoC contains two independent top-level interrupt > > > controllers > > > (INTC0 and INTC1), each responsible for handling different > > > peripheral groups and occupying separate register spaces. Above > > > them, PSP(CA35) GIC controller acts as the root interrupt > > > aggregator. Accurately describing this hierarchical hardware > > > structure in the device tree requires distinct compatible strings for the parent > nodes of INTC0 and INTC1. > > > > > > - Adds 'aspeed,ast2700-intc0' and 'aspeed,ast2700-intc1' compatible > > > strings for parent interrupt controller nodes. (in addition to the > > > existing 'aspeed,ast2700-intc-ic' for child nodes) > > > > I don't understand how this solves your problem at all. Look at old > > diagram - is it correct? If not, what makes you think that new diagram is > correct? > > > > What is the meaning of existing binding and existing intc-ic compatible? > > > The new parent nodes (aspeed,ast2700-intc0/intc1) make the device tree layout > match the actual hardware separation shown in the SoC datasheet. > This allows us to register the full resource region, allocate platform resources > properly, and cleanly extend/debug in the future. > > The previous "aspeed,ast2700-intc-ic" compatible only describes the interrupt > controller instance, not the full register block. In practice, with only a single child > node, there is no way to: > map and manage the entire address space for each INTC block (0x12100000 and > 0x14c18000), or cleanly expose debug features that must access > routing/protection registers outside the intc-ic range. > > The old diagram was incomplete, since it implied that the interrupt controller > block had only the intc-ic instance, but in hardware each INTC region contains > multiple functions and register ranges. > > This binding change is mainly for clarity and correctness, aligning DT and driver > with the real SoC register map and future-proofing for debug/maintenance. > > > > > - Clarifies the relationship and function of INTC0 parent > > > (intc0_0~x: child), INTC1 parent (intc1_0~x: child), and the GIC > > > in the documentation. > > > - Updates block diagrams and device tree examples to illustrate the > > > hierarchy and compatible usage. > > > - Refines documentation and example formatting. > > > > > > This change allows the device tree and driver to distinguish between > > > parent (top-level) and child (group) interrupt controller nodes, > > > enabling more precise driver matching SOC register space allocation. > > > > And how it was not possible before? That's poor argument especially > > that DT does not have to ever distinguish that. > > Hi Krzysztof, I wanted to follow up on my previous explanation about separating parent and child nodes for AST2700 INTC in the device tree. There is other SoCs, such as Marvell?s CP110 ICU, also use a similar approach to separate parent controller and functional child nodes in the device tree, as shown here: https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/interrupt-controller/marvell%2Ccp110-icu.yaml#L74-L98 Do you need me to provide further details or additional about our SOC design information? Or is there anything specific you?d like clarified regarding the motivation or the binding structure? Thanks for your feedback and guidance. Best regards, Ryan > > > > Best regards, > > Krzysztof From krzk at kernel.org Fri Jul 25 17:40:08 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Fri, 25 Jul 2025 09:40:08 +0200 Subject: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent node compatibles and refine documentation In-Reply-To: References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> <20250722095156.1672873-2-ryan_chen@aspeedtech.com> <001d37c7-f704-4554-a4db-0cc130e07dd6@kernel.org> Message-ID: <384635a3-c6ed-44f8-a54a-2b20e20694cd@kernel.org> On 23/07/2025 10:08, Ryan Chen wrote: >> Subject: Re: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add >> parent node compatibles and refine documentation >> >> On 22/07/2025 11:51, Ryan Chen wrote: >>> + INTC0 is used to assert GIC if interrupt in INTC1 asserted. >>> + INTC1 is used to assert INTC0 if interrupt of modules asserted. >>> + +-----+ +---------+ >>> + | GIC |---| INTC0 | >>> + +-----+ +---------+ >>> + +---------+ >>> + | |---module0 >>> + | INTC0_0 |---module1 >>> + | |---... >>> + +---------+---module31 >>> + |---.... | >>> + +---------+ >>> + | | +---------+ >>> + | INTC0_11| +---| INTC1 | >>> + | | +---------+ >>> + +---------+ +---------+---module0 >>> + | INTC1_0 |---module1 >>> + | |---... >>> + +---------+---module31 >>> + ... >>> + +---------+---module0 >>> + | INTC1_5 |---module1 >>> + | |---... >>> + +---------+---module31 >> >> You binding also said intc1 is the parent of intc-ic, so where is here intc-ic? >> >> This diagram and new binding do not match at all. > > The corresponded compatible is following. > > +-----+ +---------+ > | GIC |---| INTC0 | -> (parent : aspeed,ast2700-intc0) > +-----+ +---------+ > +---------+ > | |---module0 > | INTC0_0 |---module1 > (child : aspeed,ast2700-intc-ic) > | |---... > +---------+---module31 > |---.... | > +---------+ > | | +---------+ > | INTC0_11 | +---------------------------- | INTC1 | -> -> (parent : aspeed,ast2700-intc1) AGAIN (second time): that's not what your binding said. Your binding is explicit here, which is what we want in general. It says that inct1 is one of the parents of intc-ic. Let me be clear, because you will be dragging this talk with irrelevant arguments forever - changing this binding is close to no. If you come with correct arguments, maybe would work. But the main point is that you probably do not have to even change the binding to achieve proper hardware description. Work on that. Best regards, Krzysztof From krzk at kernel.org Fri Jul 25 17:41:49 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Fri, 25 Jul 2025 09:41:49 +0200 Subject: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent node compatibles and refine documentation In-Reply-To: References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> <20250722095156.1672873-2-ryan_chen@aspeedtech.com> Message-ID: <3c2ce865-0f9b-4b8b-a4c7-d869c6a4f717@kernel.org> On 25/07/2025 09:18, Ryan Chen wrote: > >> Subject: RE: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent >> node compatibles and refine documentation >> >>> Subject: Re: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: >>> Add parent node compatibles and refine documentation >>> >>> On 22/07/2025 11:51, Ryan Chen wrote: >>>> The AST2700 SoC contains two independent top-level interrupt >>>> controllers >>>> (INTC0 and INTC1), each responsible for handling different >>>> peripheral groups and occupying separate register spaces. Above >>>> them, PSP(CA35) GIC controller acts as the root interrupt >>>> aggregator. Accurately describing this hierarchical hardware >>>> structure in the device tree requires distinct compatible strings for the parent >> nodes of INTC0 and INTC1. >>>> >>>> - Adds 'aspeed,ast2700-intc0' and 'aspeed,ast2700-intc1' compatible >>>> strings for parent interrupt controller nodes. (in addition to the >>>> existing 'aspeed,ast2700-intc-ic' for child nodes) >>> >>> I don't understand how this solves your problem at all. Look at old >>> diagram - is it correct? If not, what makes you think that new diagram is >> correct? >>> >>> What is the meaning of existing binding and existing intc-ic compatible? >>> >> The new parent nodes (aspeed,ast2700-intc0/intc1) make the device tree layout >> match the actual hardware separation shown in the SoC datasheet. >> This allows us to register the full resource region, allocate platform resources >> properly, and cleanly extend/debug in the future. >> >> The previous "aspeed,ast2700-intc-ic" compatible only describes the interrupt >> controller instance, not the full register block. In practice, with only a single child >> node, there is no way to: >> map and manage the entire address space for each INTC block (0x12100000 and >> 0x14c18000), or cleanly expose debug features that must access >> routing/protection registers outside the intc-ic range. >> >> The old diagram was incomplete, since it implied that the interrupt controller >> block had only the intc-ic instance, but in hardware each INTC region contains >> multiple functions and register ranges. >> >> This binding change is mainly for clarity and correctness, aligning DT and driver >> with the real SoC register map and future-proofing for debug/maintenance. >>> >>>> - Clarifies the relationship and function of INTC0 parent >>>> (intc0_0~x: child), INTC1 parent (intc1_0~x: child), and the GIC >>>> in the documentation. >>>> - Updates block diagrams and device tree examples to illustrate the >>>> hierarchy and compatible usage. >>>> - Refines documentation and example formatting. >>>> >>>> This change allows the device tree and driver to distinguish between >>>> parent (top-level) and child (group) interrupt controller nodes, >>>> enabling more precise driver matching SOC register space allocation. >>> >>> And how it was not possible before? That's poor argument especially >>> that DT does not have to ever distinguish that. >>> > > Hi Krzysztof, > > I wanted to follow up on my previous explanation about separating parent and child nodes for AST2700 INTC in the device tree. > There is other SoCs, such as Marvell?s CP110 ICU, also use a similar approach to separate parent controller and functional child nodes in the device tree, as shown here: > https://github.com/torvalds/linux/blob/master/Documentation/devicetree/bindings/interrupt-controller/marvell%2Ccp110-icu.yaml#L74-L98 > Do you need me to provide further details or additional about our SOC design information? > Or is there anything specific you?d like clarified regarding the motivation or the binding structure? Start properly wrapping your email responses. All of them are misformatted, all the time! You got replies from two DT binding maintainers. Work with that. Best regards, Krzysztof From jammy_huang at aspeedtech.com Fri Jul 25 20:24:57 2025 From: jammy_huang at aspeedtech.com (Jammy Huang) Date: Fri, 25 Jul 2025 10:24:57 +0000 Subject: [PATCH v6 2/2] mailbox: aspeed: add mailbox driver for AST27XX series SoC In-Reply-To: References: <20250702011956.47479-1-jammy_huang@aspeedtech.com> <20250702011956.47479-3-jammy_huang@aspeedtech.com> Message-ID: > On Tue, Jul 1, 2025 at 8:19?PM Jammy Huang > wrote: > > ..... > > + /* Read the message data */ > > + for (data_reg = mb->rx_regs + IPCR_DATA + > mb->msg_size * n, > > + word_data = chan->con_priv, > > + num_words = (mb->msg_size / sizeof(u32)); > > + num_words; > > + num_words--, data_reg += sizeof(u32), > word_data++) > > + *word_data = readl(data_reg); > > + > Please clean this for loop. OK, will be updated in later patch. Thanks for help. > > Thanks > -Jassi Regards. From ryan_chen at aspeedtech.com Sun Jul 27 11:47:34 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Sun, 27 Jul 2025 01:47:34 +0000 Subject: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent node compatibles and refine documentation In-Reply-To: <384635a3-c6ed-44f8-a54a-2b20e20694cd@kernel.org> References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> <20250722095156.1672873-2-ryan_chen@aspeedtech.com> <001d37c7-f704-4554-a4db-0cc130e07dd6@kernel.org> <384635a3-c6ed-44f8-a54a-2b20e20694cd@kernel.org> Message-ID: > Subject: Re: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent > node compatibles and refine documentation > > On 23/07/2025 10:08, Ryan Chen wrote: > >> Subject: Re: [PATCH v3 1/2] dt-bindings: interrupt-controller: > >> aspeed: Add parent node compatibles and refine documentation > >> > >> On 22/07/2025 11:51, Ryan Chen wrote: > >>> + INTC0 is used to assert GIC if interrupt in INTC1 asserted. > >>> + INTC1 is used to assert INTC0 if interrupt of modules asserted. > >>> + +-----+ +---------+ > >>> + | GIC |---| INTC0 | > >>> + +-----+ +---------+ > >>> + +---------+ > >>> + | |---module0 > >>> + | INTC0_0 |---module1 > >>> + | |---... > >>> + +---------+---module31 > >>> + |---.... | > >>> + +---------+ > >>> + | | +---------+ > >>> + | INTC0_11| +---| INTC1 | > >>> + | | +---------+ > >>> + +---------+ +---------+---module0 > >>> + | INTC1_0 |---module1 > >>> + | |---... > >>> + +---------+---module31 > >>> + ... > >>> + +---------+---module0 > >>> + | INTC1_5 |---module1 > >>> + | |---... > >>> + +---------+---module31 > >> > >> You binding also said intc1 is the parent of intc-ic, so where is here intc-ic? > >> > >> This diagram and new binding do not match at all. > > > > The corresponded compatible is following. > > > > +-----+ +---------+ > > | GIC |---| INTC0 | -> (parent : aspeed,ast2700-intc0) > > +-----+ +---------+ > > +---------+ > > | |---module0 > > | INTC0_0 |---module1 > > (child : aspeed,ast2700-intc-ic) > > | |---... > > +---------+---module31 > > |---.... | > > +---------+ > > | | +---------+ > > | INTC0_11 | +---------------------------- | INTC1 | -> -> > (parent : aspeed,ast2700-intc1) > > AGAIN (second time): that's not what your binding said. > > Your binding is explicit here, which is what we want in general. It says that inct1 is > one of the parents of intc-ic. > > Let me be clear, because you will be dragging this talk with irrelevant arguments > forever - changing this binding is close to no. If you come with correct arguments, > maybe would work. But the main point is that you probably do not have to even > change the binding to achieve proper hardware description. Work on that. > If I do not change the binding, I think the yaml and dts can still fit the interrupt nesting architecture by using both interrupts and interrupts-extended. For first-level controllers, use the standard interrupts property (e.g. with the GIC as the parent). For second-level INTC-IC instances, use interrupts-extended to refer to the first-level INTC-IC, following common Linux practice for stacked interrupt controllers. For example: dts // First level intc0_11: interrupt-controller at 12101b00 { compatible = "aspeed,ast2700-intc-ic"; reg = <...>; interrupt-controller; #interrupt-cells = <2>; interrupts = , ...; }; // Second level, cascaded intc1_0: interrupt-controller at 14c18100 { compatible = "aspeed,ast2700-intc-ic"; reg = <...>; interrupt-controller; #interrupt-cells = <2>; interrupts-extended = <&intc0_11 0 IRQ_TYPE_LEVEL_HIGH>; }; In yaml, I can use: oneOf: - required: [interrupts] - required: [interrupts-extended] This allows both cases to be valid. Please let me know if this is the recommended approach, or if further changes are needed. > Best regards, > Krzysztof From rentao.bupt at gmail.com Sun Jul 27 15:57:24 2025 From: rentao.bupt at gmail.com (Tao Ren) Date: Sat, 26 Jul 2025 22:57:24 -0700 Subject: [PATCH v3 10/13] ARM: dts: aspeed: Add Facebook Fuji-data64 (AST2600) Board In-Reply-To: References: <20250723233013.142337-1-rentao.bupt@gmail.com> <20250723233013.142337-11-rentao.bupt@gmail.com> <769d6817-ee97-4a23-b013-29bc875a00cb@lunn.ch> Message-ID: On Thu, Jul 24, 2025 at 10:18:57PM -0700, Tao Ren wrote: > On Thu, Jul 24, 2025 at 02:53:39PM +0200, Andrew Lunn wrote: > > On Wed, Jul 23, 2025 at 06:03:49PM -0700, Tao Ren wrote: > > > On Thu, Jul 24, 2025 at 02:03:20AM +0200, Andrew Lunn wrote: > > > > > +&mac3 { > > > > > + status = "okay"; > > > > > + phy-mode = "rgmii"; > > > > > > > > Does the PCB have extra long clock lines to implement the 2ns delay? > > > > > > > > Andrew > > > > > > Hi Andrew, > > > > > > Thank you for catching it. I didn't notice the settings because the file > > > is copied from the exiting fuji.dts with minor changes. > > > > > > The delay is currently introduced on MAC side (by manually setting SCU > > > registers), but I guess I can update phy-mode to "rgmii-id" so the delay > > > can be handled by the PHY? > > > > That would be good, if it works. The problem with the current code is > > that those SCU registers are not set as part of the MAC driver, so it > > is hard to know what value they have. > > > > Andrew > > Hi Andrew, > > I set phy-mode to rgmii-id (letting BCM54616S handle RX/TX delay) and > cleared SCU350 (MAC3/4 RGMII delay) register, but somehow BMC is not > reachable over ethernet. > > Let me see if I missed other settings. I will drop the mac entry from v4 > if I cannot make it work by next Monday. Hi Andrew, I made it "work" by updating phy-mode to rgmii-txid, and it seems like AST2600 MAC introduces RX delay even though RXCLK delay setting is 0 in SCU350 register. As I'm not 100% sure where the RX clock delay is introduced, I will drop mac3 entry in v4. Thanks, Tao From krzk at kernel.org Sun Jul 27 19:36:23 2025 From: krzk at kernel.org (Krzysztof Kozlowski) Date: Sun, 27 Jul 2025 11:36:23 +0200 Subject: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent node compatibles and refine documentation In-Reply-To: References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> <20250722095156.1672873-2-ryan_chen@aspeedtech.com> <001d37c7-f704-4554-a4db-0cc130e07dd6@kernel.org> <384635a3-c6ed-44f8-a54a-2b20e20694cd@kernel.org> Message-ID: On 27/07/2025 03:47, Ryan Chen wrote: >> Subject: Re: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent >> node compatibles and refine documentation >> >> On 23/07/2025 10:08, Ryan Chen wrote: >>>> Subject: Re: [PATCH v3 1/2] dt-bindings: interrupt-controller: >>>> aspeed: Add parent node compatibles and refine documentation >>>> >>>> On 22/07/2025 11:51, Ryan Chen wrote: >>>>> + INTC0 is used to assert GIC if interrupt in INTC1 asserted. >>>>> + INTC1 is used to assert INTC0 if interrupt of modules asserted. >>>>> + +-----+ +---------+ >>>>> + | GIC |---| INTC0 | >>>>> + +-----+ +---------+ >>>>> + +---------+ >>>>> + | |---module0 >>>>> + | INTC0_0 |---module1 >>>>> + | |---... >>>>> + +---------+---module31 >>>>> + |---.... | >>>>> + +---------+ >>>>> + | | +---------+ >>>>> + | INTC0_11| +---| INTC1 | >>>>> + | | +---------+ >>>>> + +---------+ +---------+---module0 >>>>> + | INTC1_0 |---module1 >>>>> + | |---... >>>>> + +---------+---module31 >>>>> + ... >>>>> + +---------+---module0 >>>>> + | INTC1_5 |---module1 >>>>> + | |---... >>>>> + +---------+---module31 >>>> >>>> You binding also said intc1 is the parent of intc-ic, so where is here intc-ic? >>>> >>>> This diagram and new binding do not match at all. >>> >>> The corresponded compatible is following. >>> >>> +-----+ +---------+ >>> | GIC |---| INTC0 | -> (parent : aspeed,ast2700-intc0) >>> +-----+ +---------+ >>> +---------+ >>> | |---module0 >>> | INTC0_0 |---module1 >>> (child : aspeed,ast2700-intc-ic) >>> | |---... >>> +---------+---module31 >>> |---.... | >>> +---------+ >>> | | +---------+ >>> | INTC0_11 | +---------------------------- | INTC1 | -> -> >> (parent : aspeed,ast2700-intc1) >> >> AGAIN (second time): that's not what your binding said. >> >> Your binding is explicit here, which is what we want in general. It says that inct1 is >> one of the parents of intc-ic. ... and you never addressed that. :/ >> >> Let me be clear, because you will be dragging this talk with irrelevant arguments >> forever - changing this binding is close to no. If you come with correct arguments, >> maybe would work. But the main point is that you probably do not have to even >> change the binding to achieve proper hardware description. Work on that. >> > > If I do not change the binding, I think the yaml and dts can still fit the interrupt > nesting architecture by using both interrupts and interrupts-extended. > > For first-level controllers, use the standard interrupts property > (e.g. with the GIC as the parent). > > For second-level INTC-IC instances, use interrupts-extended to refer to the > first-level INTC-IC, following common Linux practice for stacked interrupt controllers. > For example: > dts > // First level > intc0_11: interrupt-controller at 12101b00 { > compatible = "aspeed,ast2700-intc-ic"; > reg = <...>; > interrupt-controller; > #interrupt-cells = <2>; > interrupts = , ...; > }; > > // Second level, cascaded > intc1_0: interrupt-controller at 14c18100 { > compatible = "aspeed,ast2700-intc-ic"; > reg = <...>; > interrupt-controller; > #interrupt-cells = <2>; > interrupts-extended = <&intc0_11 0 IRQ_TYPE_LEVEL_HIGH>; This looks like changing the meaning of the interrupt. What was the interrupt here before? What interrupt is here now? > }; > In yaml, I can use: > oneOf: > - required: [interrupts] > - required: [interrupts-extended] > This allows both cases to be valid. Hm? Since when you need both cases? Best regards, Krzysztof From andrew at lunn.ch Mon Jul 28 01:45:51 2025 From: andrew at lunn.ch (Andrew Lunn) Date: Sun, 27 Jul 2025 17:45:51 +0200 Subject: [PATCH v3 10/13] ARM: dts: aspeed: Add Facebook Fuji-data64 (AST2600) Board In-Reply-To: References: <20250723233013.142337-1-rentao.bupt@gmail.com> <20250723233013.142337-11-rentao.bupt@gmail.com> <769d6817-ee97-4a23-b013-29bc875a00cb@lunn.ch> Message-ID: <9897e0a4-7c70-4e27-8591-09e9d6ef2263@lunn.ch> > As I'm not 100% sure where the RX clock delay is introduced, I will drop > mac3 entry in v4. Many of the hyperscalers, or the supplies to the hyperscalers keep hitting this. The standard policy at the moment seems to be to drop Ethernet support. How useful is a BMC without Ethernet? If you all got together and talked to aspeed, apply a bit of pressure, it should be possible to get this mess fixed pretty quickly. And then you could all have working Ethernet.... Andrew From ryan_chen at aspeedtech.com Mon Jul 28 12:54:52 2025 From: ryan_chen at aspeedtech.com (Ryan Chen) Date: Mon, 28 Jul 2025 02:54:52 +0000 Subject: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent node compatibles and refine documentation In-Reply-To: References: <20250722095156.1672873-1-ryan_chen@aspeedtech.com> <20250722095156.1672873-2-ryan_chen@aspeedtech.com> <001d37c7-f704-4554-a4db-0cc130e07dd6@kernel.org> <384635a3-c6ed-44f8-a54a-2b20e20694cd@kernel.org> Message-ID: > Subject: Re: [PATCH v3 1/2] dt-bindings: interrupt-controller: aspeed: Add parent > node compatibles and refine documentation > > On 27/07/2025 03:47, Ryan Chen wrote: > >> Subject: Re: [PATCH v3 1/2] dt-bindings: interrupt-controller: > >> aspeed: Add parent node compatibles and refine documentation > >> > >> On 23/07/2025 10:08, Ryan Chen wrote: > >>>> Subject: Re: [PATCH v3 1/2] dt-bindings: interrupt-controller: > >>>> aspeed: Add parent node compatibles and refine documentation > >>>> > >>>> On 22/07/2025 11:51, Ryan Chen wrote: > >>>>> + INTC0 is used to assert GIC if interrupt in INTC1 asserted. > >>>>> + INTC1 is used to assert INTC0 if interrupt of modules asserted. > >>>>> + +-----+ +---------+ > >>>>> + | GIC |---| INTC0 | > >>>>> + +-----+ +---------+ > >>>>> + +---------+ > >>>>> + | |---module0 > >>>>> + | INTC0_0 |---module1 > >>>>> + | |---... > >>>>> + +---------+---module31 > >>>>> + |---.... | > >>>>> + +---------+ > >>>>> + | | +---------+ > >>>>> + | INTC0_11| +---| INTC1 | > >>>>> + | | +---------+ > >>>>> + +---------+ +---------+---module0 > >>>>> + | INTC1_0 |---module1 > >>>>> + | |---... > >>>>> + +---------+---module31 > >>>>> + ... > >>>>> + +---------+---module0 > >>>>> + | INTC1_5 |---module1 > >>>>> + | |---... > >>>>> + +---------+---module31 > >>>> > >>>> You binding also said intc1 is the parent of intc-ic, so where is here intc-ic? > >>>> > >>>> This diagram and new binding do not match at all. > >>> > >>> The corresponded compatible is following. > >>> > >>> +-----+ +---------+ > >>> | GIC |---| INTC0 | -> (parent : aspeed,ast2700-intc0) > >>> +-----+ +---------+ > >>> +---------+ > >>> | |---module0 > >>> | INTC0_0 |---module1 > >>> (child : aspeed,ast2700-intc-ic) > >>> | |---... > >>> +---------+---module31 > >>> |---.... | > >>> +---------+ > >>> | | +---------+ > >>> | INTC0_11 | +---------------------------- | INTC1 | -> -> > >> (parent : aspeed,ast2700-intc1) > >> > >> AGAIN (second time): that's not what your binding said. > >> > >> Your binding is explicit here, which is what we want in general. It > >> says that inct1 is one of the parents of intc-ic. > > ... and you never addressed that. :/ The following is datasheet description. AST2700 Interrupt Controller Hierarchy (from datasheet): INTC0 and INTC1 are AMBA slave devices on the AHB bus, each with their own register space. 480 interrupt sources: INTn (n=0~479) INT0~127 can be routed directly to PSP, SSP, or TSP. INT128~319 are handled by INTC1, which have multiple instances (INTC1_0, INTC1_1, ...) INTC1 outputs are routed into INTC0; INTC0 outputs go to the GIC. This structure means: INTC0 receives INT0~127 and also all outputs from INTC1. INTC1 handles a subset of interrupt sources, and its output is routed as an input to INTC0. Block Diagram / Interrupt Chain: GIC | v INTC0 (parent, aspeed,ast2700-intc0) | +-- INTC0_0 (aspeed,ast2700-intc-ic) --> [module0, module1, ...] | +-- ... | +-- INTC0_11 (aspeed,ast2700-intc-ic) | v INTC1 (parent, aspeed,ast2700-intc1) | +-- INTC1_0 (aspeed,ast2700-intc-ic) --> [moduleA, moduleB, ...] | +-- ... | +-- INTC1_5 (aspeed,ast2700-intc-ic) --> [moduleY, moduleZ, ...] | Device Tree Node | Hardware Block | Output Routed To | | ------- | --------------- | ---------------------- | | intc0 | INTC0 @12100000 | GIC | | intc1 | INTC1 @14c18000 | INTC0 input (cascaded)| intc0 uses interrupts to connect to the GIC (top-level parent) intc1 uses interrupts-extended to connect to an input on INTC0 (second-level, cascaded) This approach ensures the software and device tree reflect the actual hardware interrupt paths. It allows the kernel to correctly map register space and handle interrupt delivery, and makes future debug/maintenance straightforward. If there are any details you'd like clarified or if you recommend a different device tree structure, please let me know! > > >> > >> Let me be clear, because you will be dragging this talk with > >> irrelevant arguments forever - changing this binding is close to no. > >> If you come with correct arguments, maybe would work. But the main > >> point is that you probably do not have to even change the binding to achieve > proper hardware description. Work on that. > >> > > > > If I do not change the binding, I think the yaml and dts can still fit > > the interrupt nesting architecture by using both interrupts and > interrupts-extended. > > > > For first-level controllers, use the standard interrupts property > > (e.g. with the GIC as the parent). > > > > For second-level INTC-IC instances, use interrupts-extended to refer > > to the first-level INTC-IC, following common Linux practice for stacked interrupt > controllers. > > For example: > > dts > > // First level > > intc0_11: interrupt-controller at 12101b00 { > > compatible = "aspeed,ast2700-intc-ic"; > > reg = <...>; > > interrupt-controller; > > #interrupt-cells = <2>; > > interrupts = , ...; }; > > > > // Second level, cascaded > > intc1_0: interrupt-controller at 14c18100 { > > compatible = "aspeed,ast2700-intc-ic"; > > reg = <...>; > > interrupt-controller; > > #interrupt-cells = <2>; > > interrupts-extended = <&intc0_11 0 IRQ_TYPE_LEVEL_HIGH>; > > This looks like changing the meaning of the interrupt. What was the interrupt > here before? What interrupt is here now? > The change from interrupts to interrupts-extended does not change the source or meaning of the interrupt itself. For first-level INTC-IC nodes, the parent is the GIC, so we use interrupts. For second-level (cascaded) INTC-IC nodes, the parent is an input on INTC0, so interrupts-extended is required to correctly reflect the hardware chain as described in the datasheet. This ensures the DT matches the hardware hierarchy?the actual interrupt source and routing path are not changed, only described more precisely. > > }; > > In yaml, I can use: > > oneOf: > > - required: [interrupts] > > - required: [interrupts-extended] > > This allows both cases to be valid. > > > Hm? Since when you need both cases? The oneOf schema allows the binding to support both scenarios, matching the hardware and software requirements. first-level INTC-IC nodes required [interrupts] second-level (cascaded) required [interrupts-extended] > > > Best regards, > Krzysztof From rentao.bupt at gmail.com Mon Jul 28 15:34:35 2025 From: rentao.bupt at gmail.com (Tao Ren) Date: Sun, 27 Jul 2025 22:34:35 -0700 Subject: [PATCH v3 10/13] ARM: dts: aspeed: Add Facebook Fuji-data64 (AST2600) Board In-Reply-To: <9897e0a4-7c70-4e27-8591-09e9d6ef2263@lunn.ch> References: <20250723233013.142337-1-rentao.bupt@gmail.com> <20250723233013.142337-11-rentao.bupt@gmail.com> <769d6817-ee97-4a23-b013-29bc875a00cb@lunn.ch> <9897e0a4-7c70-4e27-8591-09e9d6ef2263@lunn.ch> Message-ID: On Sun, Jul 27, 2025 at 05:45:51PM +0200, Andrew Lunn wrote: > > As I'm not 100% sure where the RX clock delay is introduced, I will drop > > mac3 entry in v4. > > Many of the hyperscalers, or the supplies to the hyperscalers keep > hitting this. The standard policy at the moment seems to be to drop > Ethernet support. How useful is a BMC without Ethernet? > > If you all got together and talked to aspeed, apply a bit of pressure, > it should be possible to get this mess fixed pretty quickly. And then > you could all have working Ethernet.... Hi Andrew, I've already reached out to Ryan and Jacky from ASPEED regarding the topic a few weeks ago. Originally I thought MAC-side clock delay was only needed for fixed-linked (for example, in darwin dts), but looks like it's also impacting platforms with PHY.. Anyways I will follow up with Jacky/Ryan after addressing all the comments for this patch series. Thanks, Tao From rentao.bupt at gmail.com Mon Jul 28 15:56:02 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sun, 27 Jul 2025 22:56:02 -0700 Subject: [PATCH v4 00/13] ARM: dts: aspeed: Add Meta Darwin dts Message-ID: <20250728055618.61616-1-rentao.bupt@gmail.com> From: Tao Ren The patch series introduces the initial device tree for Meta/Facebook Darwin AST2600 BMC. Patches #1, #2 and #3 fixes the DTB warnings in wedge400/fuji dts and ast2600-facebook-netbmc-common.dtsi. Patch #4 moves eMMC entries from ast2600-facebook-netbmc-common.dtsi to each BMC platform because eMMC was removed from future Meta Network BMC platforms. Patch #5 introduces new BMC flash layout with 64MB data partition. Patches #6, #7 and #8 add "wedge400-data64-bmc" board. "wedge400-bmc" and "wedge400-data64-bmc" are identical except BMC flash layout. Patches #9, #10 and #11 add "fuji-data64-bmc" board. "fuji-bmc" and "fuji-data64-bmc" are identical except BMC flash layout. Patches #12 and #13 add Meta Darwin BMC and updates devicetree bindings. Tao Ren (13): ARM: dts: aspeed: wedge400: Fix DTB warnings ARM: dts: aspeed: fuji: Fix DTB warnings ARM: dts: aspeed: Fix DTB warnings in ast2600-facebook-netbmc-common.dtsi ARM: dts: aspeed: Move eMMC out of ast2600-facebook-netbmc-common.dtsi ARM: dts: aspeed: Add facebook-bmc-flash-layout-128-data64.dtsi dt-bindings: arm: aspeed: add Facebook Wedge400-data64 board ARM: dts: aspeed: Add Facebook Wedge400-data64 (AST2500) BMC ARM: dts: aspeed: wedge400: Include wedge400-data64.dts dt-bindings: arm: aspeed: add Facebook Fuji-data64 board ARM: dts: aspeed: Add Facebook Fuji-data64 (AST2600) Board ARM: dts: aspeed: facebook-fuji: Include facebook-fuji-data64.dts dt-bindings: arm: aspeed: add Facebook Darwin board ARM: dts: aspeed: Add Facebook Darwin (AST2600) BMC .../bindings/arm/aspeed/aspeed.yaml | 3 + arch/arm/boot/dts/aspeed/Makefile | 3 + .../dts/aspeed/aspeed-bmc-facebook-darwin.dts | 72 + .../dts/aspeed/aspeed-bmc-facebook-elbert.dts | 12 + .../aspeed-bmc-facebook-fuji-data64.dts | 1256 +++++++++++++++++ .../dts/aspeed/aspeed-bmc-facebook-fuji.dts | 1245 +--------------- .../aspeed-bmc-facebook-wedge400-data64.dts | 375 +++++ .../aspeed/aspeed-bmc-facebook-wedge400.dts | 366 +---- .../ast2600-facebook-netbmc-common.dtsi | 22 +- .../facebook-bmc-flash-layout-128-data64.dtsi | 60 + 10 files changed, 1795 insertions(+), 1619 deletions(-) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dts create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dts create mode 100644 arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128-data64.dtsi -- 2.47.3 From rentao.bupt at gmail.com Mon Jul 28 15:56:03 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sun, 27 Jul 2025 22:56:03 -0700 Subject: [PATCH v4 01/13] ARM: dts: aspeed: wedge400: Fix DTB warnings In-Reply-To: <20250728055618.61616-1-rentao.bupt@gmail.com> References: <20250728055618.61616-1-rentao.bupt@gmail.com> Message-ID: <20250728055618.61616-2-rentao.bupt@gmail.com> From: Tao Ren Fix the deprecated spi-gpio properties in wedge400 dts. Signed-off-by: Tao Ren --- Changes in v4: - None. Changes in v3: - None. Changes in v2: - None (the patch is introduced in v2). arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts index 5a8169bbda87..3e4d30f0884d 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts @@ -75,9 +75,9 @@ spi_gpio: spi { #size-cells = <0>; cs-gpios = <&gpio ASPEED_GPIO(R, 2) GPIO_ACTIVE_LOW>; - gpio-sck = <&gpio ASPEED_GPIO(R, 3) GPIO_ACTIVE_HIGH>; - gpio-mosi = <&gpio ASPEED_GPIO(R, 4) GPIO_ACTIVE_HIGH>; - gpio-miso = <&gpio ASPEED_GPIO(R, 5) GPIO_ACTIVE_HIGH>; + sck-gpios = <&gpio ASPEED_GPIO(R, 3) GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio ASPEED_GPIO(R, 4) GPIO_ACTIVE_HIGH>; + miso-gpios = <&gpio ASPEED_GPIO(R, 5) GPIO_ACTIVE_HIGH>; num-chipselects = <1>; tpm at 0 { -- 2.47.3 From rentao.bupt at gmail.com Mon Jul 28 15:56:04 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sun, 27 Jul 2025 22:56:04 -0700 Subject: [PATCH v4 02/13] ARM: dts: aspeed: fuji: Fix DTB warnings In-Reply-To: <20250728055618.61616-1-rentao.bupt@gmail.com> References: <20250728055618.61616-1-rentao.bupt@gmail.com> Message-ID: <20250728055618.61616-3-rentao.bupt@gmail.com> From: Tao Ren Remove redundant adm1278 properties from fuji dts. Signed-off-by: Tao Ren --- Changes in v4: - None. Changes in v3: - None. Changes in v2: - None (the patch is introduced in v2). arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts index f23c26a3441d..840d19d6b1d4 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts @@ -248,8 +248,6 @@ imux16: i2c at 0 { adm1278 at 10 { compatible = "adi,adm1278"; reg = <0x10>; - #address-cells = <1>; - #size-cells = <0>; shunt-resistor-micro-ohms = <1500>; }; }; @@ -577,8 +575,6 @@ imux67: i2c at 3 { adm1278 at 10 { compatible = "adi,adm1278"; reg = <0x10>; - #address-cells = <1>; - #size-cells = <0>; shunt-resistor-micro-ohms = <250>; }; }; @@ -648,8 +644,6 @@ imux75: i2c at 3 { adm1278 at 10 { compatible = "adi,adm1278"; reg = <0x10>; - #address-cells = <1>; - #size-cells = <0>; shunt-resistor-micro-ohms = <250>; }; }; -- 2.47.3 From rentao.bupt at gmail.com Mon Jul 28 15:56:05 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sun, 27 Jul 2025 22:56:05 -0700 Subject: [PATCH v4 03/13] ARM: dts: aspeed: Fix DTB warnings in ast2600-facebook-netbmc-common.dtsi In-Reply-To: <20250728055618.61616-1-rentao.bupt@gmail.com> References: <20250728055618.61616-1-rentao.bupt@gmail.com> Message-ID: <20250728055618.61616-4-rentao.bupt@gmail.com> From: Tao Ren Fix deprecated spi-gpio properties in ast2600-facebook-netbmc-common.dtsi. Signed-off-by: Tao Ren --- Changes in v4: - None. Changes in v3: - None. Changes in v2: - None (the patch is introduced in v2). .../dts/aspeed/ast2600-facebook-netbmc-common.dtsi | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi b/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi index 00e5887c926f..208cf6567ed4 100644 --- a/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi +++ b/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi @@ -31,9 +31,13 @@ spi_gpio: spi { #address-cells = <1>; #size-cells = <0>; - gpio-sck = <&gpio0 ASPEED_GPIO(X, 3) GPIO_ACTIVE_HIGH>; - gpio-mosi = <&gpio0 ASPEED_GPIO(X, 4) GPIO_ACTIVE_HIGH>; - gpio-miso = <&gpio0 ASPEED_GPIO(X, 5) GPIO_ACTIVE_HIGH>; + /* + * chipselect pins are defined in platform .dts files + * separately. + */ + sck-gpios = <&gpio0 ASPEED_GPIO(X, 3) GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio0 ASPEED_GPIO(X, 4) GPIO_ACTIVE_HIGH>; + miso-gpios = <&gpio0 ASPEED_GPIO(X, 5) GPIO_ACTIVE_HIGH>; tpm at 0 { compatible = "infineon,slb9670", "tcg,tpm_tis-spi"; -- 2.47.3 From rentao.bupt at gmail.com Mon Jul 28 15:56:06 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sun, 27 Jul 2025 22:56:06 -0700 Subject: [PATCH v4 04/13] ARM: dts: aspeed: Move eMMC out of ast2600-facebook-netbmc-common.dtsi In-Reply-To: <20250728055618.61616-1-rentao.bupt@gmail.com> References: <20250728055618.61616-1-rentao.bupt@gmail.com> Message-ID: <20250728055618.61616-5-rentao.bupt@gmail.com> From: Tao Ren Move eMMC entries from ast2600-facebook-netbmc-common.dtsi to each platform because eMMC is removed from future Meta/Facebook AST2600 Network BMC platforms. Signed-off-by: Tao Ren --- Changes in v4: - None. Changes in v3: - None. Changes in v2: - The 3 emmc-related patches in v1 are squashed into this patch. .../boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts | 12 ++++++++++++ .../arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts | 12 ++++++++++++ .../dts/aspeed/ast2600-facebook-netbmc-common.dtsi | 12 ------------ 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts index 74f3c67e0eff..ff1009ea1c49 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-elbert.dts @@ -201,3 +201,15 @@ fixed-link { full-duplex; }; }; + +&emmc_controller { + status = "okay"; +}; + +&emmc { + status = "okay"; + + non-removable; + max-frequency = <25000000>; + bus-width = <4>; +}; diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts index 840d19d6b1d4..d0331980d082 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts @@ -1243,3 +1243,15 @@ &mac3 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_rgmii4_default>; }; + +&emmc_controller { + status = "okay"; +}; + +&emmc { + status = "okay"; + + non-removable; + max-frequency = <25000000>; + bus-width = <4>; +}; diff --git a/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi b/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi index 208cf6567ed4..0ef225acddfc 100644 --- a/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi +++ b/arch/arm/boot/dts/aspeed/ast2600-facebook-netbmc-common.dtsi @@ -156,18 +156,6 @@ &vhub { status = "okay"; }; -&emmc_controller { - status = "okay"; -}; - -&emmc { - status = "okay"; - - non-removable; - max-frequency = <25000000>; - bus-width = <4>; -}; - &rtc { status = "okay"; }; -- 2.47.3 From rentao.bupt at gmail.com Mon Jul 28 15:56:07 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sun, 27 Jul 2025 22:56:07 -0700 Subject: [PATCH v4 05/13] ARM: dts: aspeed: Add facebook-bmc-flash-layout-128-data64.dtsi In-Reply-To: <20250728055618.61616-1-rentao.bupt@gmail.com> References: <20250728055618.61616-1-rentao.bupt@gmail.com> Message-ID: <20250728055618.61616-6-rentao.bupt@gmail.com> From: Tao Ren Add facebook-bmc-flash-layout-128-data64.dts (with 64MB datastore) to be used by Meta Network BMC platforms. Signed-off-by: Tao Ren --- Changes in v4: - None. Changes in v3: - None. Changes in v2: - None (the patch is introduced in v2 per Andrew's suggestion). .../facebook-bmc-flash-layout-128-data64.dtsi | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128-data64.dtsi diff --git a/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128-data64.dtsi b/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128-data64.dtsi new file mode 100644 index 000000000000..efd92232cda2 --- /dev/null +++ b/arch/arm/boot/dts/aspeed/facebook-bmc-flash-layout-128-data64.dtsi @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Copyright (c) 2020 Facebook Inc. + +partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* + * u-boot partition: 896KB. + */ + u-boot at 0 { + reg = <0x0 0xe0000>; + label = "u-boot"; + }; + + /* + * u-boot environment variables: 64KB. + */ + u-boot-env at e0000 { + reg = <0xe0000 0x10000>; + label = "env"; + }; + + /* + * image metadata partition (64KB), used by Facebook internal + * tools. + */ + image-meta at f0000 { + reg = <0xf0000 0x10000>; + label = "meta"; + }; + + /* + * FIT image: 63 MB. + */ + fit at 100000 { + reg = <0x100000 0x3f00000>; + label = "fit"; + }; + + /* + * "data0" partition (64MB) is used by Facebook BMC platforms as + * persistent data store. + */ + data0 at 4000000 { + reg = <0x4000000 0x4000000>; + label = "data0"; + }; + + /* + * Although the master partition can be created by enabling + * MTD_PARTITIONED_MASTER option, below "flash0" partition is + * explicitly created to avoid breaking legacy applications. + */ + flash0 at 0 { + reg = <0x0 0x8000000>; + label = "flash0"; + }; +}; -- 2.47.3 From rentao.bupt at gmail.com Mon Jul 28 15:56:08 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sun, 27 Jul 2025 22:56:08 -0700 Subject: [PATCH v4 06/13] dt-bindings: arm: aspeed: add Facebook Wedge400-data64 board In-Reply-To: <20250728055618.61616-1-rentao.bupt@gmail.com> References: <20250728055618.61616-1-rentao.bupt@gmail.com> Message-ID: <20250728055618.61616-7-rentao.bupt@gmail.com> From: Tao Ren Document the new compatibles used on Meta/Facebook Wedge400-data64 board. Signed-off-by: Tao Ren Acked-by: Krzysztof Kozlowski --- Changes in v4: - None. Changes in v3: - None (the patch is introduced in v3). Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml index 01333ac111fb..0c9d6a30dce0 100644 --- a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml +++ b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml @@ -46,6 +46,7 @@ properties: - facebook,yamp-bmc - facebook,yosemitev2-bmc - facebook,wedge400-bmc + - facebook,wedge400-data64-bmc - hxt,stardragon4800-rep2-bmc - ibm,mihawk-bmc - ibm,mowgli-bmc -- 2.47.3 From rentao.bupt at gmail.com Mon Jul 28 15:56:09 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sun, 27 Jul 2025 22:56:09 -0700 Subject: [PATCH v4 07/13] ARM: dts: aspeed: Add Facebook Wedge400-data64 (AST2500) BMC In-Reply-To: <20250728055618.61616-1-rentao.bupt@gmail.com> References: <20250728055618.61616-1-rentao.bupt@gmail.com> Message-ID: <20250728055618.61616-8-rentao.bupt@gmail.com> From: Tao Ren Add wedge400-data64.dts to extend wedge400's data0 partition from 8MB to 64MB smoothly. wedge400-data64.dts is copied from wedge400.dts with below changes: - updating model/compatible strings. - updating flash0 partition. Signed-off-by: Tao Ren --- Changes in v4: - Removed redundant bootargs from dts. Changes in v3: - None (the patch is introduced in v3). arch/arm/boot/dts/aspeed/Makefile | 1 + .../aspeed-bmc-facebook-wedge400-data64.dts | 375 ++++++++++++++++++ 2 files changed, 376 insertions(+) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dts diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile index 2e5f4833a073..55be25acfc80 100644 --- a/arch/arm/boot/dts/aspeed/Makefile +++ b/arch/arm/boot/dts/aspeed/Makefile @@ -30,6 +30,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ aspeed-bmc-facebook-tiogapass.dtb \ aspeed-bmc-facebook-wedge40.dtb \ aspeed-bmc-facebook-wedge100.dtb \ + aspeed-bmc-facebook-wedge400-data64.dtb \ aspeed-bmc-facebook-wedge400.dtb \ aspeed-bmc-facebook-yamp.dtb \ aspeed-bmc-facebook-yosemitev2.dtb \ diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dts new file mode 100644 index 000000000000..1d46eaee8656 --- /dev/null +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400-data64.dts @@ -0,0 +1,375 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Copyright (c) 2019 Facebook Inc. +/dts-v1/; + +#include +#include "ast2500-facebook-netbmc-common.dtsi" + +/ { + model = "Facebook Wedge 400 BMC (64MB Datastore)"; + compatible = "facebook,wedge400-data64-bmc", "aspeed,ast2500"; + + aliases { + /* + * PCA9548 (2-0070) provides 8 channels connecting to + * SCM (System Controller Module). + */ + i2c16 = &imux16; + i2c17 = &imux17; + i2c18 = &imux18; + i2c19 = &imux19; + i2c20 = &imux20; + i2c21 = &imux21; + i2c22 = &imux22; + i2c23 = &imux23; + + /* + * PCA9548 (8-0070) provides 8 channels connecting to + * SMB (Switch Main Board). + */ + i2c24 = &imux24; + i2c25 = &imux25; + i2c26 = &imux26; + i2c27 = &imux27; + i2c28 = &imux28; + i2c29 = &imux29; + i2c30 = &imux30; + i2c31 = &imux31; + + /* + * PCA9548 (11-0076) provides 8 channels connecting to + * FCM (Fan Controller Module). + */ + i2c32 = &imux32; + i2c33 = &imux33; + i2c34 = &imux34; + i2c35 = &imux35; + i2c36 = &imux36; + i2c37 = &imux37; + i2c38 = &imux38; + i2c39 = &imux39; + + spi2 = &spi_gpio; + }; + + chosen { + stdout-path = &uart1; + }; + + ast-adc-hwmon { + compatible = "iio-hwmon"; + io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>, <&adc 4>, + <&adc 5>, <&adc 6>, <&adc 7>, <&adc 8>; + }; + + /* + * GPIO-based SPI Master is required to access SPI TPM, because + * full-duplex SPI transactions are not supported by ASPEED SPI + * Controllers. + */ + spi_gpio: spi { + status = "okay"; + compatible = "spi-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + cs-gpios = <&gpio ASPEED_GPIO(R, 2) GPIO_ACTIVE_LOW>; + sck-gpios = <&gpio ASPEED_GPIO(R, 3) GPIO_ACTIVE_HIGH>; + mosi-gpios = <&gpio ASPEED_GPIO(R, 4) GPIO_ACTIVE_HIGH>; + miso-gpios = <&gpio ASPEED_GPIO(R, 5) GPIO_ACTIVE_HIGH>; + num-chipselects = <1>; + + tpm at 0 { + compatible = "infineon,slb9670", "tcg,tpm_tis-spi"; + spi-max-frequency = <33000000>; + reg = <0>; + }; + }; +}; + +/* + * Both firmware flashes are 128MB on Wedge400 BMC. + */ +&fmc_flash0 { +#include "facebook-bmc-flash-layout-128-data64.dtsi" +}; + +&fmc_flash1 { + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + flash1 at 0 { + reg = <0x0 0x8000000>; + label = "flash1"; + }; + }; +}; + +&uart2 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_txd2_default + &pinctrl_rxd2_default>; +}; + +&uart4 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_txd4_default + &pinctrl_rxd4_default>; +}; + +/* + * I2C bus #0 is multi-master environment dedicated for BMC and Bridge IC + * communication. + */ +&i2c0 { + status = "okay"; + multi-master; + bus-frequency = <1000000>; +}; + +&i2c1 { + status = "okay"; +}; + +&i2c2 { + status = "okay"; + + i2c-mux at 70 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x70>; + i2c-mux-idle-disconnect; + + imux16: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux17: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux18: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux19: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux20: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux21: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux22: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux23: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; +}; + +&i2c3 { + status = "okay"; +}; + +&i2c4 { + status = "okay"; +}; + +&i2c5 { + status = "okay"; +}; + +&i2c6 { + status = "okay"; +}; + +&i2c7 { + status = "okay"; +}; + +&i2c8 { + status = "okay"; + + i2c-mux at 70 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x70>; + i2c-mux-idle-disconnect; + + imux24: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux25: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux26: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux27: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux28: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux29: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux30: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux31: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + + }; +}; + +&i2c9 { + status = "okay"; +}; + +&i2c10 { + status = "okay"; +}; + +&i2c11 { + status = "okay"; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux32: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux33: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux34: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux35: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux36: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux37: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux38: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux39: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + + }; +}; + +&i2c12 { + status = "okay"; +}; + +&i2c13 { + status = "okay"; +}; + +&adc { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&uhci { + status = "okay"; +}; + +&sdhci1 { + max-frequency = <25000000>; + /* + * DMA mode needs to be disabled to avoid conflicts with UHCI + * Controller in AST2500 SoC. + */ + sdhci-caps-mask = <0x0 0x580000>; +}; -- 2.47.3 From rentao.bupt at gmail.com Mon Jul 28 15:56:10 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sun, 27 Jul 2025 22:56:10 -0700 Subject: [PATCH v4 08/13] ARM: dts: aspeed: wedge400: Include wedge400-data64.dts In-Reply-To: <20250728055618.61616-1-rentao.bupt@gmail.com> References: <20250728055618.61616-1-rentao.bupt@gmail.com> Message-ID: <20250728055618.61616-9-rentao.bupt@gmail.com> From: Tao Ren Include "wedge400-data64.dts" in wedge400 dts to avoid duplicated code. Wedge400-data64 and Wedge400 are identical except the BMC flash layout. Signed-off-by: Tao Ren --- Changes in v4: - None. Changes in v3: - None (the patch is introduced in v3). .../aspeed/aspeed-bmc-facebook-wedge400.dts | 366 +----------------- 1 file changed, 2 insertions(+), 364 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts index 3e4d30f0884d..ef0cfc51cda4 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-wedge400.dts @@ -1,376 +1,14 @@ // SPDX-License-Identifier: GPL-2.0+ // Copyright (c) 2019 Facebook Inc. -/dts-v1/; -#include -#include "ast2500-facebook-netbmc-common.dtsi" +#include "aspeed-bmc-facebook-wedge400-data64.dts" / { model = "Facebook Wedge 400 BMC"; compatible = "facebook,wedge400-bmc", "aspeed,ast2500"; - - aliases { - /* - * PCA9548 (2-0070) provides 8 channels connecting to - * SCM (System Controller Module). - */ - i2c16 = &imux16; - i2c17 = &imux17; - i2c18 = &imux18; - i2c19 = &imux19; - i2c20 = &imux20; - i2c21 = &imux21; - i2c22 = &imux22; - i2c23 = &imux23; - - /* - * PCA9548 (8-0070) provides 8 channels connecting to - * SMB (Switch Main Board). - */ - i2c24 = &imux24; - i2c25 = &imux25; - i2c26 = &imux26; - i2c27 = &imux27; - i2c28 = &imux28; - i2c29 = &imux29; - i2c30 = &imux30; - i2c31 = &imux31; - - /* - * PCA9548 (11-0076) provides 8 channels connecting to - * FCM (Fan Controller Module). - */ - i2c32 = &imux32; - i2c33 = &imux33; - i2c34 = &imux34; - i2c35 = &imux35; - i2c36 = &imux36; - i2c37 = &imux37; - i2c38 = &imux38; - i2c39 = &imux39; - - spi2 = &spi_gpio; - }; - - chosen { - stdout-path = &uart1; - bootargs = "console=ttyS0,9600n8 root=/dev/ram rw"; - }; - - ast-adc-hwmon { - compatible = "iio-hwmon"; - io-channels = <&adc 0>, <&adc 1>, <&adc 2>, <&adc 3>, <&adc 4>, - <&adc 5>, <&adc 6>, <&adc 7>, <&adc 8>; - }; - - /* - * GPIO-based SPI Master is required to access SPI TPM, because - * full-duplex SPI transactions are not supported by ASPEED SPI - * Controllers. - */ - spi_gpio: spi { - status = "okay"; - compatible = "spi-gpio"; - #address-cells = <1>; - #size-cells = <0>; - - cs-gpios = <&gpio ASPEED_GPIO(R, 2) GPIO_ACTIVE_LOW>; - sck-gpios = <&gpio ASPEED_GPIO(R, 3) GPIO_ACTIVE_HIGH>; - mosi-gpios = <&gpio ASPEED_GPIO(R, 4) GPIO_ACTIVE_HIGH>; - miso-gpios = <&gpio ASPEED_GPIO(R, 5) GPIO_ACTIVE_HIGH>; - num-chipselects = <1>; - - tpm at 0 { - compatible = "infineon,slb9670", "tcg,tpm_tis-spi"; - spi-max-frequency = <33000000>; - reg = <0>; - }; - }; }; -/* - * Both firmware flashes are 128MB on Wedge400 BMC. - */ &fmc_flash0 { + /delete-node/partitions; #include "facebook-bmc-flash-layout-128.dtsi" }; - -&fmc_flash1 { - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - flash1 at 0 { - reg = <0x0 0x8000000>; - label = "flash1"; - }; - }; -}; - -&uart2 { - status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_txd2_default - &pinctrl_rxd2_default>; -}; - -&uart4 { - status = "okay"; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_txd4_default - &pinctrl_rxd4_default>; -}; - -/* - * I2C bus #0 is multi-master environment dedicated for BMC and Bridge IC - * communication. - */ -&i2c0 { - status = "okay"; - multi-master; - bus-frequency = <1000000>; -}; - -&i2c1 { - status = "okay"; -}; - -&i2c2 { - status = "okay"; - - i2c-mux at 70 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x70>; - i2c-mux-idle-disconnect; - - imux16: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux17: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux18: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux19: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux20: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux21: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux22: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux23: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; -}; - -&i2c3 { - status = "okay"; -}; - -&i2c4 { - status = "okay"; -}; - -&i2c5 { - status = "okay"; -}; - -&i2c6 { - status = "okay"; -}; - -&i2c7 { - status = "okay"; -}; - -&i2c8 { - status = "okay"; - - i2c-mux at 70 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x70>; - i2c-mux-idle-disconnect; - - imux24: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux25: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux26: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux27: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux28: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux29: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux30: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux31: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - - }; -}; - -&i2c9 { - status = "okay"; -}; - -&i2c10 { - status = "okay"; -}; - -&i2c11 { - status = "okay"; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux32: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux33: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux34: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux35: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux36: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux37: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux38: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux39: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - - }; -}; - -&i2c12 { - status = "okay"; -}; - -&i2c13 { - status = "okay"; -}; - -&adc { - status = "okay"; -}; - -&ehci1 { - status = "okay"; -}; - -&uhci { - status = "okay"; -}; - -&sdhci1 { - max-frequency = <25000000>; - /* - * DMA mode needs to be disabled to avoid conflicts with UHCI - * Controller in AST2500 SoC. - */ - sdhci-caps-mask = <0x0 0x580000>; -}; -- 2.47.3 From rentao.bupt at gmail.com Mon Jul 28 15:56:11 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sun, 27 Jul 2025 22:56:11 -0700 Subject: [PATCH v4 09/13] dt-bindings: arm: aspeed: add Facebook Fuji-data64 board In-Reply-To: <20250728055618.61616-1-rentao.bupt@gmail.com> References: <20250728055618.61616-1-rentao.bupt@gmail.com> Message-ID: <20250728055618.61616-10-rentao.bupt@gmail.com> From: Tao Ren Document the new compatibles used on Meta/Facebook Fuji-data64 board. Signed-off-by: Tao Ren --- Changes in v4: - None. Changes in v3: - None (the patch is introduced in v3). Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml index 0c9d6a30dce0..3cc6e62ae5f3 100644 --- a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml +++ b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml @@ -85,6 +85,7 @@ properties: - facebook,cloudripper-bmc - facebook,elbert-bmc - facebook,fuji-bmc + - facebook,fuji-data64-bmc - facebook,greatlakes-bmc - facebook,harma-bmc - facebook,minerva-cmc -- 2.47.3 From rentao.bupt at gmail.com Mon Jul 28 15:56:12 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sun, 27 Jul 2025 22:56:12 -0700 Subject: [PATCH v4 10/13] ARM: dts: aspeed: Add Facebook Fuji-data64 (AST2600) Board In-Reply-To: <20250728055618.61616-1-rentao.bupt@gmail.com> References: <20250728055618.61616-1-rentao.bupt@gmail.com> Message-ID: <20250728055618.61616-11-rentao.bupt@gmail.com> From: Tao Ren Introduce fuji-data64.dts to extend Meta/Facebook Fuji BMC's data0 partition without breaking the existing users. Fuji-data64.dts is copied from fuji.dts with below changes: - updating model/compatible strings. - updating FMC flash0' data0 partition to 64MB. - removing mac3. Signed-off-by: Tao Ren --- Changes in v4: - Removed mac3 from dts. Changes in v3: - None (the patch is introduced in v3). arch/arm/boot/dts/aspeed/Makefile | 1 + .../aspeed-bmc-facebook-fuji-data64.dts | 1256 +++++++++++++++++ 2 files changed, 1257 insertions(+) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dts diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile index 55be25acfc80..f6e714b7db2d 100644 --- a/arch/arm/boot/dts/aspeed/Makefile +++ b/arch/arm/boot/dts/aspeed/Makefile @@ -21,6 +21,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ aspeed-bmc-facebook-catalina.dtb \ aspeed-bmc-facebook-cmm.dtb \ aspeed-bmc-facebook-elbert.dtb \ + aspeed-bmc-facebook-fuji-data64.dtb \ aspeed-bmc-facebook-fuji.dtb \ aspeed-bmc-facebook-galaxy100.dtb \ aspeed-bmc-facebook-greatlakes.dtb \ diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dts new file mode 100644 index 000000000000..aa9576d8ab56 --- /dev/null +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dts @@ -0,0 +1,1256 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Copyright (c) 2020 Facebook Inc. + +/dts-v1/; + +#include +#include "ast2600-facebook-netbmc-common.dtsi" + +/ { + model = "Facebook Fuji BMC (64MB Datastore)"; + compatible = "facebook,fuji-data64-bmc", "aspeed,ast2600"; + + aliases { + /* + * PCA9548 (2-0070) provides 8 channels connecting to + * SCM (System Controller Module). + */ + i2c16 = &imux16; + i2c17 = &imux17; + i2c18 = &imux18; + i2c19 = &imux19; + i2c20 = &imux20; + i2c21 = &imux21; + i2c22 = &imux22; + i2c23 = &imux23; + + /* + * PCA9548 (8-0070) provides 8 channels connecting to + * SMB (Switch Main Board). + */ + i2c24 = &imux24; + i2c25 = &imux25; + i2c26 = &imux26; + i2c27 = &imux27; + i2c28 = &imux28; + i2c29 = &imux29; + i2c30 = &imux30; + i2c31 = &imux31; + + /* + * PCA9548 (11-0077) provides 8 channels connecting to + * SMB (Switch Main Board). + */ + i2c40 = &imux40; + i2c41 = &imux41; + i2c42 = &imux42; + i2c43 = &imux43; + i2c44 = &imux44; + i2c45 = &imux45; + i2c46 = &imux46; + i2c47 = &imux47; + + /* + * PCA9548 (24-0071) provides 8 channels connecting to + * PDB-Left. + */ + i2c48 = &imux48; + i2c49 = &imux49; + i2c50 = &imux50; + i2c51 = &imux51; + i2c52 = &imux52; + i2c53 = &imux53; + i2c54 = &imux54; + i2c55 = &imux55; + + /* + * PCA9548 (25-0072) provides 8 channels connecting to + * PDB-Right. + */ + i2c56 = &imux56; + i2c57 = &imux57; + i2c58 = &imux58; + i2c59 = &imux59; + i2c60 = &imux60; + i2c61 = &imux61; + i2c62 = &imux62; + i2c63 = &imux63; + + /* + * PCA9548 (26-0076) provides 8 channels connecting to + * FCM1. + */ + i2c64 = &imux64; + i2c65 = &imux65; + i2c66 = &imux66; + i2c67 = &imux67; + i2c68 = &imux68; + i2c69 = &imux69; + i2c70 = &imux70; + i2c71 = &imux71; + + /* + * PCA9548 (27-0076) provides 8 channels connecting to + * FCM2. + */ + i2c72 = &imux72; + i2c73 = &imux73; + i2c74 = &imux74; + i2c75 = &imux75; + i2c76 = &imux76; + i2c77 = &imux77; + i2c78 = &imux78; + i2c79 = &imux79; + + /* + * PCA9548 (40-0076) provides 8 channels connecting to + * PIM1. + */ + i2c80 = &imux80; + i2c81 = &imux81; + i2c82 = &imux82; + i2c83 = &imux83; + i2c84 = &imux84; + i2c85 = &imux85; + i2c86 = &imux86; + i2c87 = &imux87; + + /* + * PCA9548 (41-0076) provides 8 channels connecting to + * PIM2. + */ + i2c88 = &imux88; + i2c89 = &imux89; + i2c90 = &imux90; + i2c91 = &imux91; + i2c92 = &imux92; + i2c93 = &imux93; + i2c94 = &imux94; + i2c95 = &imux95; + + /* + * PCA9548 (42-0076) provides 8 channels connecting to + * PIM3. + */ + i2c96 = &imux96; + i2c97 = &imux97; + i2c98 = &imux98; + i2c99 = &imux99; + i2c100 = &imux100; + i2c101 = &imux101; + i2c102 = &imux102; + i2c103 = &imux103; + + /* + * PCA9548 (43-0076) provides 8 channels connecting to + * PIM4. + */ + i2c104 = &imux104; + i2c105 = &imux105; + i2c106 = &imux106; + i2c107 = &imux107; + i2c108 = &imux108; + i2c109 = &imux109; + i2c110 = &imux110; + i2c111 = &imux111; + + /* + * PCA9548 (44-0076) provides 8 channels connecting to + * PIM5. + */ + i2c112 = &imux112; + i2c113 = &imux113; + i2c114 = &imux114; + i2c115 = &imux115; + i2c116 = &imux116; + i2c117 = &imux117; + i2c118 = &imux118; + i2c119 = &imux119; + + /* + * PCA9548 (45-0076) provides 8 channels connecting to + * PIM6. + */ + i2c120 = &imux120; + i2c121 = &imux121; + i2c122 = &imux122; + i2c123 = &imux123; + i2c124 = &imux124; + i2c125 = &imux125; + i2c126 = &imux126; + i2c127 = &imux127; + + /* + * PCA9548 (46-0076) provides 8 channels connecting to + * PIM7. + */ + i2c128 = &imux128; + i2c129 = &imux129; + i2c130 = &imux130; + i2c131 = &imux131; + i2c132 = &imux132; + i2c133 = &imux133; + i2c134 = &imux134; + i2c135 = &imux135; + + /* + * PCA9548 (47-0076) provides 8 channels connecting to + * PIM8. + */ + i2c136 = &imux136; + i2c137 = &imux137; + i2c138 = &imux138; + i2c139 = &imux139; + i2c140 = &imux140; + i2c141 = &imux141; + i2c142 = &imux142; + i2c143 = &imux143; + }; + + spi_gpio: spi { + num-chipselects = <3>; + cs-gpios = <&gpio0 ASPEED_GPIO(X, 0) GPIO_ACTIVE_LOW>, + <0>, /* device reg=<1> does not exist */ + <&gpio0 ASPEED_GPIO(X, 2) GPIO_ACTIVE_HIGH>; + + eeprom at 2 { + compatible = "atmel,at93c46d"; + spi-max-frequency = <250000>; + data-size = <16>; + spi-cs-high; + reg = <2>; + }; + }; +}; + +&fmc { + flash at 0 { + /delete-node/partitions; +#include "facebook-bmc-flash-layout-128-data64.dtsi" + }; +}; + +&i2c0 { + multi-master; + bus-frequency = <1000000>; +}; + +&i2c2 { + /* + * PCA9548 (2-0070) provides 8 channels connecting to SCM (System + * Controller Module). + */ + i2c-mux at 70 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x70>; + i2c-mux-idle-disconnect; + + imux16: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + adm1278 at 10 { + compatible = "adi,adm1278"; + reg = <0x10>; + shunt-resistor-micro-ohms = <1500>; + }; + }; + + imux17: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux18: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux19: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux20: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux21: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux22: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux23: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; +}; + +&i2c8 { + /* + * PCA9548 (8-0070) provides 8 channels connecting to SMB (Switch + * Main Board). + */ + i2c-mux at 70 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x70>; + i2c-mux-idle-disconnect; + + imux24: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + i2c-mux at 71 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x71>; + i2c-mux-idle-disconnect; + + imux48: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux49: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux50: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + + lp5012 at 14 { + compatible = "ti,lp5012"; + reg = <0x14>; + #address-cells = <1>; + #size-cells = <0>; + + multi-led at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + color = ; + function = LED_FUNCTION_ACTIVITY; + label = "sys"; + + led at 0 { + reg = <0>; + color = ; + }; + + led at 1 { + reg = <1>; + color = ; + }; + + led at 2 { + reg = <2>; + color = ; + }; + }; + + multi-led at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + color = ; + function = LED_FUNCTION_ACTIVITY; + label = "fan"; + + led at 0 { + reg = <0>; + color = ; + }; + + led at 1 { + reg = <1>; + color = ; + }; + + led at 2 { + reg = <2>; + color = ; + }; + }; + + multi-led at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + color = ; + function = LED_FUNCTION_ACTIVITY; + label = "psu"; + + led at 0 { + reg = <0>; + color = ; + }; + + led at 1 { + reg = <1>; + color = ; + }; + + led at 2 { + reg = <2>; + color = ; + }; + }; + + multi-led at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + color = ; + function = LED_FUNCTION_ACTIVITY; + label = "smb"; + + led at 0 { + reg = <0>; + color = ; + }; + + led at 1 { + reg = <1>; + color = ; + }; + + led at 2 { + reg = <2>; + color = ; + }; + }; + }; + }; + + imux51: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux52: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux53: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux54: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux55: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux25: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + i2c-mux at 72 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x72>; + i2c-mux-idle-disconnect; + + imux56: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux57: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux58: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux59: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux60: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux61: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux62: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux63: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux26: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux64: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux65: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux66: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux67: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + + adm1278 at 10 { + compatible = "adi,adm1278"; + reg = <0x10>; + shunt-resistor-micro-ohms = <250>; + }; + }; + + imux68: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux69: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux70: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux71: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux27: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux72: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux73: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux74: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux75: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + + adm1278 at 10 { + compatible = "adi,adm1278"; + reg = <0x10>; + shunt-resistor-micro-ohms = <250>; + }; + }; + + imux76: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux77: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux78: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux79: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux28: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux29: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux30: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux31: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + + }; +}; + +&i2c11 { + status = "okay"; + + /* + * PCA9548 (11-0077) provides 8 channels connecting to SMB (Switch + * Main Board). + */ + i2c-mux at 77 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x77>; + i2c-mux-idle-disconnect; + + imux40: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux80: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux81: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux82: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux83: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux84: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux85: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux86: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux87: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux41: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux88: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux89: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux90: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux91: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux92: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux93: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux94: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux95: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux42: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux96: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux97: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux98: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux99: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux100: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux101: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux102: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux103: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux43: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux104: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux105: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux106: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux107: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux108: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux109: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux110: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux111: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux44: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux112: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux113: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux114: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux115: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux116: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux117: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux118: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux119: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux45: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux120: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux121: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux122: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux123: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux124: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux125: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux126: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux127: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux46: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux128: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux129: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux130: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux131: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux132: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux133: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux134: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux135: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + imux47: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + + i2c-mux at 76 { + compatible = "nxp,pca9548"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x76>; + i2c-mux-idle-disconnect; + + imux136: i2c at 0 { + #address-cells = <1>; + #size-cells = <0>; + reg = <0>; + }; + + imux137: i2c at 1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + }; + + imux138: i2c at 2 { + #address-cells = <1>; + #size-cells = <0>; + reg = <2>; + }; + + imux139: i2c at 3 { + #address-cells = <1>; + #size-cells = <0>; + reg = <3>; + }; + + imux140: i2c at 4 { + #address-cells = <1>; + #size-cells = <0>; + reg = <4>; + }; + + imux141: i2c at 5 { + #address-cells = <1>; + #size-cells = <0>; + reg = <5>; + }; + + imux142: i2c at 6 { + #address-cells = <1>; + #size-cells = <0>; + reg = <6>; + }; + + imux143: i2c at 7 { + #address-cells = <1>; + #size-cells = <0>; + reg = <7>; + }; + }; + + }; + + }; +}; + +&ehci1 { + status = "okay"; +}; + +&mdio1 { + status = "okay"; + + ethphy3: ethernet-phy at 13 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0x0d>; + }; +}; + +&emmc_controller { + status = "okay"; +}; + +&emmc { + status = "okay"; + + non-removable; + max-frequency = <25000000>; + bus-width = <4>; +}; -- 2.47.3 From rentao.bupt at gmail.com Mon Jul 28 15:56:13 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sun, 27 Jul 2025 22:56:13 -0700 Subject: [PATCH v4 11/13] ARM: dts: aspeed: facebook-fuji: Include facebook-fuji-data64.dts In-Reply-To: <20250728055618.61616-1-rentao.bupt@gmail.com> References: <20250728055618.61616-1-rentao.bupt@gmail.com> Message-ID: <20250728055618.61616-12-rentao.bupt@gmail.com> From: Tao Ren Include "facebook-fuji-data64.dts" in facebook-fuji dts to avoid duplicated code. Fuji-data64 and Fuji are identical except the BMC flash layout. Signed-off-by: Tao Ren --- Changes in v4: - None. Changes in v3: - None (the patch is introduced in v3). .../dts/aspeed/aspeed-bmc-facebook-fuji.dts | 1251 +---------------- 1 file changed, 5 insertions(+), 1246 deletions(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts index d0331980d082..5dc2a165e441 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji.dts @@ -1,1257 +1,16 @@ // SPDX-License-Identifier: GPL-2.0+ // Copyright (c) 2020 Facebook Inc. -/dts-v1/; - -#include -#include "ast2600-facebook-netbmc-common.dtsi" +#include "aspeed-bmc-facebook-fuji-data64.dts" / { model = "Facebook Fuji BMC"; compatible = "facebook,fuji-bmc", "aspeed,ast2600"; - - aliases { - /* - * PCA9548 (2-0070) provides 8 channels connecting to - * SCM (System Controller Module). - */ - i2c16 = &imux16; - i2c17 = &imux17; - i2c18 = &imux18; - i2c19 = &imux19; - i2c20 = &imux20; - i2c21 = &imux21; - i2c22 = &imux22; - i2c23 = &imux23; - - /* - * PCA9548 (8-0070) provides 8 channels connecting to - * SMB (Switch Main Board). - */ - i2c24 = &imux24; - i2c25 = &imux25; - i2c26 = &imux26; - i2c27 = &imux27; - i2c28 = &imux28; - i2c29 = &imux29; - i2c30 = &imux30; - i2c31 = &imux31; - - /* - * PCA9548 (11-0077) provides 8 channels connecting to - * SMB (Switch Main Board). - */ - i2c40 = &imux40; - i2c41 = &imux41; - i2c42 = &imux42; - i2c43 = &imux43; - i2c44 = &imux44; - i2c45 = &imux45; - i2c46 = &imux46; - i2c47 = &imux47; - - /* - * PCA9548 (24-0071) provides 8 channels connecting to - * PDB-Left. - */ - i2c48 = &imux48; - i2c49 = &imux49; - i2c50 = &imux50; - i2c51 = &imux51; - i2c52 = &imux52; - i2c53 = &imux53; - i2c54 = &imux54; - i2c55 = &imux55; - - /* - * PCA9548 (25-0072) provides 8 channels connecting to - * PDB-Right. - */ - i2c56 = &imux56; - i2c57 = &imux57; - i2c58 = &imux58; - i2c59 = &imux59; - i2c60 = &imux60; - i2c61 = &imux61; - i2c62 = &imux62; - i2c63 = &imux63; - - /* - * PCA9548 (26-0076) provides 8 channels connecting to - * FCM1. - */ - i2c64 = &imux64; - i2c65 = &imux65; - i2c66 = &imux66; - i2c67 = &imux67; - i2c68 = &imux68; - i2c69 = &imux69; - i2c70 = &imux70; - i2c71 = &imux71; - - /* - * PCA9548 (27-0076) provides 8 channels connecting to - * FCM2. - */ - i2c72 = &imux72; - i2c73 = &imux73; - i2c74 = &imux74; - i2c75 = &imux75; - i2c76 = &imux76; - i2c77 = &imux77; - i2c78 = &imux78; - i2c79 = &imux79; - - /* - * PCA9548 (40-0076) provides 8 channels connecting to - * PIM1. - */ - i2c80 = &imux80; - i2c81 = &imux81; - i2c82 = &imux82; - i2c83 = &imux83; - i2c84 = &imux84; - i2c85 = &imux85; - i2c86 = &imux86; - i2c87 = &imux87; - - /* - * PCA9548 (41-0076) provides 8 channels connecting to - * PIM2. - */ - i2c88 = &imux88; - i2c89 = &imux89; - i2c90 = &imux90; - i2c91 = &imux91; - i2c92 = &imux92; - i2c93 = &imux93; - i2c94 = &imux94; - i2c95 = &imux95; - - /* - * PCA9548 (42-0076) provides 8 channels connecting to - * PIM3. - */ - i2c96 = &imux96; - i2c97 = &imux97; - i2c98 = &imux98; - i2c99 = &imux99; - i2c100 = &imux100; - i2c101 = &imux101; - i2c102 = &imux102; - i2c103 = &imux103; - - /* - * PCA9548 (43-0076) provides 8 channels connecting to - * PIM4. - */ - i2c104 = &imux104; - i2c105 = &imux105; - i2c106 = &imux106; - i2c107 = &imux107; - i2c108 = &imux108; - i2c109 = &imux109; - i2c110 = &imux110; - i2c111 = &imux111; - - /* - * PCA9548 (44-0076) provides 8 channels connecting to - * PIM5. - */ - i2c112 = &imux112; - i2c113 = &imux113; - i2c114 = &imux114; - i2c115 = &imux115; - i2c116 = &imux116; - i2c117 = &imux117; - i2c118 = &imux118; - i2c119 = &imux119; - - /* - * PCA9548 (45-0076) provides 8 channels connecting to - * PIM6. - */ - i2c120 = &imux120; - i2c121 = &imux121; - i2c122 = &imux122; - i2c123 = &imux123; - i2c124 = &imux124; - i2c125 = &imux125; - i2c126 = &imux126; - i2c127 = &imux127; - - /* - * PCA9548 (46-0076) provides 8 channels connecting to - * PIM7. - */ - i2c128 = &imux128; - i2c129 = &imux129; - i2c130 = &imux130; - i2c131 = &imux131; - i2c132 = &imux132; - i2c133 = &imux133; - i2c134 = &imux134; - i2c135 = &imux135; - - /* - * PCA9548 (47-0076) provides 8 channels connecting to - * PIM8. - */ - i2c136 = &imux136; - i2c137 = &imux137; - i2c138 = &imux138; - i2c139 = &imux139; - i2c140 = &imux140; - i2c141 = &imux141; - i2c142 = &imux142; - i2c143 = &imux143; - }; - - spi_gpio: spi { - num-chipselects = <3>; - cs-gpios = <&gpio0 ASPEED_GPIO(X, 0) GPIO_ACTIVE_LOW>, - <0>, /* device reg=<1> does not exist */ - <&gpio0 ASPEED_GPIO(X, 2) GPIO_ACTIVE_HIGH>; - - eeprom at 2 { - compatible = "atmel,at93c46d"; - spi-max-frequency = <250000>; - data-size = <16>; - spi-cs-high; - reg = <2>; - }; - }; -}; - -&i2c0 { - multi-master; - bus-frequency = <1000000>; -}; - -&i2c2 { - /* - * PCA9548 (2-0070) provides 8 channels connecting to SCM (System - * Controller Module). - */ - i2c-mux at 70 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x70>; - i2c-mux-idle-disconnect; - - imux16: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - - adm1278 at 10 { - compatible = "adi,adm1278"; - reg = <0x10>; - shunt-resistor-micro-ohms = <1500>; - }; - }; - - imux17: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux18: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux19: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux20: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux21: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux22: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux23: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; -}; - -&i2c8 { - /* - * PCA9548 (8-0070) provides 8 channels connecting to SMB (Switch - * Main Board). - */ - i2c-mux at 70 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x70>; - i2c-mux-idle-disconnect; - - imux24: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - - i2c-mux at 71 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x71>; - i2c-mux-idle-disconnect; - - imux48: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux49: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux50: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - - lp5012 at 14 { - compatible = "ti,lp5012"; - reg = <0x14>; - #address-cells = <1>; - #size-cells = <0>; - - multi-led at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - color = ; - function = LED_FUNCTION_ACTIVITY; - label = "sys"; - - led at 0 { - reg = <0>; - color = ; - }; - - led at 1 { - reg = <1>; - color = ; - }; - - led at 2 { - reg = <2>; - color = ; - }; - }; - - multi-led at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - color = ; - function = LED_FUNCTION_ACTIVITY; - label = "fan"; - - led at 0 { - reg = <0>; - color = ; - }; - - led at 1 { - reg = <1>; - color = ; - }; - - led at 2 { - reg = <2>; - color = ; - }; - }; - - multi-led at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - color = ; - function = LED_FUNCTION_ACTIVITY; - label = "psu"; - - led at 0 { - reg = <0>; - color = ; - }; - - led at 1 { - reg = <1>; - color = ; - }; - - led at 2 { - reg = <2>; - color = ; - }; - }; - - multi-led at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - color = ; - function = LED_FUNCTION_ACTIVITY; - label = "smb"; - - led at 0 { - reg = <0>; - color = ; - }; - - led at 1 { - reg = <1>; - color = ; - }; - - led at 2 { - reg = <2>; - color = ; - }; - }; - }; - }; - - imux51: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux52: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux53: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux54: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux55: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux25: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - - i2c-mux at 72 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x72>; - i2c-mux-idle-disconnect; - - imux56: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux57: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux58: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux59: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux60: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux61: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux62: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux63: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux26: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux64: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux65: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux66: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux67: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - - adm1278 at 10 { - compatible = "adi,adm1278"; - reg = <0x10>; - shunt-resistor-micro-ohms = <250>; - }; - }; - - imux68: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux69: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux70: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux71: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux27: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux72: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux73: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux74: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux75: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - - adm1278 at 10 { - compatible = "adi,adm1278"; - reg = <0x10>; - shunt-resistor-micro-ohms = <250>; - }; - }; - - imux76: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux77: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux78: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux79: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux28: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux29: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux30: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux31: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - - }; -}; - -&i2c11 { - status = "okay"; - - /* - * PCA9548 (11-0077) provides 8 channels connecting to SMB (Switch - * Main Board). - */ - i2c-mux at 77 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x77>; - i2c-mux-idle-disconnect; - - imux40: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux80: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux81: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux82: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux83: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux84: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux85: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux86: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux87: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux41: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux88: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux89: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux90: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux91: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux92: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux93: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux94: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux95: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux42: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux96: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux97: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux98: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux99: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux100: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux101: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux102: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux103: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux43: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux104: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux105: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux106: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux107: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux108: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux109: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux110: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux111: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux44: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux112: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux113: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux114: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux115: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux116: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux117: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux118: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux119: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux45: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux120: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux121: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux122: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux123: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux124: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux125: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux126: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux127: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux46: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux128: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux129: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux130: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux131: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux132: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux133: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux134: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux135: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - imux47: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - - i2c-mux at 76 { - compatible = "nxp,pca9548"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x76>; - i2c-mux-idle-disconnect; - - imux136: i2c at 0 { - #address-cells = <1>; - #size-cells = <0>; - reg = <0>; - }; - - imux137: i2c at 1 { - #address-cells = <1>; - #size-cells = <0>; - reg = <1>; - }; - - imux138: i2c at 2 { - #address-cells = <1>; - #size-cells = <0>; - reg = <2>; - }; - - imux139: i2c at 3 { - #address-cells = <1>; - #size-cells = <0>; - reg = <3>; - }; - - imux140: i2c at 4 { - #address-cells = <1>; - #size-cells = <0>; - reg = <4>; - }; - - imux141: i2c at 5 { - #address-cells = <1>; - #size-cells = <0>; - reg = <5>; - }; - - imux142: i2c at 6 { - #address-cells = <1>; - #size-cells = <0>; - reg = <6>; - }; - - imux143: i2c at 7 { - #address-cells = <1>; - #size-cells = <0>; - reg = <7>; - }; - }; - - }; - - }; }; -&ehci1 { - status = "okay"; -}; - -&mdio1 { - status = "okay"; - - ethphy3: ethernet-phy at 13 { - compatible = "ethernet-phy-ieee802.3-c22"; - reg = <0x0d>; +&fmc { + flash at 0 { + /delete-node/partitions; +#include "facebook-bmc-flash-layout-128.dtsi" }; }; - -&mac3 { - status = "okay"; - phy-mode = "rgmii"; - phy-handle = <ðphy3>; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_rgmii4_default>; -}; - -&emmc_controller { - status = "okay"; -}; - -&emmc { - status = "okay"; - - non-removable; - max-frequency = <25000000>; - bus-width = <4>; -}; -- 2.47.3 From rentao.bupt at gmail.com Mon Jul 28 15:56:14 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sun, 27 Jul 2025 22:56:14 -0700 Subject: [PATCH v4 12/13] dt-bindings: arm: aspeed: add Facebook Darwin board In-Reply-To: <20250728055618.61616-1-rentao.bupt@gmail.com> References: <20250728055618.61616-1-rentao.bupt@gmail.com> Message-ID: <20250728055618.61616-13-rentao.bupt@gmail.com> From: Tao Ren Document the new compatibles used on Meta/Facebook Darwin board. Signed-off-by: Tao Ren Acked-by: Krzysztof Kozlowski --- Changes in v4: - None. Changes in v3: - None. Changes in v2: - None (the patch is introduced in v2). Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml index 3cc6e62ae5f3..2887565d4170 100644 --- a/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml +++ b/Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml @@ -83,6 +83,7 @@ properties: - facebook,bletchley-bmc - facebook,catalina-bmc - facebook,cloudripper-bmc + - facebook,darwin-bmc - facebook,elbert-bmc - facebook,fuji-bmc - facebook,fuji-data64-bmc -- 2.47.3 From rentao.bupt at gmail.com Mon Jul 28 15:56:15 2025 From: rentao.bupt at gmail.com (rentao.bupt at gmail.com) Date: Sun, 27 Jul 2025 22:56:15 -0700 Subject: [PATCH v4 13/13] ARM: dts: aspeed: Add Facebook Darwin (AST2600) BMC In-Reply-To: <20250728055618.61616-1-rentao.bupt@gmail.com> References: <20250728055618.61616-1-rentao.bupt@gmail.com> Message-ID: <20250728055618.61616-14-rentao.bupt@gmail.com> From: Tao Ren Add initial device tree for the Meta (Facebook) Darwin AST2600 BMC. Darwin is Meta's rack switch platform with an AST2600 BMC integrated for health monitoring purpose. Signed-off-by: Tao Ren --- Changes in v4: - None. Changes in v3: - Removed flash layout (use the "default" in common.dtsi). Changes in v2: - Removed mac3 controller. - Fixed DTB warnings. arch/arm/boot/dts/aspeed/Makefile | 1 + .../dts/aspeed/aspeed-bmc-facebook-darwin.dts | 72 +++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts diff --git a/arch/arm/boot/dts/aspeed/Makefile b/arch/arm/boot/dts/aspeed/Makefile index f6e714b7db2d..dce32ee0ace7 100644 --- a/arch/arm/boot/dts/aspeed/Makefile +++ b/arch/arm/boot/dts/aspeed/Makefile @@ -20,6 +20,7 @@ dtb-$(CONFIG_ARCH_ASPEED) += \ aspeed-bmc-facebook-bletchley.dtb \ aspeed-bmc-facebook-catalina.dtb \ aspeed-bmc-facebook-cmm.dtb \ + aspeed-bmc-facebook-darwin.dtb \ aspeed-bmc-facebook-elbert.dtb \ aspeed-bmc-facebook-fuji-data64.dtb \ aspeed-bmc-facebook-fuji.dtb \ diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts new file mode 100644 index 000000000000..58c107a1b6cf --- /dev/null +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-darwin.dts @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: GPL-2.0+ +// Copyright (c) 2021 Facebook Inc. + +/dts-v1/; + +#include "ast2600-facebook-netbmc-common.dtsi" + +/ { + model = "Facebook Darwin BMC"; + compatible = "facebook,darwin-bmc", "aspeed,ast2600"; + + aliases { + serial0 = &uart5; + serial1 = &uart1; + serial2 = &uart2; + serial3 = &uart3; + }; + + chosen { + stdout-path = &uart5; + }; + + iio-hwmon { + compatible = "iio-hwmon"; + io-channels = <&adc0 0>, <&adc0 1>, <&adc0 2>, <&adc0 3>, + <&adc0 4>, <&adc0 5>, <&adc0 6>, <&adc0 7>, + <&adc1 0>, <&adc1 1>, <&adc1 2>, <&adc1 3>, + <&adc1 4>, <&adc1 5>, <&adc1 6>, <&adc1 7>; + }; + + spi_gpio: spi { + num-chipselects = <1>; + cs-gpios = <&gpio0 ASPEED_GPIO(X, 0) GPIO_ACTIVE_LOW>; + }; +}; + +&i2c0 { + eeprom at 50 { + compatible = "atmel,24c512"; + reg = <0x50>; + }; +}; + +&adc0 { + status = "okay"; + + pinctrl-0 = <&pinctrl_adc0_default &pinctrl_adc1_default + &pinctrl_adc2_default &pinctrl_adc3_default + &pinctrl_adc4_default &pinctrl_adc5_default + &pinctrl_adc6_default &pinctrl_adc7_default>; +}; + +&adc1 { + status = "okay"; + + pinctrl-0 = <&pinctrl_adc8_default &pinctrl_adc9_default + &pinctrl_adc10_default &pinctrl_adc11_default + &pinctrl_adc12_default &pinctrl_adc13_default + &pinctrl_adc14_default &pinctrl_adc15_default>; +}; + +&emmc_controller { + status = "okay"; +}; + +&emmc { + status = "okay"; + + non-removable; + max-frequency = <25000000>; + bus-width = <4>; +}; -- 2.47.3 From andrew at lunn.ch Tue Jul 29 23:55:50 2025 From: andrew at lunn.ch (Andrew Lunn) Date: Tue, 29 Jul 2025 15:55:50 +0200 Subject: [PATCH v1 3/3] ARM: dts: aspeed: santabarbara: Adjust LED configuration In-Reply-To: <20250729091351.3964939-4-fredchen.openbmc@gmail.com> References: <20250729091351.3964939-1-fredchen.openbmc@gmail.com> <20250729091351.3964939-4-fredchen.openbmc@gmail.com> Message-ID: On Tue, Jul 29, 2025 at 05:13:45PM +0800, Fred Chen wrote: > Add a new power fault LED on GPIOB5 and relocate the ID LED to GPIOQ4. > The ID LED is now driven by the CPLD, allowing it to reflect multiple > system states depending on CPLD logic. It would be good to add a comment about why this is not an ABI breaking change. Andrew From fredchen.openbmc at gmail.com Tue Jul 29 19:13:45 2025 From: fredchen.openbmc at gmail.com (Fred Chen) Date: Tue, 29 Jul 2025 17:13:45 +0800 Subject: [PATCH v1 3/3] ARM: dts: aspeed: santabarbara: Adjust LED configuration In-Reply-To: <20250729091351.3964939-1-fredchen.openbmc@gmail.com> References: <20250729091351.3964939-1-fredchen.openbmc@gmail.com> Message-ID: <20250729091351.3964939-4-fredchen.openbmc@gmail.com> Add a new power fault LED on GPIOB5 and relocate the ID LED to GPIOQ4. The ID LED is now driven by the CPLD, allowing it to reflect multiple system states depending on CPLD logic. Signed-off-by: Fred Chen --- .../boot/dts/aspeed/aspeed-bmc-facebook-santabarbara.dts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-santabarbara.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-santabarbara.dts index ed30f3bf61a4..c7eb30e5baad 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-santabarbara.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-santabarbara.dts @@ -94,7 +94,7 @@ led-0 { }; led-1 { - label = "fp_id_amber"; + label = "power_fault"; default-state = "off"; gpios = <&gpio0 ASPEED_GPIO(B, 5) GPIO_ACTIVE_HIGH>; }; @@ -104,6 +104,12 @@ led-2 { default-state = "off"; gpios = <&gpio0 ASPEED_GPIO(P, 4) GPIO_ACTIVE_HIGH>; }; + + led-3 { + label = "fp_id_amber"; + default-state = "off"; + gpios = <&gpio0 ASPEED_GPIO(Q, 4) GPIO_ACTIVE_HIGH>; + }; }; memory at 80000000 { -- 2.49.0 From fredchen.openbmc at gmail.com Tue Jul 29 19:13:44 2025 From: fredchen.openbmc at gmail.com (Fred Chen) Date: Tue, 29 Jul 2025 17:13:44 +0800 Subject: [PATCH v1 2/3] ARM: dts: aspeed: santabarbara: Enable MCTP for frontend NIC In-Reply-To: <20250729091351.3964939-1-fredchen.openbmc@gmail.com> References: <20250729091351.3964939-1-fredchen.openbmc@gmail.com> Message-ID: <20250729091351.3964939-3-fredchen.openbmc@gmail.com> Add the mctp-controller property and MCTP node to enable frontend NIC management via PLDM over MCTP. Signed-off-by: Fred Chen --- .../boot/dts/aspeed/aspeed-bmc-facebook-santabarbara.dts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-santabarbara.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-santabarbara.dts index 2f5712e9ba9f..ed30f3bf61a4 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-santabarbara.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-santabarbara.dts @@ -1248,8 +1248,16 @@ temperature-sensor at 49 { }; &i2c11 { + multi-master; + mctp-controller; status = "okay"; + mctp at 10 { + compatible = "mctp-i2c-controller"; + reg = <(0x10 | I2C_OWN_SLAVE_ADDRESS)>; + label = "mb_nic0_mctp"; + }; + // OCP NIC TEMP temperature-sensor at 1f { compatible = "ti,tmp421"; -- 2.49.0 From fredchen.openbmc at gmail.com Tue Jul 29 19:13:42 2025 From: fredchen.openbmc at gmail.com (Fred Chen) Date: Tue, 29 Jul 2025 17:13:42 +0800 Subject: [PATCH v1 0/3] Revise Meta Santabarbara devicetree Message-ID: <20250729091351.3964939-1-fredchen.openbmc@gmail.com> Summary: Revise linux device tree entry related to Meta (Facebook) Santabarbara. - add sensor nodes for extension board - add mctp node for NIC - adjust LED configuration Base on branch for-next Fred Chen (3): ARM: dts: aspeed: santabarbara: add sensor support for extension boards ARM: dts: aspeed: santabarbara: Enable MCTP for frontend NIC ARM: dts: aspeed: santabarbara: Adjust LED configuration .../aspeed-bmc-facebook-santabarbara.dts | 840 +++++++++++++++++- 1 file changed, 839 insertions(+), 1 deletion(-) -- 2.49.0 From fredchen.openbmc at gmail.com Tue Jul 29 19:13:43 2025 From: fredchen.openbmc at gmail.com (Fred Chen) Date: Tue, 29 Jul 2025 17:13:43 +0800 Subject: [PATCH v1 1/3] ARM: dts: aspeed: santabarbara: add sensor support for extension boards In-Reply-To: <20250729091351.3964939-1-fredchen.openbmc@gmail.com> References: <20250729091351.3964939-1-fredchen.openbmc@gmail.com> Message-ID: <20250729091351.3964939-2-fredchen.openbmc@gmail.com> add power monitor and temperature sensors for extension boards in bus 6, 8, 10 and 13. Signed-off-by: Fred Chen --- .../aspeed-bmc-facebook-santabarbara.dts | 824 ++++++++++++++++++ 1 file changed, 824 insertions(+) diff --git a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-santabarbara.dts b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-santabarbara.dts index ee93a971c500..2f5712e9ba9f 100644 --- a/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-santabarbara.dts +++ b/arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-santabarbara.dts @@ -39,6 +39,38 @@ aliases { i2c37 = &i2c12mux0ch5; i2c38 = &i2c12mux0ch6; i2c39 = &i2c12mux0ch7; + i2c48 = &i2c6mux0ch0; + i2c49 = &i2c6mux0ch1; + i2c50 = &i2c6mux0ch2; + i2c51 = &i2c6mux0ch3; + i2c52 = &i2c8mux0ch0; + i2c53 = &i2c8mux0ch1; + i2c54 = &i2c8mux0ch2; + i2c55 = &i2c8mux0ch3; + i2c56 = &i2c10mux0ch0; + i2c57 = &i2c10mux0ch1; + i2c58 = &i2c10mux0ch2; + i2c59 = &i2c10mux0ch3; + i2c60 = &i2c13mux0ch0; + i2c61 = &i2c13mux0ch1; + i2c62 = &i2c13mux0ch2; + i2c63 = &i2c13mux0ch3; + i2c64 = &i2c6mux1ch0; + i2c65 = &i2c6mux1ch1; + i2c66 = &i2c6mux1ch2; + i2c67 = &i2c6mux1ch3; + i2c68 = &i2c8mux1ch0; + i2c69 = &i2c8mux1ch1; + i2c70 = &i2c8mux1ch2; + i2c71 = &i2c8mux1ch3; + i2c72 = &i2c10mux1ch0; + i2c73 = &i2c10mux1ch1; + i2c74 = &i2c10mux1ch2; + i2c75 = &i2c10mux1ch3; + i2c76 = &i2c13mux1ch0; + i2c77 = &i2c13mux1ch1; + i2c78 = &i2c13mux1ch2; + i2c79 = &i2c13mux1ch3; }; chosen { @@ -574,6 +606,204 @@ eeprom at 52 { compatible = "atmel,24c256"; reg = <0x52>; }; + + i2c-mux at 71 { + compatible = "nxp,pca9546"; + reg = <0x71>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c6mux0ch0: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + temperature-sensor at 64 { + compatible = "microchip,mcp9600"; + reg = <0x64>; + }; + + temperature-sensor at 65 { + compatible = "microchip,mcp9600"; + reg = <0x65>; + }; + + temperature-sensor at 67 { + compatible = "microchip,mcp9600"; + reg = <0x67>; + }; + + i2c-mux at 72 { + compatible = "nxp,pca9546"; + reg = <0x72>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c6mux1ch0: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + i2c6mux1ch1: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + voltage-sensor at 48 { + compatible = "ti,ads7830"; + reg = <0x48>; + }; + + voltage-sensorr at 49 { + compatible = "ti,ads7830"; + reg = <0x49>; + }; + + temperature-sensor at 4a { + compatible = "ti,tmp175"; + reg = <0x4a>; + }; + + temperature-sensor at 4b { + compatible = "ti,tmp175"; + reg = <0x4b>; + }; + + eeprom at 56 { + compatible = "atmel,24c256"; + reg = <0x56>; + }; + }; + i2c6mux1ch2: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + i2c6mux1ch3: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + }; + i2c6mux0ch1: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + potentiometer at 2c { + compatible = "adi,ad5272-020"; + reg = <0x2c>; + }; + + potentiometer at 2e { + compatible = "adi,ad5272-020"; + reg = <0x2e>; + }; + + potentiometer at 2f { + compatible = "adi,ad5272-020"; + reg = <0x2f>; + }; + + power-monitor at 40 { + compatible = "ti,ina238"; + reg = <0x40>; + shunt-resistor = <1000>; + }; + + power-monitor at 44 { + compatible = "ti,ina238"; + reg = <0x44>; + shunt-resistor = <1000>; + }; + + power-monitor at 45 { + compatible = "ti,ina238"; + reg = <0x45>; + shunt-resistor = <1000>; + }; + }; + i2c6mux0ch2: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + + potentiometer at 2c { + compatible = "adi,ad5272-020"; + reg = <0x2c>; + }; + + potentiometer at 2e { + compatible = "adi,ad5272-020"; + reg = <0x2e>; + }; + + potentiometer at 2f { + compatible = "adi,ad5272-020"; + reg = <0x2f>; + }; + + power-monitor at 40 { + compatible = "ti,ina238"; + reg = <0x40>; + shunt-resistor = <1000>; + }; + + power-monitor at 44 { + compatible = "ti,ina238"; + reg = <0x44>; + shunt-resistor = <1000>; + }; + + power-monitor at 45 { + compatible = "ti,ina238"; + reg = <0x45>; + shunt-resistor = <1000>; + }; + }; + i2c6mux0ch3: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + + voltage-sensor at 1d { + compatible = "ti,adc128d818"; + reg = <0x1d>; + ti,mode = /bits/ 8 <1>; + }; + + voltage-sensor at 37 { + compatible = "ti,adc128d818"; + reg = <0x37>; + ti,mode = /bits/ 8 <1>; + }; + + power-monitor at 40 { + compatible = "ti,ina238"; + reg = <0x40>; + shunt-resistor = <1000>; + }; + + power-monitor at 45 { + compatible = "ti,ina238"; + reg = <0x45>; + shunt-resistor = <1000>; + }; + + temperature-sensor at 48 { + compatible = "ti,tmp175"; + reg = <0x48>; + }; + + temperature-sensor at 49 { + compatible = "ti,tmp175"; + reg = <0x49>; + }; + }; + }; }; &i2c7 { @@ -588,6 +818,204 @@ eeprom at 52 { compatible = "atmel,24c256"; reg = <0x52>; }; + + i2c-mux at 71 { + compatible = "nxp,pca9546"; + reg = <0x71>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c8mux0ch0: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + temperature-sensor at 64 { + compatible = "microchip,mcp9600"; + reg = <0x64>; + }; + + temperature-sensor at 65 { + compatible = "microchip,mcp9600"; + reg = <0x65>; + }; + + temperature-sensor at 67 { + compatible = "microchip,mcp9600"; + reg = <0x67>; + }; + + i2c-mux at 72 { + compatible = "nxp,pca9546"; + reg = <0x72>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c8mux1ch0: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + i2c8mux1ch1: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + voltage-sensor at 48 { + compatible = "ti,ads7830"; + reg = <0x48>; + }; + + voltage-sensorr at 49 { + compatible = "ti,ads7830"; + reg = <0x49>; + }; + + temperature-sensor at 4a { + compatible = "ti,tmp175"; + reg = <0x4a>; + }; + + temperature-sensor at 4b { + compatible = "ti,tmp175"; + reg = <0x4b>; + }; + + eeprom at 56 { + compatible = "atmel,24c256"; + reg = <0x56>; + }; + }; + i2c8mux1ch2: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + i2c8mux1ch3: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + }; + i2c8mux0ch1: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + potentiometer at 2c { + compatible = "adi,ad5272-020"; + reg = <0x2c>; + }; + + potentiometer at 2e { + compatible = "adi,ad5272-020"; + reg = <0x2e>; + }; + + potentiometer at 2f { + compatible = "adi,ad5272-020"; + reg = <0x2f>; + }; + + power-monitor at 40 { + compatible = "ti,ina238"; + reg = <0x40>; + shunt-resistor = <1000>; + }; + + power-monitor at 44 { + compatible = "ti,ina238"; + reg = <0x44>; + shunt-resistor = <1000>; + }; + + power-monitor at 45 { + compatible = "ti,ina238"; + reg = <0x45>; + shunt-resistor = <1000>; + }; + }; + i2c8mux0ch2: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + + potentiometer at 2c { + compatible = "adi,ad5272-020"; + reg = <0x2c>; + }; + + potentiometer at 2e { + compatible = "adi,ad5272-020"; + reg = <0x2e>; + }; + + potentiometer at 2f { + compatible = "adi,ad5272-020"; + reg = <0x2f>; + }; + + power-monitor at 40 { + compatible = "ti,ina238"; + reg = <0x40>; + shunt-resistor = <1000>; + }; + + power-monitor at 44 { + compatible = "ti,ina238"; + reg = <0x44>; + shunt-resistor = <1000>; + }; + + power-monitor at 45 { + compatible = "ti,ina238"; + reg = <0x45>; + shunt-resistor = <1000>; + }; + }; + i2c8mux0ch3: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + + voltage-sensor at 1d { + compatible = "ti,adc128d818"; + reg = <0x1d>; + ti,mode = /bits/ 8 <1>; + }; + + voltage-sensor at 37 { + compatible = "ti,adc128d818"; + reg = <0x37>; + ti,mode = /bits/ 8 <1>; + }; + + power-monitor at 40 { + compatible = "ti,ina238"; + reg = <0x40>; + shunt-resistor = <1000>; + }; + + power-monitor at 45 { + compatible = "ti,ina238"; + reg = <0x45>; + shunt-resistor = <1000>; + }; + + temperature-sensor at 48 { + compatible = "ti,tmp175"; + reg = <0x48>; + }; + + temperature-sensor at 49 { + compatible = "ti,tmp175"; + reg = <0x49>; + }; + }; + }; }; &i2c9 { @@ -619,6 +1047,204 @@ eeprom at 52 { compatible = "atmel,24c256"; reg = <0x52>; }; + + i2c-mux at 71 { + compatible = "nxp,pca9546"; + reg = <0x71>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c10mux0ch0: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + temperature-sensor at 64 { + compatible = "microchip,mcp9600"; + reg = <0x64>; + }; + + temperature-sensor at 65 { + compatible = "microchip,mcp9600"; + reg = <0x65>; + }; + + temperature-sensor at 67 { + compatible = "microchip,mcp9600"; + reg = <0x67>; + }; + + i2c-mux at 72 { + compatible = "nxp,pca9546"; + reg = <0x72>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c10mux1ch0: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + i2c10mux1ch1: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + voltage-sensor at 48 { + compatible = "ti,ads7830"; + reg = <0x48>; + }; + + voltage-sensorr at 49 { + compatible = "ti,ads7830"; + reg = <0x49>; + }; + + temperature-sensor at 4a { + compatible = "ti,tmp175"; + reg = <0x4a>; + }; + + temperature-sensor at 4b { + compatible = "ti,tmp175"; + reg = <0x4b>; + }; + + eeprom at 56 { + compatible = "atmel,24c256"; + reg = <0x56>; + }; + }; + i2c10mux1ch2: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + i2c10mux1ch3: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + }; + i2c10mux0ch1: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + potentiometer at 2c { + compatible = "adi,ad5272-020"; + reg = <0x2c>; + }; + + potentiometer at 2e { + compatible = "adi,ad5272-020"; + reg = <0x2e>; + }; + + potentiometer at 2f { + compatible = "adi,ad5272-020"; + reg = <0x2f>; + }; + + power-monitor at 40 { + compatible = "ti,ina238"; + reg = <0x40>; + shunt-resistor = <1000>; + }; + + power-monitor at 44 { + compatible = "ti,ina238"; + reg = <0x44>; + shunt-resistor = <1000>; + }; + + power-monitor at 45 { + compatible = "ti,ina238"; + reg = <0x45>; + shunt-resistor = <1000>; + }; + }; + i2c10mux0ch2: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + + potentiometer at 2c { + compatible = "adi,ad5272-020"; + reg = <0x2c>; + }; + + potentiometer at 2e { + compatible = "adi,ad5272-020"; + reg = <0x2e>; + }; + + potentiometer at 2f { + compatible = "adi,ad5272-020"; + reg = <0x2f>; + }; + + power-monitor at 40 { + compatible = "ti,ina238"; + reg = <0x40>; + shunt-resistor = <1000>; + }; + + power-monitor at 44 { + compatible = "ti,ina238"; + reg = <0x44>; + shunt-resistor = <1000>; + }; + + power-monitor at 45 { + compatible = "ti,ina238"; + reg = <0x45>; + shunt-resistor = <1000>; + }; + }; + i2c10mux0ch3: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + + voltage-sensor at 1d { + compatible = "ti,adc128d818"; + reg = <0x1d>; + ti,mode = /bits/ 8 <1>; + }; + + voltage-sensor at 37 { + compatible = "ti,adc128d818"; + reg = <0x37>; + ti,mode = /bits/ 8 <1>; + }; + + power-monitor at 40 { + compatible = "ti,ina238"; + reg = <0x40>; + shunt-resistor = <1000>; + }; + + power-monitor at 45 { + compatible = "ti,ina238"; + reg = <0x45>; + shunt-resistor = <1000>; + }; + + temperature-sensor at 48 { + compatible = "ti,tmp175"; + reg = <0x48>; + }; + + temperature-sensor at 49 { + compatible = "ti,tmp175"; + reg = <0x49>; + }; + }; + }; }; &i2c11 { @@ -748,6 +1374,204 @@ eeprom at 52 { compatible = "atmel,24c256"; reg = <0x52>; }; + + i2c-mux at 71 { + compatible = "nxp,pca9546"; + reg = <0x71>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c13mux0ch0: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + temperature-sensor at 64 { + compatible = "microchip,mcp9600"; + reg = <0x64>; + }; + + temperature-sensor at 65 { + compatible = "microchip,mcp9600"; + reg = <0x65>; + }; + + temperature-sensor at 67 { + compatible = "microchip,mcp9600"; + reg = <0x67>; + }; + + i2c-mux at 72 { + compatible = "nxp,pca9546"; + reg = <0x72>; + #address-cells = <1>; + #size-cells = <0>; + i2c-mux-idle-disconnect; + + i2c13mux1ch0: i2c at 0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + }; + i2c13mux1ch1: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + voltage-sensor at 48 { + compatible = "ti,ads7830"; + reg = <0x48>; + }; + + voltage-sensorr at 49 { + compatible = "ti,ads7830"; + reg = <0x49>; + }; + + temperature-sensor at 4a { + compatible = "ti,tmp175"; + reg = <0x4a>; + }; + + temperature-sensor at 4b { + compatible = "ti,tmp175"; + reg = <0x4b>; + }; + + eeprom at 56 { + compatible = "atmel,24c256"; + reg = <0x56>; + }; + }; + i2c13mux1ch2: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + }; + i2c13mux1ch3: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + }; + }; + }; + i2c13mux0ch1: i2c at 1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + potentiometer at 2c { + compatible = "adi,ad5272-020"; + reg = <0x2c>; + }; + + potentiometer at 2e { + compatible = "adi,ad5272-020"; + reg = <0x2e>; + }; + + potentiometer at 2f { + compatible = "adi,ad5272-020"; + reg = <0x2f>; + }; + + power-monitor at 40 { + compatible = "ti,ina238"; + reg = <0x40>; + shunt-resistor = <1000>; + }; + + power-monitor at 44 { + compatible = "ti,ina238"; + reg = <0x44>; + shunt-resistor = <1000>; + }; + + power-monitor at 45 { + compatible = "ti,ina238"; + reg = <0x45>; + shunt-resistor = <1000>; + }; + }; + i2c13mux0ch2: i2c at 2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + + potentiometer at 2c { + compatible = "adi,ad5272-020"; + reg = <0x2c>; + }; + + potentiometer at 2e { + compatible = "adi,ad5272-020"; + reg = <0x2e>; + }; + + potentiometer at 2f { + compatible = "adi,ad5272-020"; + reg = <0x2f>; + }; + + power-monitor at 40 { + compatible = "ti,ina238"; + reg = <0x40>; + shunt-resistor = <1000>; + }; + + power-monitor at 44 { + compatible = "ti,ina238"; + reg = <0x44>; + shunt-resistor = <1000>; + }; + + power-monitor at 45 { + compatible = "ti,ina238"; + reg = <0x45>; + shunt-resistor = <1000>; + }; + }; + i2c13mux0ch3: i2c at 3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + + voltage-sensor at 1d { + compatible = "ti,adc128d818"; + reg = <0x1d>; + ti,mode = /bits/ 8 <1>; + }; + + voltage-sensor at 37 { + compatible = "ti,adc128d818"; + reg = <0x37>; + ti,mode = /bits/ 8 <1>; + }; + + power-monitor at 40 { + compatible = "ti,ina238"; + reg = <0x40>; + shunt-resistor = <1000>; + }; + + power-monitor at 45 { + compatible = "ti,ina238"; + reg = <0x45>; + shunt-resistor = <1000>; + }; + + temperature-sensor at 48 { + compatible = "ti,tmp175"; + reg = <0x48>; + }; + + temperature-sensor at 49 { + compatible = "ti,tmp175"; + reg = <0x49>; + }; + }; + }; }; &i2c14 { -- 2.49.0 From robh at kernel.org Wed Jul 30 09:40:34 2025 From: robh at kernel.org (Rob Herring (Arm)) Date: Tue, 29 Jul 2025 18:40:34 -0500 Subject: [PATCH v1 0/3] Revise Meta Santabarbara devicetree In-Reply-To: <20250729091351.3964939-1-fredchen.openbmc@gmail.com> References: <20250729091351.3964939-1-fredchen.openbmc@gmail.com> Message-ID: <175383135828.1119152.922768974777985804.robh@kernel.org> On Tue, 29 Jul 2025 17:13:42 +0800, Fred Chen wrote: > Summary: > Revise linux device tree entry related to Meta (Facebook) Santabarbara. > - add sensor nodes for extension board > - add mctp node for NIC > - adjust LED configuration > Base on branch for-next > > Fred Chen (3): > ARM: dts: aspeed: santabarbara: add sensor support for extension > boards > ARM: dts: aspeed: santabarbara: Enable MCTP for frontend NIC > ARM: dts: aspeed: santabarbara: Adjust LED configuration > > .../aspeed-bmc-facebook-santabarbara.dts | 840 +++++++++++++++++- > 1 file changed, 839 insertions(+), 1 deletion(-) > > -- > 2.49.0 > > > My bot found new DTB warnings on the .dts files added or changed in this series. Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments. If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date: pip3 install dtschema --upgrade This patch series was applied (using b4) to base: Base: attempting to guess base-commit... Base: tags/next-20250729 (exact match) If this is not the correct base, please add 'base-commit' tag (or use b4 which does this automatically) New warnings running 'make CHECK_DTBS=y for arch/arm/boot/dts/aspeed/' for 20250729091351.3964939-1-fredchen.openbmc at gmail.com: arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-santabarbara.dtb: mctp at 10 (mctp-i2c-controller): 'label' does not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/net/mctp-i2c-controller.yaml# From robh at kernel.org Thu Jul 31 06:55:30 2025 From: robh at kernel.org (Rob Herring (Arm)) Date: Wed, 30 Jul 2025 15:55:30 -0500 Subject: [PATCH v4 09/13] dt-bindings: arm: aspeed: add Facebook Fuji-data64 board In-Reply-To: <20250728055618.61616-10-rentao.bupt@gmail.com> References: <20250728055618.61616-1-rentao.bupt@gmail.com> <20250728055618.61616-10-rentao.bupt@gmail.com> Message-ID: <175390892978.1732171.6656964708595304137.robh@kernel.org> On Sun, 27 Jul 2025 22:56:11 -0700, rentao.bupt at gmail.com wrote: > From: Tao Ren > > Document the new compatibles used on Meta/Facebook Fuji-data64 board. > > Signed-off-by: Tao Ren > --- > Changes in v4: > - None. > Changes in v3: > - None (the patch is introduced in v3). > > Documentation/devicetree/bindings/arm/aspeed/aspeed.yaml | 1 + > 1 file changed, 1 insertion(+) > Acked-by: Rob Herring (Arm) From andrew at codeconstruct.com.au Thu Jul 31 12:11:19 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Thu, 31 Jul 2025 11:41:19 +0930 Subject: [PATCH v7 0/2] Adding device tree and binding for NVIDIA GB200-UT3.0b In-Reply-To: References: <20250723222350.200094-1-donalds@nvidia.com> <175341328135.3754696.5873094296930738476.robh@kernel.org> Message-ID: <2de9da0e95d3e1284a29170c99f7b69baadb9518.camel@codeconstruct.com.au> On Thu, 2025-07-24 at 22:25 -0500, Rob Herring wrote: > > All of the below warnings you are introducing... > > And yeah, all the ones above are existing, but I don't see a lot of > progress fixing them. It seems no one adding their board cares about > the SoC warnings given the lack of progress on aspeed stuff. Maybe new > boards need to be rejected without some improvements... > I had an old branch with a series that reduces the warnings. I'll rebase it and tidy it up a bit wrt more recent binding submissions. Once it's mostly sensible I'll consider pointing people to it as suggestions for fixing existing issues on the path to getting their own devicetrees merged. Andrew From andrew at codeconstruct.com.au Thu Jul 31 12:30:29 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Thu, 31 Jul 2025 12:00:29 +0930 Subject: [PATCH v9 2/3] ARM: dts: aspeed: clemente: add Meta Clemente BMC In-Reply-To: <20250723-add-support-for-meta-clemente-bmc-v9-2-b76e7de4d6c8@fii-foxconn.com> References: <20250723-add-support-for-meta-clemente-bmc-v9-0-b76e7de4d6c8@fii-foxconn.com> <20250723-add-support-for-meta-clemente-bmc-v9-2-b76e7de4d6c8@fii-foxconn.com> Message-ID: On Wed, 2025-07-23 at 11:42 +0800, Leo Wang wrote: > From: Leo Wang > > Add linux device tree entry for Meta Clemente compute-tray > BMC using AST2600 SoC. > > Signed-off-by: Leo Wang Aside from the usual ASPEED warnings, I see: arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: adc at 34 (maxim,max1363): '#address-cells', '#size-cells', 'channel at 0', 'channel at 1', 'channel at 2', 'channel at 3' do not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/maxim,max1363.yaml# arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-clemente.dtb: adc at 35 (maxim,max1363): '#address-cells', '#size-cells', 'channel at 0', 'channel at 1', 'channel at 2', 'channel at 3' do not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/iio/adc/maxim,max1363.yaml# Can you please submit a binding for this device, or drop the nodes from the devicetree for now? Andrew From andrew at codeconstruct.com.au Thu Jul 31 12:31:44 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Thu, 31 Jul 2025 12:01:44 +0930 Subject: [PATCH v9 3/3] ARM: dts: aspeed: clemente: add NCSI3 and NCSI4 pinctrl nodes In-Reply-To: <20250723-add-support-for-meta-clemente-bmc-v9-3-b76e7de4d6c8@fii-foxconn.com> References: <20250723-add-support-for-meta-clemente-bmc-v9-0-b76e7de4d6c8@fii-foxconn.com> <20250723-add-support-for-meta-clemente-bmc-v9-3-b76e7de4d6c8@fii-foxconn.com> Message-ID: <6f4b31063bb83a8b8c876ac6ebfdf7d1efc50987.camel@codeconstruct.com.au> On Wed, 2025-07-23 at 11:42 +0800, Leo Wang wrote: > Add pinctrl nodes for NCSI3 and NCSI4 to the AST2600 pinctrl > description, enabling support for RMII3 and RMII4 interfaces. > > Signed-off-by: Leo Wang > --- > ?arch/arm/boot/dts/aspeed/aspeed-g6-pinctrl.dtsi | 10 ++++++++++ > ?1 file changed, 10 insertions(+) This patch should be ordered before the patch adding the devicetree that relies on it. Andrew From andrew at codeconstruct.com.au Thu Jul 31 13:32:04 2025 From: andrew at codeconstruct.com.au (Andrew Jeffery) Date: Thu, 31 Jul 2025 13:02:04 +0930 Subject: [PATCH v4 00/13] ARM: dts: aspeed: Add Meta Darwin dts In-Reply-To: <20250728055618.61616-1-rentao.bupt@gmail.com> References: <20250728055618.61616-1-rentao.bupt@gmail.com> Message-ID: <175393272444.1011263.10036967590309258484.b4-ty@codeconstruct.com.au> On Sun, 27 Jul 2025 22:56:02 -0700, rentao.bupt at gmail.com wrote: > From: Tao Ren > > The patch series introduces the initial device tree for Meta/Facebook > Darwin AST2600 BMC. > > Patches #1, #2 and #3 fixes the DTB warnings in wedge400/fuji dts and > ast2600-facebook-netbmc-common.dtsi. > > [...] Thanks, I've applied this to the BMC tree. -- Andrew Jeffery