arm64: Introduce Black Sesame Technologies C1200 SoC and CDCU1.0 board
Subsystems (6)
cover arm64: Introduce Black Sesame Technologies C1200 SoC and CDCU1.0 board
Black Sesame Technologies C1200 is a high-performance Armv8 SoC designed for automotive and industrial applications. The CDCU1.0 (Central Domain Control Unit) board is the development platform built by Black Sesame Technologies. You can find more information about the SoC and related boards at:
https://bst.ai
Currently, to run the upstream kernel on the CDCU1.0 board, you need to use the bootloader provided by Black Sesame Technologies. The board supports various interfaces including MMC/SD card, which is implemented using the BST C1200 DWCMSHC SDHCI controller.
In this series, we add initial SoC and board support for kernel building. The series includes:
Patch 1: Add Black Sesame Technologies vendor prefix in vendor-prefixes.yaml
- Adds "bst" vendor prefix for Black Sesame Technologies Co., Ltd.
- Required for device tree bindings to properly identify BST hardware
Patch 2: Add device tree bindings for BST SoC platforms
- Creates new binding file Documentation/devicetree/bindings/arm/bst.yaml
- Defines compatible strings for BST C1200 family and C1200 CDCU1.0 board
- Documents BST's focus on automotive-grade SoCs for ADAS applications
Patch 3: Add ARCH_BST configuration for BST silicon support
- Adds Kconfig option for BST architecture support
- Enables building kernel for BST platforms
Patch 4: Add device tree binding for BST DWCMSHC SDHCI controller
- Documents the BST C1200 SDHCI controller binding
- Required for MMC/SD card support on BST platforms
Patch 5: Add BST C1200 SDHCI controller driver
- Implements the MMC host controller driver for BST C1200
- Enables SD card support on BST platforms
Patch 6: Add device tree support for BST C1200 CDCU1.0 board
- Adds device tree source files for C1200 SoC and CDCU1.0 board
- Configures hardware components including MMC controller
Patch 7: Enable BST SoC in arm64 defconfig
- Adds ARCH_BST configuration to default arm64 config
Patch 8: Enable BST C1200 DWCMSHC controller in defconfig
- Enables MMC controller driver in default arm64 config
Patch 9: Update MAINTAINERS for BST support
- Adds maintainer information for BST ARM SoC support
- Consolidates BST-related entries
Albert Yang (9):
dt-bindings: vendor-prefixes: Add Black Sesame Technologies Co., Ltd.
dt-bindings: arm: add Black Sesame Technologies (bst) SoC
arm64: Kconfig: add ARCH_BST for bst silicons
dt-bindings: mmc: add binding for BST DWCMSHC SDHCI controller
mmc: sdhci: add Black Sesame Technologies BST C1200 controller driver
arm64: dts: bst: add support for Black Sesame Technologies C1200
CDCU1.0 board
arm64: defconfig: Enable BST SoC
arm64: defconfig: enable BST C1200 DWCMSHC SDHCI controller
MAINTAINERS: add and consolidate Black Sesame Technologies (BST) ARM
SoC support
.../devicetree/bindings/arm/bst.yaml | 34 + .../bindings/mmc/bst,dwcmshc-sdhci.yaml | 115 +++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + MAINTAINERS | 10 + arch/arm64/Kconfig.platforms | 19 + arch/arm64/boot/dts/Makefile | 1 + arch/arm64/boot/dts/bst/Makefile | 10 + .../dts/bst/bstc1200-cdcu1.0-adas_4c2g.dts | 44 + arch/arm64/boot/dts/bst/bstc1200.dtsi | 130 +++ arch/arm64/configs/defconfig | 3 + drivers/mmc/host/Kconfig | 11 + drivers/mmc/host/Makefile | 1 + drivers/mmc/host/sdhci-of-bst-c1200.c | 920 ++++++++++++++++++ 13 files changed, 1300 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/bst.yaml create mode 100644 Documentation/devicetree/bindings/mmc/bst,dwcmshc-sdhci.yaml create mode 100644 arch/arm64/boot/dts/bst/Makefile create mode 100644 arch/arm64/boot/dts/bst/bstc1200-cdcu1.0-adas_4c2g.dts create mode 100644 arch/arm64/boot/dts/bst/bstc1200.dtsi create mode 100644 drivers/mmc/host/sdhci-of-bst-c1200.c
Signature · 1 line
2.25.1
PATCH v2 2/8 dt-bindings: arm: add Black Sesame Technologies (bst) SoC
In reply to Albert YangAdd device tree bindings for Black Sesame Technologies Arm SoC, it consists several SoC models like C1200, etc.
---
Changes for v2:
- Removed unnecessary pipe (|) in description
- Dropped invalid compatible entry for standalone SoC
- Removed root node ($nodename: '/') definition
--- .../devicetree/bindings/arm/bst.yaml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/bst.yaml
Documentation/devicetree/bindings/arm/bst.yaml new file +30 -0
@@ -0,0 +1,30 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/arm/bst.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: BST platforms + +description: + Black Sesame Technologies (BST) is a semiconductor company that produces + automotive-grade system-on-chips (SoCs) for intelligent driving, focusing + on computer vision and AI capabilities. The BST C1200 family includes SoCs + for ADAS (Advanced Driver Assistance Systems) and autonomous driving applications. + +maintainers: + - Ge Gordon <[email protected]> + +properties: + $nodename: + const: '/' + compatible: + oneOf: + - description: BST C1200 CDCU1.0 ADAS 4C2G board + items: + - const: bst,c1200-cdcu1.0-adas-4c2g + - const: bst,c1200 + +additionalProperties: true + +...
Signature · 1 line
2.25.1
PATCH v2 7/8 arm64: defconfig: enable BST C1200 DWCMSHC SDHCI controller
In reply to Albert YangEnable the BST C1200 DWCMSHC SDHCI controller driver (CONFIG_MMC_SDHCI_BST)
in the ARM64 defconfig to support eMMC/SD card access on Black Sesame Technologies C1200 series SoCs.
This driver provides hardware-specific implementation for the Synopsys DesignWare Mobile Storage Host Controller integrated in BST SoCs.
--- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
@@ -1188,6 +1188,7 @@ CONFIG_MMC_SDHCI_CADENCE=y CONFIG_MMC_SDHCI_ESDHC_IMX=y CONFIG_MMC_SDHCI_TEGRA=y CONFIG_MMC_SDHCI_F_SDH30=y +CONFIG_MMC_SDHCI_BST=y CONFIG_MMC_MESON_GX=y CONFIG_MMC_SDHCI_MSM=y CONFIG_MMC_SPI=y
Signature · 1 line
2.25.1
v2 cover arm64: Introduce Black Sesame Technologies C1200 SoC and CDCU1.0 board
In reply to Albert YangBlack Sesame Technologies C1200 is a high-performance Armv8 SoC designed for automotive and industrial applications. The CDCU1.0 (Central Domain Control Unit) board is the development platform built by Black Sesame Technologies. You can find more information about the SoC and related boards at:
https://bst.ai
Currently, to run the upstream kernel on the CDCU1.0 board, you need to use the bootloader provided by Black Sesame Technologies. The board supports various interfaces including MMC/SD card, which is implemented using the BST C1200 DWCMSHC SDHCI controller.
In this series, we add initial SoC and board support for kernel building. The series includes:
Patch 1: Add Black Sesame Technologies vendor prefix in vendor-prefixes.yaml
- Adds "bst" vendor prefix for Black Sesame Technologies Co., Ltd.
- Required for device tree bindings to properly identify BST hardware
Patch 2: Add device tree bindings for BST SoC platforms
- Creates new binding file Documentation/devicetree/bindings/arm/bst.yaml
- Defines compatible strings for BST C1200 family and C1200 CDCU1.0 board
- Documents BST's focus on automotive-grade SoCs for ADAS applications
Patch 3: Add ARCH_BST configuration for BST silicon support
- Adds Kconfig option for BST architecture support
- Enables building kernel for BST platforms
Patch 4: Add device tree binding for BST DWCMSHC SDHCI controller
- Documents the BST C1200 SDHCI controller binding
- Required for MMC/SD card support on BST platforms
Patch 5: Add BST C1200 SDHCI controller driver
- Implements the MMC host controller driver for BST C1200
- Enables SD card support on BST platforms
Patch 6: Add device tree support for BST C1200 CDCU1.0 board
- Adds device tree source files for C1200 SoC and CDCU1.0 board
- Configures hardware components including MMC controller
Patch 7: Enable BST SoC in arm64 defconfig
- Adds ARCH_BST configuration to default arm64 config
Patch 8: Enable BST C1200 DWCMSHC controller in defconfig
- Enables MMC controller driver in default arm64 config
Patch 9: Update MAINTAINERS for BST support
- Adds maintainer information for BST ARM SoC support
- Consolidates BST-related entries
Changes for v2:
- Pass dts build check and mmc driver build check with below commands:
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- O=build_dir CHECK_DTBS=y bst/bstc1200-cdcu1.0-adas_4c2g.dtb W=1 make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- drivers/mmc/host/ W=1 O=build_dir
- Patch 2:
1. Removed unnecessary pipe (|) in description
2. Dropped invalid compatible entry for standalone SoC
3. Removed root node ($nodename: '/') definition
- Patch 3:
1. Placed the configuration entry in correct alphabetical order
2. Used generic family name (ARCH_BST) instead of SoC-specific naming
3. Followed upstream kernel naming and description conventions
- Patch 4:
1. Simplified description, removed redundant paragraphs
2. Updated $schema to reference mmc-specific scheme
3. Corrected compatible to add soc name
(bst,c1200-dwcmshc-sdhci)
4. Removed all redundant property descriptions
5. Dropped invalid mmc_crm_base/size properties, use reg for all address ranges
6. Cleaned up required properties to only essential entries
7. Standardized example DTS format, fixed reg syntax and property ordering
8. Removed additionalProperties: true
- Patch 5:
1. Dependency Simplification:
- Removed COMMON_CLK dependency from Kconfig (MMC_SDHCI_BST)
- Add ARCH_BST || COMPILE_TES dependency from Kconfig (MMC_SDHCI_BST)
2. Resource Management Improvements:
- Replaced temporary ioremap with persistent mapping
* Mapped CRM registers once during probe instead of per-access
* Added proper cleanup in remove callback
- Refactored bounce buffer allocation:
* Simplified error handling and memory management
* Removed unnecessary DMA configuration layers
3. Code Cleanup & Optimization:
- Pruned unused headers and legacy vendor debug code
- Removed deprecated sdhci_bst_print_vendor() export
- Converted internal functions to static scope
- Standardized naming conventions:
* Renamed DRIVER_NAME to match kernel standards
* Changed default_max_freq to DEFAULT_MAX_FREQ
- Optimized clock configuration routines
4. Hardware Integration Fixes:
- Fixed register access macros for EMMC_CTRL
* Added proper offset calculation via SDHCI_VENDOR_PTR_R
- Corrected device tree compatibility string to:
"bst,c1200-dwcmshc-sdhci"
5. Error Handling Enhancements:
- Added robust ioremap error checking
- Improved bounce buffer allocation failure handling
- Streamlined probe/remove flow
6. Maintainability:
- Updated MODULE_DESCRIPTION and AUTHOR fields
- Added explanatory comments for hardware limitations
- Removed redundant multi-host setup infrastructure
7. fix build warnings from lkp
| Reported-by: kernel test robot <[email protected]> | Closes:
https://lore.kernel.org/oe-kbuild-all/[email protected]/
- Patch 6:
1. Reorganized memory map into discrete regions
2. Updated MMC controller definition:
- Split into core/CRM register regions
- Removed deprecated properties
- Updated compatible string
3. Standardized interrupt definitions and numeric formats
4. Removed reserved-memory node (superseded by bounce buffers)
5. Added root compatible string for platform identification
6. Add soc defconfig
Albert Yang (8):
dt-bindings: vendor-prefixes: Add Black Sesame Technologies Co., Ltd.
dt-bindings: arm: add Black Sesame Technologies (bst) SoC
arm64: Kconfig: add ARCH_BST for bst silicons
dt-bindings: mmc: add binding for BST DWCMSHC SDHCI controller
mmc: sdhci: add Black Sesame Technologies BST C1200 controller driver
arm64: dts: bst: add support for Black Sesame Technologies C1200
CDCU1.0 board and defconfig
arm64: defconfig: enable BST C1200 DWCMSHC SDHCI controller
MAINTAINERS: add and consolidate Black Sesame Technologies (BST) ARM
SoC support
.../devicetree/bindings/arm/bst.yaml | 30 + .../bindings/mmc/bst,dwcmshc-sdhci.yaml | 67 +++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + MAINTAINERS | 10 + arch/arm64/Kconfig.platforms | 10 + arch/arm64/boot/dts/Makefile | 1 + arch/arm64/boot/dts/bst/Makefile | 2 + .../dts/bst/bstc1200-cdcu1.0-adas_4c2g.dts | 60 ++ arch/arm64/boot/dts/bst/bstc1200.dtsi | 117 ++++ arch/arm64/configs/defconfig | 2 + drivers/mmc/host/Kconfig | 11 + drivers/mmc/host/Makefile | 1 + drivers/mmc/host/sdhci-of-bst-c1200.c | 557 ++++++++++++++++++ 13 files changed, 870 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/bst.yaml create mode 100644 Documentation/devicetree/bindings/mmc/bst,dwcmshc-sdhci.yaml create mode 100644 arch/arm64/boot/dts/bst/Makefile create mode 100644 arch/arm64/boot/dts/bst/bstc1200-cdcu1.0-adas_4c2g.dts create mode 100644 arch/arm64/boot/dts/bst/bstc1200.dtsi create mode 100644 drivers/mmc/host/sdhci-of-bst-c1200.c
Signature · 1 line
2.25.1
PATCH v2 1/8 dt-bindings: vendor-prefixes: Add Black Sesame Technologies Co., Ltd.
Black Sesame Technologies Co., Ltd.s a leading automotive-grade computing SoC and SoC-based
intelligent vehicle solution provider. Link: https://bst.ai/.
--- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/vendor-prefixes.yaml +2 -0
@@ -222,6 +222,8 @@ patternProperties: description: Shenzhen BigTree Tech Co., LTD "^bitmain,.*": description: Bitmain Technologies + "^bst,.*": + description: Black Sesame Technologies Co., Ltd. "^blaize,.*": description: Blaize, Inc. "^blutek,.*":
Signature · 1 line
2.25.1
PATCH v2 6/8 arm64: dts: bst: add support for Black Sesame Technologies C1200 CDCU1.0 board and defconfig
In reply to Albert YangAdd device tree support for the Black Sesame Technologies (BST) C1200 CDCU1.0 ADAS 4C2G platform. This platform is based on the BST C1200 SoC family.
The changes include:
- Adding a new BST device tree directory
- Adding Makefile entries to build the BST platform device trees
- Adding the device tree for the BST C1200 CDCU1.0 ADAS 4C2G board
This board features a quad-core Cortex-A78 CPU, and various peripherals including UART, MMC, watchdog timer, and interrupt controller.
---
Changes for v2:
1. Reorganized memory map into discrete regions
2. Updated MMC controller definition:
- Split into core/CRM register regions
- Removed deprecated properties
- Updated compatible string
3. Standardized interrupt definitions and numeric formats
4. Removed reserved-memory node (superseded by bounce buffers)
5. Added root compatible string for platform identification
6. Add soc defconfig
--- arch/arm64/boot/dts/Makefile | 1 + arch/arm64/boot/dts/bst/Makefile | 2 + .../dts/bst/bstc1200-cdcu1.0-adas_4c2g.dts | 60 +++++++++ arch/arm64/boot/dts/bst/bstc1200.dtsi | 117 ++++++++++++++++++ arch/arm64/configs/defconfig | 1 + 5 files changed, 181 insertions(+) create mode 100644 arch/arm64/boot/dts/bst/Makefile create mode 100644 arch/arm64/boot/dts/bst/bstc1200-cdcu1.0-adas_4c2g.dts create mode 100644 arch/arm64/boot/dts/bst/bstc1200.dtsi
arch/arm64/boot/dts/Makefile +1 -0
@@ -12,6 +12,7 @@ subdir-y += arm subdir-y += bitmain subdir-y += blaize subdir-y += broadcom +subdir-y += bst subdir-y += cavium subdir-y += exynos subdir-y += freescale
arch/arm64/boot/dts/bst/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0 +dtb-$(CONFIG_ARCH_BST) += bstc1200-cdcu1.0-adas_4c2g.dtb
arch/arm64/boot/dts/bst/bstc1200-cdcu1.0-adas_4c2g.dts new file +60 -0
60 lines not on this page · raw message
arch/arm64/boot/dts/bst/bstc1200.dtsi new file +117 -0
117 lines not on this page · raw message
arch/arm64/configs/defconfig +1 -0
@@ -45,6 +45,7 @@ CONFIG_ARCH_BCMBCA=y CONFIG_ARCH_BRCMSTB=y CONFIG_ARCH_BERLIN=y CONFIG_ARCH_BLAIZE=y +CONFIG_ARCH_BST=y CONFIG_ARCH_EXYNOS=y CONFIG_ARCH_SPARX5=y CONFIG_ARCH_K3=y
Signature · 1 line
2.25.1
PATCH v2 4/8 dt-bindings: mmc: add binding for BST DWCMSHC SDHCI controller
In reply to Albert YangAdd device tree binding documentation for the Black Sesame Technologies (BST) DWCMSHC SDHCI controller.
This binding describes the required and optional properties for the bst,dwcmshc-sdhci compatible controller, including register layout, interrupts, bus width, clock configuration, and other controller-specific features.
---
Changes for v2:
- Simplified description, removed redundant paragraphs
- Updated $schema to reference mmc-specific scheme
- Corrected compatible to add soc name (bst,c1200-dwcmshc-sdhci)
- Removed all redundant property descriptions
- Dropped invalid mmc_crm_base/size properties, use reg for all address ranges
- Cleaned up required properties to only essential entries
- Standardized example DTS format, fixed reg syntax and property ordering
- Removed additionalProperties: true
--- .../bindings/mmc/bst,dwcmshc-sdhci.yaml | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Documentation/devicetree/bindings/mmc/bst,dwcmshc-sdhci.yaml
Documentation/devicetree/bindings/mmc/bst,dwcmshc-sdhci.yaml new file +67 -0
@@ -0,0 +1,67 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mmc/bst,dwcmshc-sdhci.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Black Sesame Technologies DWCMSHC SDHCI Controller + +maintainers: + - Ge Gordon <[email protected]> + +allOf: + - $ref: mmc-controller.yaml# + +properties: + compatible: + const: bst,c1200-dwcmshc-sdhci + + reg: + maxItems: 2 + description: | + Register base addresses and sizes for the SDHCI controller. + First entry is the core SDHCI registers, second entry is the + CRM registers. + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: core + + memory-region: + maxItems: 1 + + dma-coherent: true + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + + mmc@22200000 { + compatible = "bst,c1200-dwcmshc-sdhci"; + reg = <0x0 0x22200000 0x0 0x1000>, + <0x0 0x23006000 0x0 0x1000>; + interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clk_mmc>; + clock-names = "core"; + memory-region = <&mmc0_reserved>; + max-frequency = <200000000>; + bus-width = <8>; + non-removable; + dma-coherent; + status = "disabled"; + };
Signature · 1 line
2.25.1
PATCH v2 8/8 MAINTAINERS: add and consolidate Black Sesame Technologies (BST) ARM SoC support
In reply to Albert YangAdd and consolidate the MAINTAINERS entry for Black Sesame Technologies ARM SoC support. This entry covers device tree bindings, drivers, and board files for BST SoCs, including MMC, and platform support.
--- MAINTAINERS | 10 ++++++++++ 1 file changed, 10 insertions(+)
MAINTAINERS +10 -0
@@ -2441,6 +2441,16 @@ S: Maintained F: Documentation/devicetree/bindings/arm/blaize.yaml F: arch/arm64/boot/dts/blaize/ +ARM/BST SOC SUPPORT +M: Ge Gordon <[email protected]> +R: BST Linux Kernel Upstream Group <[email protected]> +L: [email protected] (moderated for non-subscribers) +S: Maintained +F: Documentation/devicetree/bindings/arm/bst.yaml +F: Documentation/devicetree/bindings/mmc/bst,dwcmshc-sdhci.yaml +F: arch/arm64/boot/dts/bst/ +F: drivers/mmc/host/sdhci-of-bst-c1200.c + ARM/CALXEDA HIGHBANK ARCHITECTURE M: Andre Przywara <[email protected]> L: [email protected] (moderated for non-subscribers)
Signature · 1 line
2.25.1
PATCH v2 3/8 arm64: Kconfig: add ARCH_BST for bst silicons
In reply to Albert YangAdd ARCH_BST for bst SoC series support.
---
Changes for v2:
- Placed the configuration entry in correct alphabetical order
- Used generic family name (ARCH_BST) instead of SoC-specific naming
- Followed upstream kernel naming and description conventions
--- arch/arm64/Kconfig.platforms | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/arm64/Kconfig.platforms +10 -0
@@ -106,6 +106,14 @@ config ARCH_BLAIZE help This enables support for the Blaize SoC family +config ARCH_BST + bool "Black Sesame Technologies SoC Family" + help + This enables support for Black Sesame Technologies (BST) SoC family. + BST produces automotive-grade system-on-chips for intelligent driving, + focusing on computer vision and AI capabilities. The BST C1200 family + includes SoCs for ADAS and autonomous driving applications. + config ARCH_EXYNOS bool "Samsung Exynos SoC family" select COMMON_CLK_SAMSUNG
@@ -402,4 +410,6 @@ config ARCH_ZYNQMP help This enables support for Xilinx ZynqMP Family + + endmenu # "Platform selection"
Signature · 1 line
2.25.1
Krzysztof Kozlowski
maintainerRe: [PATCH v2 1/8] dt-bindings: vendor-prefixes: Add Black Sesame Technologies Co., Ltd.
In reply to Albert YangQuoted 8 lines · Albert Yang
Black Sesame Technologies Co., Ltd.s a leading automotive-grade computing SoC and SoC-based
intelligent vehicle solution provider. Link: https://bst.ai/.Signed-off-by Ge Gordon <[email protected]>Signed-off-by Albert Yang <[email protected]>---
Why is this attached to v1?
Where is the changelog?
Most of your emails did not reach mailing list. I also did not get them.
... and the huge amount of CC list, mostly redundant and not relevant to this work, could explain that. Don't Cc random people.
Anyway, fix above points - all three - and resend after 24h at least. Or consider using b4 relay, if this hits rejections/spam.
Best regards,
Krzysztof
Krzysztof Kozlowski
maintainerRe: [PATCH v2 7/8] arm64: defconfig: enable BST C1200 DWCMSHC SDHCI controller
In reply to Albert YangQuoted 4 lines · Albert Yang
Enable the BST C1200 DWCMSHC SDHCI controller driver (
CONFIG_MMC_SDHCI_BST)
in the ARM64 defconfig to support eMMC/SD card access on Black Sesame Technologies C1200 series SoCs.
Please wrap commit message according to Linux coding style / submission process (neither too early nor over the limit):
https://elixir.bootlin.com/linux/v6.4-rc1/source/Documentation/process/submitting-patches.rst#L597
Quoted 3 lines
This driver provides hardware-specific implementation for the Synopsys DesignWare Mobile Storage Host Controller integrated in BST SoCs.
Redundant, this duplicates earlier paragraph.
Quoted 12 lines
Signed-off-by Ge Gordon <[email protected]>Signed-off-by Albert Yang <[email protected]>--- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+)arch/arm64/configs/defconfig +0
-0
arch/arm64/configs/defconfig CONFIG_MMC_SDHCI_CADENCE=y · line 1191
Quoted 4 lines
arch/arm64/configs/defconfig +1
-0@@ -1188,6 +1188,7 @@ CONFIG_MMC_SDHCI_CADENCE=y CONFIG_MMC_SDHCI_ESDHC_IMX=y CONFIG_MMC_SDHCI_TEGRA=y CONFIG_MMC_SDHCI_F_SDH30=y +CONFIG_MMC_SDHCI_BST=y
This makes little sense without your arch. :/ Send one defconfig patch enabling everything wha tis necessary.
Best regards,
Krzysztof
Krzysztof Kozlowski
maintainerRe: [PATCH v2 6/8] arm64: dts: bst: add support for Black Sesame Technologies C1200 CDCU1.0 board and defconfig
In reply to Albert YangQuoted 24 lines · Albert Yang
Add device tree support for the Black Sesame Technologies (BST) C1200 CDCU1.0 ADAS 4C2G platform. This platform is based on the BST C1200 SoC family.
The changes include:
- Adding a new BST device tree directory
- AddingMakefileentries to build the BST platform device trees
- Adding the device tree for the BST C1200 CDCU1.0 ADAS 4C2G boardThis board features a quad-core Cortex-A78 CPU, and various peripherals including UART, MMC, watchdog timer, and interrupt controller.
---
Changes for v2:
1. Reorganized memory map into discrete regions
2. Updated MMC controller definition:
- Split into core/CRM register regions
- Removed deprecated properties
- Updated compatible string
3. Standardized interrupt definitions and numeric formats
4. Removed reserved-memory node (superseded by bounce buffers)
5. Added root compatible string for platform identification
6. Add soc defconfig
Quoted 2 lines
Signed-off-by Ge Gordon <[email protected]>Signed-off-by Albert Yang <[email protected]>
This is messed. SoB does not go to changelog. Apply your patch and look at result - do you see SoB? No, because changelog is stripped. submitting patches explains how this is supposed to look like.
Quoted 37 lines
--- arch/arm64/boot/dts/Makefile | 1 + arch/arm64/boot/dts/bst/Makefile | 2 + .../dts/bst/bstc1200-cdcu1.0-adas_4c2g.dts | 60 +++++++++ arch/arm64/boot/dts/bst/bstc1200.dtsi | 117 ++++++++++++++++++ arch/arm64/configs/defconfig | 1 + 5 files changed, 181 insertions(+) create mode 100644 arch/arm64/boot/dts/bst/Makefile create mode 100644 arch/arm64/boot/dts/bst/bstc1200-cdcu1.0-adas_4c2g.dts create mode 100644 arch/arm64/boot/dts/bst/bstc1200.dtsiarch/arm64/boot/dts/Makefile +1
-0@@ -12,6 +12,7 @@ subdir-y += arm subdir-y += bitmain subdir-y += blaize subdir-y += broadcom +subdir-y += bst subdir-y += cavium subdir-y += exynos subdir-y += freescalearch/arm64/boot/dts/bst/Makefile new file +2
-0@@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0 +dtb-$(CONFIG_ARCH_BST) += bstc1200-cdcu1.0-adas_4c2g.dtbarch/arm64/boot/dts/bst/bstc1200-cdcu1.0-adas_4c2g.dts new file +0
-0
arch/arm64/boot/dts/bst/bstc1200-cdcu1.0-adas_4c2g.dts line 8
Quoted 8 lines
arch/arm64/boot/dts/bst/bstc1200-cdcu1.0-adas_4c2g.dts new file +8
-0@@ -0,0 +1,60 @@ +// SPDX-License-Identifier: GPL-2.0 +/dts-v1/; + +#include "bstc1200.dtsi" + +/ { + model = "BST C1200-96 CDCU1.0 4C2G"; + compatible = "bst,c1200-cdcu1.0-adas-4c2g", "bst,c1200";
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.
Quoted 19 lines
arch/arm64/boot/dts/bst/bstc1200-cdcu1.0-adas_4c2g.dts new file +19
-0+ + chosen { + stdout-path = "serial0:115200n8"; + }; + + memory@810000000 { + device_type = "memory"; + reg = <0x8 0x10000000 0x0 0x30000000>; + }; + + memory@8c0000000 { + device_type = "memory"; + reg = <0x8 0xc0000000 0x1 0x0>; + }; + + memory@c00000000 { + device_type = "memory"; + reg = <0xc 0x0 0x0 0x40000000>; + };
arch/arm64/boot/dts/bst/bstc1200-cdcu1.0-adas_4c2g.dts line 37
Quoted 10 lines
arch/arm64/boot/dts/bst/bstc1200-cdcu1.0-adas_4c2g.dts new file +10
-0+ + memory@800254000 { + device_type = "memory"; + reg = <0x8 0x254000 0x0 0x1000>; + }; + + memory@800151000 { + device_type = "memory"; + reg = <0x8 0x151000 0x0 0x1000>; + };
Why do you have multiple memory nodes, not one?
Also, why aren't these sorted according to DTS coding style?
Quoted 46 lines
arch/arm64/boot/dts/bst/bstc1200-cdcu1.0-adas_4c2g.dts new file +23
-0+ + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + mmc0_reserved: mmc0@5160000 { + compatible = "shared-dma-pool"; + reg = <0x0 0x5160000 0x0 0x10000>; + no-map; + }; + }; +}; + +&uart0 { + status = "okay"; +}; + +&mmc0 { + status = "okay"; + memory-region = <&mmc0_reserved>; +}; +arch/arm64/boot/dts/bst/bstc1200.dtsi new file +17
-0@@ -0,0 +1,117 @@ +// SPDX-License-Identifier: GPL-2.0 +#include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/interrupt-controller/irq.h> + +/ { + compatible = "bst,c1200"; + #address-cells = <2>; + #size-cells = <2>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + compatible = "arm,cortex-a78"; + device_type = "cpu"; + enable-method = "psci";
arch/arm64/boot/dts/bst/bstc1200.dtsi line 27
Quoted 10 lines
arch/arm64/boot/dts/bst/bstc1200.dtsi new file +10
-0+ next-level-cache = <&l2_cache>; + reg = <0>; + }; + + cpu@1 { + compatible = "arm,cortex-a78"; + device_type = "cpu"; + enable-method = "psci"; + next-level-cache = <&l2_cache>; + reg = <0x100>;
Nothing improved. I asked to follow DTS coding style in ordering.
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.
You already got this comment. How did you resolve it? You never responded to comments, so does it mean you just ignored it or something was not clear? In any case, repeating the same mistake is not getting this code merged, so respond to comment.
Quoted 9 lines
arch/arm64/boot/dts/bst/bstc1200.dtsi new file +9
-0+ }; + + cpu@2 { + compatible = "arm,cortex-a78"; + device_type = "cpu"; + enable-method = "psci"; + next-level-cache = <&l2_cache>; + reg = <0x200>; + };
arch/arm64/boot/dts/bst/bstc1200.dtsi line 46
Quoted 10 lines
arch/arm64/boot/dts/bst/bstc1200.dtsi new file +10
-0+ + cpu@3 { + compatible = "arm,cortex-a78"; + device_type = "cpu"; + enable-method = "psci"; + next-level-cache = <&l2_cache>; + reg = <0x300>; + }; + + l2_cache: l2-cache-1 {
l2-cache. Otherwise it is incomplete, so add the second one.
arch/arm64/boot/dts/bst/bstc1200.dtsi line 59
Quoted 13 lines
arch/arm64/boot/dts/bst/bstc1200.dtsi new file +13
-0+ compatible = "cache"; + cache-level = <2>; + cache-unified; + }; + }; + + clk_mmc: clock-4000000 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <4000000>; + }; + + timer {
t > s
Quoted 4 lines
arch/arm64/boot/dts/bst/bstc1200.dtsi new file +4
-0+ compatible = "arm,armv8-timer"; + interrupt-parent = <&gic>; + always-on; + interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>,
arch/arm64/boot/dts/bst/bstc1200.dtsi line 73
Quoted 10 lines
arch/arm64/boot/dts/bst/bstc1200.dtsi new file +10
-0+ <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>; + }; + + soc: soc@0 { + compatible = "simple-bus"; + #address-cells = <2>; + #size-cells = <2>; + ranges = <0x0 0x0 0x0 0x0 0xffffffff 0xffffffff>;
Nothing improved. I asked to follow DTS coding style in ordering.
Quoted 25 lines
arch/arm64/boot/dts/bst/bstc1200.dtsi new file +25
-0+ interrupt-parent = <&gic>; + + mmc0: mmc@22200000 { + compatible = "bst,c1200-dwcmshc-sdhci"; + reg = <0x0 0x22200000 0x0 0x1000>, + <0x0 0x23006000 0x0 0x1000>; + interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clk_mmc>; + clock-names = "core"; + max-frequency = <200000000>; + bus-width = <8>; + non-removable; + dma-coherent; + status = "disabled"; + }; + + uart0: serial@20008000 { + compatible = "snps,dw-apb-uart"; + reg = <0x0 0x20008000 0x0 0x1000>; + interrupts = <GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <25000000>; + reg-shift = <2>; + reg-io-width = <4>; + status = "disabled"; + };
arch/arm64/boot/dts/bst/bstc1200.dtsi line 108
Quoted 10 lines
arch/arm64/boot/dts/bst/bstc1200.dtsi new file +10
-0+ + gic: interrupt-controller@32800000 { + compatible = "arm,gic-v3"; + #interrupt-cells = <3>; + #address-cells = <2>; + #size-cells = <2>; + interrupt-controller; + ranges; + reg = <0x0 0x32800000 0x0 0x10000>, + <0x0 0x32880000 0x0 0x100000>;
Nothing improved. I asked to follow DTS coding style in ordering.
arch/arm64/boot/dts/bst/bstc1200.dtsi line 113
Quoted 5 lines
arch/arm64/boot/dts/bst/bstc1200.dtsi new file +5
-0+ interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>; + }; + }; + + psci {
p < s, it is really randomly put :/
arch/arm64/configs/defconfig
Quoted 8 lines
arch/arm64/boot/dts/bst/bstc1200.dtsi new file +4
-0+ compatible = "arm,psci-1.0"; + method = "smc"; + }; +};arch/arm64/configs/defconfig +0
-0
This is not a DTS patch.
arch/arm64/configs/defconfig CONFIG_ARCH_BCMBCA=y · line 51
Quoted 8 lines
arch/arm64/configs/defconfig +1
-0@@ -45,6 +45,7 @@ CONFIG_ARCH_BCMBCA=y CONFIG_ARCH_BRCMSTB=y CONFIG_ARCH_BERLIN=y CONFIG_ARCH_BLAIZE=y +CONFIG_ARCH_BST=y CONFIG_ARCH_EXYNOS=y CONFIG_ARCH_SPARX5=y CONFIG_ARCH_K3=y
Best regards,
Krzysztof
PATCH v2 5/8 mmc: sdhci: add Black Sesame Technologies BST C1200 controller driver
In reply to Albert YangAdd a driver for the DesignWare Mobile Storage Host Controller (DWCMSHC) SDHCI controller found in Black Sesame Technologies C1200 SoCs.
The driver provides specialized clock configuration, tuning, voltage switching, and power management for the BST DWCMSHC controller. It also includes support for eMMC boot and memory-mapped I/O for CRM registers.
---
Changes for v2:
1. Dependency Simplification :
- Removed COMMON_CLK dependency from Kconfig (MMC_SDHCI_BST)
- Add ARCH_BST || COMPILE_TEST dependency from Kconfig (MMC_SDHCI_BST)
2. Resource Management Improvements :
- Replaced temporary ioremap with persistent mapping
* Mapped CRM registers once during probe instead of per-access
* Added proper cleanup in remove callback
- Refactored bounce buffer allocation:
* Simplified error handling and memory management
* Removed unnecessary DMA configuration layers
3. Code Cleanup & Optimization :
- Pruned unused headers and legacy vendor debug code
- Removed deprecated sdhci_bst_print_vendor() export
- Converted internal functions to static scope
- Standardized naming conventions:
* Renamed DRIVER_NAME to match kernel standards
* Changed default_max_freq to DEFAULT_MAX_FREQ
- Optimized clock configuration routines
4. Hardware Integration Fixes :
- Fixed register access macros for EMMC_CTRL
* Added proper offset calculation via SDHCI_VENDOR_PTR_R
- Corrected device tree compatibility string to:
"bst,c1200-dwcmshc-sdhci"
5. Error Handling Enhancements :
- Added robust ioremap error checking
- Improved bounce buffer allocation failure handling
- Streamlined probe/remove flow
6. Maintainability :
- Updated MODULE_DESCRIPTION and AUTHOR fields
- Added explanatory comments for hardware limitations
- Removed redundant multi-host setup infrastructure
7. fix build warnings from lkp
| Reported-by: kernel test robot <[email protected]> | Closes:
https://lore.kernel.org/oe-kbuild-all/[email protected]/
--- drivers/mmc/host/Kconfig | 11 + drivers/mmc/host/Makefile | 1 + drivers/mmc/host/sdhci-of-bst-c1200.c | 557 ++++++++++++++++++++++++++ 3 files changed, 569 insertions(+) create mode 100644 drivers/mmc/host/sdhci-of-bst-c1200.c
drivers/mmc/host/Kconfig +11 -0
@@ -1126,3 +1126,14 @@ config MMC_LITEX module will be called litex_mmc. If unsure, say N. + +config MMC_SDHCI_BST + tristate "SDHCI OF support for the BST DWC MSHC" + depends on ARCH_BST || COMPILE_TEST + depends on MMC_SDHCI_PLTFM + depends on OF + help + This selects Synopsys DesignWare Cores Mobile Storage Controller + support. + If you have a controller with this interface, say Y or M here. + If unsure, say N.
drivers/mmc/host/Makefile +1 -0
@@ -13,6 +13,7 @@ obj-$(CONFIG_MMC_MXS) += mxs-mmc.o obj-$(CONFIG_MMC_SDHCI) += sdhci.o obj-$(CONFIG_MMC_SDHCI_UHS2) += sdhci-uhs2.o obj-$(CONFIG_MMC_SDHCI_PCI) += sdhci-pci.o +obj-$(CONFIG_MMC_SDHCI_BST) += sdhci-of-bst-c1200.o sdhci-pci-y += sdhci-pci-core.o sdhci-pci-o2micro.o sdhci-pci-arasan.o \ sdhci-pci-dwc-mshc.o sdhci-pci-gli.o obj-$(CONFIG_MMC_SDHCI_ACPI) += sdhci-acpi.o
drivers/mmc/host/sdhci-of-bst-c1200.c new file +557 -0
557 lines not on this page · raw message
Signature · 1 line
2.25.1
Arnd Bergmann
maintainerRe: [PATCH v2 5/8] mmc: sdhci: add Black Sesame Technologies BST C1200 controller driver
drivers/mmc/host/Kconfig config MMC_LITEX · line 1137
Quoted 9 lines · Albert Yang
drivers/mmc/host/Kconfig +9
-0+ +config MMC_SDHCI_BST + tristate "SDHCI OF support for the BST DWC MSHC" + depends on ARCH_BST || COMPILE_TEST + depends on MMC_SDHCI_PLTFM + depends on OF + help + This selects Synopsys DesignWare Cores Mobile Storage Controller + support.
The description does not mention the actual device it's for but only DesignWare.
Try to keep this sorted alphabetically between the other CONFIG_MMC_SDHCI_* backends
drivers/mmc/host/sdhci-of-bst-c1200.c line 27
Quoted 6 lines
drivers/mmc/host/sdhci-of-bst-c1200.c new file +6
-0+ +struct dwcmshc_priv { +void __iomem *crm_reg_base; +u32 phy_crm_reg_base; +u32 phy_crm_reg_size; +};
You are only using the first member here, the phy_crm_reg_base and phy_crm_reg_size are assigned during probe but not referenced later. devm_platform_ioremap_resource() should help simplify that code further.
drivers/mmc/host/sdhci-of-bst-c1200.c line 59
Quoted 5 lines
drivers/mmc/host/sdhci-of-bst-c1200.c new file +5
-0+ +static void bst_write_phys_bst (void __iomem *addr,u32 value) +{ +iowrite32 (value, addr); +}
You always pass priv->crm_reg_base into this helper, so it would be simpler to make it take the sdhci_pltfm_host pointer and the offset instead of the address.
drivers/mmc/host/sdhci-of-bst-c1200.c line 388
Quoted 13 lines
drivers/mmc/host/sdhci-of-bst-c1200.c new file +13
-0+static int bst_sdhci_reallocate_bounce_buffer (struct sdhci_host *host) +{ +struct mmc_host *mmc = host->mmc; +unsigned int max_blocks; +unsigned int bounce_size; +int ret; + +/* +* Cap the bounce buffer at 64KB. Using a bigger bounce buffer +* has diminishing returns, this is probably because SD/MMC +* cards are usually optimized to handle this size of requests. +*/ + bounce_size =SZ_32K ;
The comment says 64K, but the size you use is 32K.
drivers/mmc/host/sdhci-of-bst-c1200.c line 453
Quoted 2 lines
drivers/mmc/host/sdhci-of-bst-c1200.c new file +2
-0+/* Get CRM registers from the second reg entry */ + crm_res =platform_get_resource (pdev,IORESOURCE_MEM ,1 );
devm_platform_ioremap_resource()
Quoted 5 lines
drivers/mmc/host/sdhci-of-bst-c1200.c new file +5
-0+/* +* Hardware limitation workaround: +* +* Our platform supports 64-bit physical addressing, but the eMMC +* controller's SRAM-based DMA engine is constrained to a 32-bit
drivers/mmc/host/sdhci-of-bst-c1200.c line 488
Quoted 10 lines
drivers/mmc/host/sdhci-of-bst-c1200.c new file +10
-0+* address space. When using the standard SDHCI interface, which +* allocates DDR-based DMA buffers with 64-bit addresses, the +* dma_map_single() operation fails because the DMA engine cannot +* handle addresses beyond 32 bits. +* +* To resolve this hardware limitation, we implement a bounce buffer +* allocated via dma_alloc_coherent() to satisfy DMA addressing +* constraints. +*/ + err =bst_sdhci_reallocate_bounce_buffer (host);
Having an explanation here makes sense, but I don't think this captures what is actually going on, in particular:
- dma_alloc_coherent() being backed by an SRAM that is under the 4GB boundary
- the problem that the SoC is configured that all of DRAM is outside of ZONE_DMA32
- The type of hardware bug that leads to 64-bit DMA being broken in this SoC.
I still have some hope that the hardware is not actually that broken and you can get it working normally, in one of these ways:
- enabling 64-bit addressing in the parent bus
- enabling SMMU translation for the parent bus
- configuring the parent bus or the sdhci itself to access the first 4GB of RAM, and describing the offset in dma-ranges
- moving the start of RAM in a global SoC config
It is rather unlikely that the SoC designer chose to integrate a 32-bit-only device without adding some way to configure it to access RAM.
Arnd
Krzysztof Kozlowski
maintainerRe: [PATCH v2 5/8] mmc: sdhci: add Black Sesame Technologies BST C1200 controller driver
In reply to Albert YangQuoted 7 lines · Albert Yang
Add a driver for the DesignWare Mobile Storage Host Controller (DWCMSHC) SDHCI controller found in Black Sesame Technologies C1200 SoCs.
The driver provides specialized clock configuration, tuning, voltage switching, and power management for the BST DWCMSHC controller. It also includes support for eMMC boot and memory-mapped I/O for CRM registers.
Missing SoB.
...
Quoted 33 lines
drivers/mmc/host/sdhci-of-bst-c1200.c new file +33
-0+ +static int bst_sdhci_reallocate_bounce_buffer (struct sdhci_host *host) +{ +struct mmc_host *mmc = host->mmc; +unsigned int max_blocks; +unsigned int bounce_size; +int ret; + +/* +* Cap the bounce buffer at 64KB. Using a bigger bounce buffer +* has diminishing returns, this is probably because SD/MMC +* cards are usually optimized to handle this size of requests. +*/ + bounce_size =SZ_32K ; +/* +* Adjust downwards to maximum request size if this is less +* than our segment size, else hammer down the maximum +* request size to the maximum buffer size. +*/ +if (mmc->max_req_size < bounce_size) + bounce_size = mmc->max_req_size; + max_blocks = bounce_size /512 ; + + ret =of_reserved_mem_device_init_by_idx (mmc_dev (mmc),mmc_dev (mmc)->of_node,0 ); +if (ret) { +dev_err (mmc_dev (mmc),"Failed to initialize reserved memory\n" ); +return ret; + } + + host->bounce_buffer =dma_alloc_coherent (mmc_dev (mmc), bounce_size, + &host->bounce_addr,GFP_KERNEL ); +if (!host->bounce_buffer) +return -ENOMEM ;
drivers/mmc/host/sdhci-of-bst-c1200.c line 417
Quoted 10 lines
drivers/mmc/host/sdhci-of-bst-c1200.c new file +10
-0+ + host->bounce_buffer_size = bounce_size; + +/* Lie about this since we're bouncing */ + mmc->max_segs = max_blocks; + mmc->max_seg_size = bounce_size; + mmc->max_req_size = bounce_size; + +dev_info (mmc_dev (mmc),"BST reallocate %s bounce up to %u segments into one, max segment size %u bytes\n" , +mmc_hostname (mmc), max_blocks, bounce_size);
Devices are supposed to be silent on success.
Quoted 1 line
+
...
Quoted 8 lines
+/**
+ *dwcmshc_remove- Platform driver remove
+ * @pdev: Platform device
+ *
+ * Removes the SDHCI host controller.
+ *
+ * Return: 0 on success
+ */
Drop all such fake comments, not helpful. We all now what is the purpose of the function and saying that platform driver remove callback is "platform driver remove" which "Removes the SDHCI host controller." is not only redundant, but actually harming because later you have:
"Return: 0 on success"
which is impossible.
Such redundant comments are not kernel coding style. Provide USEFUL comments, useful kerneldoc, not something to satisfy line-counters.
Best regards,
Krzysztof
Re: [PATCH v2 6/8] arm64: dts: bst: add support for Black Sesame Technologies C1200 CDCU1.0 board and defconfig
In reply to Albert YangOn 2025-07-02 10:44 am, Albert Yang wrote:
[...]
Quoted 62 lines
arch/arm64/boot/dts/bst/bstc1200.dtsi new file +56
-0@@ -0,0 +1,117 @@ +// SPDX-License-Identifier: GPL-2.0 +#include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/interrupt-controller/irq.h> + +/ { + compatible = "bst,c1200"; + #address-cells = <2>; + #size-cells = <2>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + compatible = "arm,cortex-a78"; + device_type = "cpu"; + enable-method = "psci"; + next-level-cache = <&l2_cache>; + reg = <0>; + }; + + cpu@1 { + compatible = "arm,cortex-a78"; + device_type = "cpu"; + enable-method = "psci"; + next-level-cache = <&l2_cache>; + reg = <0x100>; + }; + + cpu@2 { + compatible = "arm,cortex-a78"; + device_type = "cpu"; + enable-method = "psci"; + next-level-cache = <&l2_cache>; + reg = <0x200>; + }; + + cpu@3 { + compatible = "arm,cortex-a78"; + device_type = "cpu"; + enable-method = "psci"; + next-level-cache = <&l2_cache>; + reg = <0x300>; + }; + + l2_cache: l2-cache-1 { + compatible = "cache"; + cache-level = <2>; + cache-unified; + }; + }; + + clk_mmc: clock-4000000 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <4000000>;
arch/arm64/boot/dts/bst/bstc1200.dtsi line 66
Quoted 10 lines
arch/arm64/boot/dts/bst/bstc1200.dtsi new file +10
-0+ }; + + timer { + compatible = "arm,armv8-timer"; + interrupt-parent = <&gic>; + always-on; + interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>;
Your PPIs target 8 of the 4 CPUS? Either way you don't have GICv2, please use the GICv3 binding.
Quoted 10 lines
arch/arm64/boot/dts/bst/bstc1200.dtsi new file +10
-0+ }; + + soc: soc@0 { + compatible = "simple-bus"; + #address-cells = <2>; + #size-cells = <2>; + ranges = <0x0 0x0 0x0 0x0 0xffffffff 0xffffffff>; + interrupt-parent = <&gic>; + + mmc0: mmc@22200000 {
arch/arm64/boot/dts/bst/bstc1200.dtsi line 86
Quoted 10 lines
arch/arm64/boot/dts/bst/bstc1200.dtsi new file +10
-0+ compatible = "bst,c1200-dwcmshc-sdhci"; + reg = <0x0 0x22200000 0x0 0x1000>, + <0x0 0x23006000 0x0 0x1000>; + interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clk_mmc>; + clock-names = "core"; + max-frequency = <200000000>; + bus-width = <8>; + non-removable; + dma-coherent;
Given the funky DMA setup, I can't help be mildly suspicious of this - is the device genuinely I/O coherent and capable of snooping the CPU caches, or are you only getting away with it because dma_init_coherent_memory() happens to remap as non-cacheable regardless?
Thanks,
Robin.
Quoted 43 lines
arch/arm64/boot/dts/bst/bstc1200.dtsi new file +31
-0+ status = "disabled"; + }; + + uart0: serial@20008000 { + compatible = "snps,dw-apb-uart"; + reg = <0x0 0x20008000 0x0 0x1000>; + interrupts = <GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH>; + clock-frequency = <25000000>; + reg-shift = <2>; + reg-io-width = <4>; + status = "disabled"; + }; + + gic: interrupt-controller@32800000 { + compatible = "arm,gic-v3"; + #interrupt-cells = <3>; + #address-cells = <2>; + #size-cells = <2>; + interrupt-controller; + ranges; + reg = <0x0 0x32800000 0x0 0x10000>, + <0x0 0x32880000 0x0 0x100000>; + interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>; + }; + }; + + psci { + compatible = "arm,psci-1.0"; + method = "smc"; + }; +};arch/arm64/configs/defconfig +1
-0@@ -45,6 +45,7 @@ CONFIG_ARCH_BCMBCA=y CONFIG_ARCH_BRCMSTB=y CONFIG_ARCH_BERLIN=y CONFIG_ARCH_BLAIZE=y +CONFIG_ARCH_BST=y CONFIG_ARCH_EXYNOS=y CONFIG_ARCH_SPARX5=y CONFIG_ARCH_K3=y
Krzysztof Kozlowski
maintainerRe: [PATCH v2 3/8] arm64: Kconfig: add ARCH_BST for bst silicons
In reply to Albert YangQuoted 4 lines · Albert Yang
Add
ARCH_BSTfor bst SoC series support.Signed-off-by Ge Gordon <[email protected]>Signed-off-by Albert Yang <[email protected]>
All your patches come in some big delays (this one came 2.5h later). Maybe there is something with mail server on your side?
Quoted 29 lines
---
Changes for v2:
- Placed the configuration entry in correct alphabetical order
- Used generic family name (ARCH_BST) instead of SoC-specific naming
- Followed upstream kernel naming and description conventions--- arch/arm64/Kconfig.platforms | 10 ++++++++++ 1 file changed, 10 insertions(+)arch/arm64/Kconfig.platforms +8
-0@@ -106,6 +106,14 @@ config ARCH_BLAIZE help This enables support for the Blaize SoC family +config ARCH_BST + bool "Black Sesame Technologies SoC Family" + help + This enables support for Black Sesame Technologies (BST) SoC family. + BST produces automotive-grade system-on-chips for intelligent driving, + focusing on computer vision and AI capabilities. The BST C1200 family + includes SoCs for ADAS and autonomous driving applications. + config ARCH_EXYNOS bool "Samsung Exynos SoC family" select COMMON_CLK_SAMSUNG
arch/arm64/Kconfig.platforms config ARCH_ZYNQMP · line 414
Quoted 5 lines
arch/arm64/Kconfig.platforms +2
-0@@ -402,4 +410,6 @@ config ARCH_ZYNQMP help This enables support for Xilinx ZynqMP Family + +
Why this change?
Best regards,
Krzysztof
Re: [PATCH v2 6/8] arm64: dts: bst: add support for Black Sesame Technologies C1200 CDCU1.0 board
In reply to Krzysztof KozlowskiHi Krzysztof,
Thank you for your detailed review and feedback. I have addressed all the issues you mentioned:
Quoted 3 lines
This is messed. SoB does not go to changelog. Apply your patch and look at result - do you see SoB? No, because changelog is stripped. submitting patches explains how this is supposed to look like.
Fixed. Moved Signed-off-by lines to the correct position in commit message, outside of the changelog section.
Quoted 1 line
Nothing improved. I asked to follow DTS coding style in ordering.
Fixed. Reordered all nodes according to DTS coding style:
- Root level nodes: alphabetically ordered (clk_mmc → cpus → psci → soc → timer)
- SoC nodes: ordered by address (uart0@20008000 → mmc0@22200000 → gic@32800000)
- Applied consistent ordering throughout the dtsi file
Quoted 1 line
l2-cache. Otherwise it is incomplete, so add the second one.
Fixed. Renamed l2-cache-1 to l2-cache as per standard naming convention.
Quoted 1 line
Why do you have multiple memory nodes, not one?
Fixed. Consolidated multiple memory nodes into a single memory node with multiple reg entries as required by Device Tree specification:
Before (incorrect):
memory@800151000 { reg = <0x8 0x00151000 0x0 0x1000>; }; memory@800254000 { reg = <0x8 0x00254000 0x0 0x1000>; };
...
After (correct):
memory@800151000 {
reg = <0x8 0x00151000 0x0 0x1000>,
<0x8 0x00254000 0x0 0x1000>,
<0x8 0x10000000 0x0 0x30000000>,
<0x8 0xc0000000 0x1 0x0>,
<0xc 0x00000000 0x0 0x40000000>;};
Quoted 2 lines
It does not look like you tested the DTS against bindings. Please run
make dtbs_check W=1
Fixed. Ran make dtbs_check W=1 and verified no schema violations. DTB builds successfully without warnings.
Quoted 1 line
This is not a DTS patch. (regarding defconfig)
Fixed. Moved all defconfig changes to a separate dedicated commit as suggested. The DTS commit now only contains device tree related changes.
Additionally, I have addressed all feedback from the v1 review:
- Fixed reserved-memory node naming (mmc0-reserved@5160000)
- Corrected all property ordering according to DTS coding style
- Ensured all nodes follow standard naming conventions
All changes have been tested with:
- make ARCH=arm64 bst/bstc1200-cdcu1.0-adas_4c2g.dtb W=1 (successful)
- DTB validation passes without errors
I will send v3 with all these fixes applied.
Best regards,
Albert Yang
Rob Herring (Arm)
maintainerRe: [PATCH v2 4/8] dt-bindings: mmc: add binding for BST DWCMSHC SDHCI controller
In reply to Albert YangQuoted 22 lines · Albert Yang
Add device tree binding documentation for the Black Sesame Technologies (BST) DWCMSHC SDHCI controller.
This binding describes the required and optional properties for the bst,dwcmshc-sdhci compatible controller, including register layout, interrupts, bus width, clock configuration, and other controller-specific features.
---
Changes for v2:
- Simplified description, removed redundant paragraphs
- Updated $schema to reference mmc-specific scheme
- Corrected compatible to add soc name (bst,c1200-dwcmshc-sdhci)
- Removed all redundant property descriptions
- Dropped invalid mmc_crm_base/size properties, use reg for all address ranges
- Cleaned up required properties to only essential entries
- Standardized example DTS format, fixed reg syntax and property ordering
- Removed additionalProperties: true
Quoted 7 lines
Signed-off-by Ge Gordon <[email protected]>Signed-off-by Albert Yang <[email protected]>--- .../bindings/mmc/bst,dwcmshc-sdhci.yaml | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Documentation/devicetree/bindings/mmc/bst,dwcmshc-sdhci.yaml
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/mmc/bst,dwcmshc-sdhci.example.dtb: mmc@22200000 (bst,c1200-dwcmshc-sdhci): reg: [[0, 572522496], [0, 4096], [0, 587227136], [0, 4096]] is too long
from schema $id: http://devicetree.org/schemas/mmc/bst,dwcmshc-sdhci.yaml#
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]
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.
Rob Herring
maintainerRe: [PATCH v2 6/8] arm64: dts: bst: add support for Black Sesame Technologies C1200 CDCU1.0 board
In reply to Albert YangQuoted 32 lines · Albert Yang
Hi Krzysztof,
Thank you for your detailed review and feedback. I have addressed all the issues you mentioned:
Quoted 3 lines
This is messed. SoB does not go to changelog. Apply your patch and look at result - do you see SoB? No, because changelog is stripped. submitting patches explains how this is supposed to look like.
Fixed. Moved Signed-off-by lines to the correct position in commit message, outside of the changelog section.
Quoted 1 line
Nothing improved. I asked to follow DTS coding style in ordering.
Fixed. Reordered all nodes according to DTS coding style:
- Root level nodes: alphabetically ordered (clk_mmc→ cpus → psci → soc → timer)
- SoC nodes: ordered by address (uart0@20008000 → mmc0@22200000 → gic@32800000)
- Applied consistent ordering throughout the dtsi fileQuoted 1 line
l2-cache. Otherwise it is incomplete, so add the second one.
Fixed. Renamed l2-cache-1 to l2-cache as per standard naming convention.
Quoted 1 line
Why do you have multiple memory nodes, not one?
Fixed. Consolidated multiple memory nodes into a single memory node with multiple reg entries as required by Device Tree specification:
Before (incorrect):
memory@800151000 { reg = <0x80x001510000x00x1000>; }; memory@800254000 { reg = <0x80x002540000x00x1000>; };
...
Quoted 4 lines
After (correct):
memory@800151000 { reg = <0x8 0x00151000 0x0 0x1000>, <0x8 0x00254000 0x0 0x1000>,
These are very odd. Are these really main memory vs. some on chip SRAM or some other specific purpose?
A 4KB block doesn't really work if the OS uses 16 or 64KB pages, but I guess that would be up to the OS to ignore them.
Quoted 4 lines
<0x8 0x10000000 0x0 0x30000000>, <0x8 0xc0000000 0x1 0x0>, <0xc 0x00000000 0x0 0x40000000>;};
Rob Herring
maintainerRe: [PATCH v2 4/8] dt-bindings: mmc: add binding for BST DWCMSHC SDHCI controller
In reply to Albert YangQuoted 49 lines · Albert Yang
Add device tree binding documentation for the Black Sesame Technologies (BST) DWCMSHC SDHCI controller.
This binding describes the required and optional properties for the bst,dwcmshc-sdhci compatible controller, including register layout, interrupts, bus width, clock configuration, and other controller-specific features.
---
Changes for v2:
- Simplified description, removed redundant paragraphs
- Updated $schema to reference mmc-specific scheme
- Corrected compatible to add soc name (bst,c1200-dwcmshc-sdhci)
- Removed all redundant property descriptions
- Dropped invalid mmc_crm_base/size properties, use reg for all address ranges
- Cleaned up required properties to only essential entries
- Standardized example DTS format, fixed reg syntax and property ordering
- Removed additionalProperties: trueSigned-off-by Ge Gordon <[email protected]>Signed-off-by Albert Yang <[email protected]>--- .../bindings/mmc/bst,dwcmshc-sdhci.yaml | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Documentation/devicetree/bindings/mmc/bst,dwcmshc-sdhci.yamlDocumentation/devicetree/bindings/mmc/bst,dwcmshc-sdhci.yaml new file +14
-0@@ -0,0 +1,67 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mmc/bst,dwcmshc-sdhci.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Black Sesame Technologies DWCMSHC SDHCI Controller + +maintainers: + - Ge Gordon <[email protected]> + +allOf: + - $ref: mmc-controller.yaml# +
Documentation/devicetree/bindings/mmc/bst,dwcmshc-sdhci.yaml line 24
Quoted 10 lines
Documentation/devicetree/bindings/mmc/bst,dwcmshc-sdhci.yaml new file +10
-0+properties: + compatible: + const: bst,c1200-dwcmshc-sdhci + + reg: + maxItems: 2 + description: | + Register base addresses and sizes for the SDHCI controller. + First entry is the core SDHCI registers, second entry is the + CRM registers.
items:
- description: Core SDHCI registers
- description: CRM registers
Though what CRM is should be defined.
Quoted 32 lines
Documentation/devicetree/bindings/mmc/bst,dwcmshc-sdhci.yaml new file +32
-0+ + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-names: + items: + - const: core + + memory-region: + maxItems: 1 + + dma-coherent: true + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/arm-gic.h> + + mmc@22200000 { + compatible = "bst,c1200-dwcmshc-sdhci"; + reg = <0x0 0x22200000 0x0 0x1000>,
Documentation/devicetree/bindings/mmc/bst,dwcmshc-sdhci.yaml line 66
Quoted 10 lines
Documentation/devicetree/bindings/mmc/bst,dwcmshc-sdhci.yaml new file +10
-0+ <0x0 0x23006000 0x0 0x1000>; + interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clk_mmc>; + clock-names = "core"; + memory-region = <&mmc0_reserved>; + max-frequency = <200000000>; + bus-width = <8>; + non-removable; + dma-coherent; + status = "disabled";
Examples should be enabled. Drop.
Quoted 4 lines
Documentation/devicetree/bindings/mmc/bst,dwcmshc-sdhci.yaml new file +1
-0+ };Signature · 1 line
2.25.1
Re: [PATCH v2 4/8] dt-bindings: mmc: add binding for BST DWCMSHC SDHCI controller
Hi Rob,
Thank you for the feedback.
Quoted 3 lines
items:
- description: Core SDHCI registers
- description: CRM registers
Fixed. I've updated the reg property to use the items list format as suggested.
Quoted 1 line
Examples should be enabled. Drop.
Fixed. I've removed the status = "disabled"; line from the example.
Best regards,
Albert Yang
Re: [PATCH v2 4/8] dt-bindings: mmc: add binding for BST DWCMSHC SDHCI controller
In reply to Rob Herring (Arm)Hi Rob,
Thank you for the automated dt-binding check report.
Quoted 4 lines
My bot found errors running 'make
dt_binding_check' on your patch:/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mmc/bst,dwcmshc-sdhci.example.dtb: mmc@22200000 (bst,c1200-dwcmshc-sdhci): reg: [[0, 572522496], [0, 4096], [0, 587227136], [0, 4096]] is too long
from schema $id: http://devicetree.org/schemas/mmc/bst,dwcmshc-sdhci.yaml#
I have identified and fixed this issue. The problem was that the binding example used 64-bit addresses but lacked the proper bus wrapper with #address-cells and #size-cells settings.
Fix Applied:
I've wrapped the example in a proper bus node with the correct address/size-cells, following the pattern used in sdhci-am654.yaml for handling 64-bit addresses:
examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/interrupt-controller/irq.h>
bus {
#address-cells = <2>;
#size-cells = <2>;
mmc@22200000 {
compatible = "bst,c1200-dwcmshc-sdhci";
reg = <0x0 0x22200000 0x0 0x1000>,
<0x0 0x23006000 0x0 0x1000>;
interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&clk_mmc>;
clock-names = "core";
memory-region = <&mmc0_reserved>;
max-frequency = <200000000>;
bus-width = <8>;
non-removable;
dma-coherent;
};
};This approach is consistent with how sdhci-am654.yaml handles multiple reg entries with 64-bit addresses, and matches the actual usage in our bstc1200.dtsi file where the soc node defines #address-cells = <2> and #size-cells = <2>.
Verification:
After the fix, make dt_binding_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/mmc/bst,dwcmshc-sdhci.yaml passes without errors.
Best regards,
Albert Yang
Re: [PATCH v2 1/8] dt-bindings: vendor-prefixes: Add Black Sesame Technologies Co., Ltd.
In reply to Krzysztof KozlowskiHi Krzysztof,
Thank you for your feedback.
Quoted 1 line
Why is this attached to v1?
I apologize for the confusion. This is indeed v2 of the patch series. The patch itself hasn't changed from v1 because it already received Rob Herring's Acked-by in the v1 review.
Quoted 1 line
Where is the changelog?
You are right to ask for this. For this specific patch (1/8), there is no changelog because it received "Acked-by: Rob Herring (Arm) <[email protected]>" in v1 and required no modifications. However, I should have included a note in the cover letter explaining that some patches were unchanged from v1.
The changes in v2 were primarily in other patches of the series (DTS consolidation, defconfig separation, etc.) based on your previous review feedback.
Quoted 3 lines
Most of your emails did not reach mailing list. I also did not get them. ... and the huge amount of CC list, mostly redundant and not relevant to this work, could explain that. Don't Cc random people.
You are absolutely correct, and I apologize for this. I used get_maintainer.pl without proper filtering, which resulted in an unnecessarily large CC list. For future submissions, I will:
1. Limit TO/CC to only directly relevant maintainers and lists
2. Use a more targeted recipient list
3. Consider using b4 send if delivery issues persist
Quoted 1 line
Anyway, fix above points - all three - and resend after 24h at least.
I will prepare v3 with:
1. Proper changelog documentation in the cover letter
2. Reduced and targeted recipient lists
3. Clear indication of which patches changed vs. which carried forward acks
Thank you for your patience and guidance on proper submission practices.
Best regards,
Albert Yang
Re: [PATCH v2 3/8] arm64: Kconfig: add ARCH_BST for bst silicons
In reply to Krzysztof KozlowskiHi Krzysztof,
Thank you for the feedback.
Quoted 2 lines
All your patches come in some big delays (this one came 2.5h later). Maybe there is something with mail server on your side?
You are right, there seems to be an issue with mail delivery timing. I will investigate this and consider using b4 send for future submissions to ensure reliable delivery.
Quoted 1 line
Why this change?
You are absolutely correct to point this out. The extra blank lines at the end of the file were added accidentally and serve no purpose. I have removed them.
Changes made:
1. Removed the unnecessary blank lines at the end of Kconfig.platforms
2. Corrected changelog placement:
- Initially I incorrectly placed changelog in the commit message
- Per Linux kernel documentation, changelog should be placed after the "---" separator
- Removed changelog from commit message to follow proper kernel conventions
- The changelog will be included after "---" when sending patches via git format-patch
The updated commit properly describes the purpose and scope of the configuration option without any extraneous whitespace changes, and follows correct Linux kernel commit message format.
Best regards,
Albert Yang
Re: [PATCH v2 5/8] mmc: sdhci: add Black Sesame Technologies BST C1200 controller driver
In reply to Arnd BergmannHi Arnd,
Thank you for your detailed review and suggestions. I have addressed all the issues you raised in v2 of the patch series.
Quoted 5 lines · Arnd Bergmann
The description does not mention the actual device it's for but only DesignWare.
Try to keep this sorted alphabetically between the other CONFIG_MMC_SDHCI_* backends
Fixed. Updated the Kconfig description to mention "Black Sesame Technologies BST C1200 controller" and moved the config entry to the correct alphabetical position between MMC_SDHCI_BCM_KONA and MMC_SDHCI_F_SDH30.
Quoted 4 lines
You are only using the first member here, the
phy_crm_reg_baseandphy_crm_reg_sizeare assigned during probe but not referenced later.devm_platform_ioremap_resource()should help simplify that code further.
Agreed. Removed the unused phy_crm_reg_base and phy_crm_reg_size fields from dwcmshc_priv structure and replaced the manual platform_get_resource() + ioremap() calls with devm_platform_ioremap_resource().
Quoted 3 lines
You always pass
priv->crm_reg_baseinto this helper, so it would be simpler to make it take thesdhci_pltfm_hostpointer and the offset instead of the address.
Good suggestion. Replaced bst_write_phys_bst() and bst_read_phys_bst() with bst_crm_write() and bst_crm_read() that take sdhci_pltfm_host pointer and offset parameters for better encapsulation.
Quoted 1 line
The comment says 64K, but the size you use is 32K.
Fixed the comment to correctly state 32KB.
Quoted 9 lines
Having an explanation here makes sense, but I don't think this captures what is actually going on, in particular:
-
dma_alloc_coherent()being backed by an SRAM that is under the 4GB boundary
- the problem that the SoC is configured that all of DRAM is outside ofZONE_DMA32
- The type of hardware bug that leads to 64-bit DMA being broken in this SoC.
You're absolutely right. I've enhanced the comment with a detailed explanation of our specific hardware constraints:
1. System memory uses 64-bit bus, eMMC controller uses 32-bit bus
2. eMMC controller cannot access memory through SMMU due to hardware bug
3. Our SRAM-based bounce buffer solution works within 32-bit address space
Quoted 9 lines
I still have some hope that the hardware is not actually that broken and you can get it working normally, in one of these ways:
- enabling 64-bit addressing in the parent bus
- enabling SMMU translation for the parent bus
- configuring the parent bus or the sdhci itself to access the first 4GB of RAM, and describing the offset in dma-ranges
- moving the start of RAM in a global SoC config
I appreciate your optimism about finding alternative solutions. Unfortunately, we have thoroughly investigated these approaches:
Regarding these last two suggestions, I'm not very familiar with the implementation details. Could you provide more guidance on:
1. **dma-ranges approach**: We tried adding these properties to the device tree:
``` dma-ranges = <0x00000000 0x00000000 0x100000000>; dma-mask = <0xffffffff>; ```
However, we still encounter DMA addressing issues. Are there specific examples in other drivers we could reference for similar hardware constraints?
2. **Moving RAM start position**: Which component would control this configuration? Would this require bootloader parameter changes or SoC-level configuration?
We're certainly interested in exploring these alternatives if they could provide a more elegant solution than our current bounce buffer approach.
The v3 patch addresses all your code structure and documentation concerns while providing a clear explanation of why this approach is necessary for our platform. I have also fixed compilation warnings about unused variables that resulted from the refactoring.
**Current DMA Issues**: Despite setting DMA32_ZONE, we still encounter DMA addressing warnings. Key error messages include:
``` DMA addr 0x00000008113e2200+512 overflow (mask ffffffff, bus limit 0) software IO TLB: swiotlb_memblock_alloc: Failed to allocate [various sizes] ```
This confirms our hardware limitation where the eMMC controller cannot access memory above 32-bit boundaries, even with ZONE_DMA32 configured.
The complete kernel log with detailed DMA allocation failures and warnings is available at: https://pastebin.com/eJgtuHDh
Please let me know if you need any additional information or have suggestions for alternative approaches.
Best regards,
Albert
Arnd Bergmann
maintainerRe: [PATCH v2 5/8] mmc: sdhci: add Black Sesame Technologies BST C1200 controller driver
Quoted 7 lines · Albert Yang
On Wed, Jul 2, 2025, at 11:44, Arnd Bergmann wrote:
Regarding these last two suggestions, I'm not very familiar with the implementation
details. Could you provide more guidance on:1. **dma-ranges approach**: We tried adding these properties to the device tree:
Quoted 8 lines
``` dma-ranges = <0x00000000 0x00000000 0x100000000>; dma-mask = <0xffffffff>; ```However, we still encounter DMA addressing issues. Are there
specific
examples in other drivers we could reference for similar hardware
constraints?
The way that 'dma-ranges' is supposed to work is that it accurately describes in the bus node how a child device accesses the parent view of the physical address space.
The 'dma-mask' property above is not a regular property, but the dma-ranges you have looks similar to what you have for a 1:1 mapping of the first 4GB, matching what you describe is the actual hardware mistake, but you are using the wrong address/size cells for this bus:
+ soc: soc@0 {
+ compatible = "simple-bus";
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges = <0x0 0x0 0x0 0x0 0xffffffff 0xffffffff>;
What your dts file describes is that there is a single 64-bit bus named 'soc@0' that contains the entire 64-bit address space. You have given an explicit 'ranges' property that maps everything except for the final byte in the downstream direction, which is equivalent to having an empty 'ranges' property. You have left out the upstream 'dma-ranges' translation, which I think means you just get the default that matches 'ranges'.
Presumably neither of them are correct. In most SoCs there is more than one bus, and you have already said above that the actual bus that the sdhci device is on only uses 32-bit addressing, which for a 1:1 translation would look like
+ soc: soc@0 {
+ compatible = "simple-bus";
+ #address-cells = <2>;
+ #size-cells = <2>;
+ ranges = <0x0 0x0 0x0 0x0 0x1 0x00000000>;
+ dma-ranges = <0x0 0x0 0x0 0x0 0x1 0x00000000>;
meaning that doing an mmio access on the first 4GB of CPU address space gets routed to this bus at the same address, and that any device trying to do a DMA only works on the first 4GB as well, which then correspond to the bus itself, not to RAM. If that is your setup, that would explain how the SRAM and SDHCI devices are both on the same bus and the SDHCI can do DMA internally on the bus, but cannot actually reach RAM.
A more sensible setup would be to have the DMA access routed to the memory controller. Since memory on your system appears to start at 0x8.00000000, that would look like
dma-ranges = <0x0 0x0 0x08 0x00000000 0x1 0x00000000>;
which means that a DMA to the first 4GB of the bus address space gets routed outside of the bus into the first 4GB of physical memory. Obviously you cannot just change the dts to pretend this is the correct mapping, you have to also program the bus controller to use it.
The datasheet for the chip should tell you specifically what type of bus this is (AXI, AHB, OPB or something else), and what registers are used to program this mapping. It is possible that this cannot be reprogrammed, but more likely there is a hidden register that is made available to the boot loader but is not intended to be reconfigured by the OS.
Quoted 4 lines
2. **Moving RAM start position**: Which component would control this configuration?
Would this require bootloader parameter changes or SoC-level
configuration?
This would be in the early stages of the boot loader that set up the memory controller, as it is hard to reconfigure the RAM location after you are already running from DRAM.
Quoted 7 lines
The v3 patch addresses all your code structure and documentation concerns while providing a clear explanation of why this approach is necessary for our platform. I have also fixed compilation warnings about unused variables that resulted from the refactoring.
**Current DMA Issues**: Despite setting
DMA32_ZONE, we still encounter DMA addressing warnings. Key error messages include:
Quoted 7 lines
``` DMA addr 0x00000008113e2200+512 overflow (mask ffffffff, bus limit 0) software IO TLB: swiotlb_memblock_alloc: Failed to allocate [various sizes] ```This confirms our hardware limitation where the eMMC controller cannot access memory above 32-bit boundaries, even with
ZONE_DMA32configured.
All that this confirms is that Linux observes an impossible configuration where RAM starts above the DMA32 zone.
Arnd
Re: [PATCH v2 5/8] mmc: sdhci: add Black Sesame Technologies BST C1200 controller driver
Hi Arnd,
Thank you for your detailed review and technical guidance on the dma-ranges configuration and hardware address mapping solutions.
Quoted 13 lines · Arnd Bergmann
A more sensible setup would be to have the DMA access routed to the memory controller. Since memory on your system appears to start at 0x8.00000000, that would look like
dma-ranges = <0x0 0x0 0x08 0x00000000 0x1 0x00000000>;which means that a DMA to the first 4GB of the bus address space gets routed outside of the bus into the first 4GB of physical memory. Obviously you cannot just change the dts to pretend this is the correct mapping, you have to also program the bus controller to use it.
Quoted 6 lines
The datasheet for the chip should tell you specifically what type of bus this is (AXI, AHB, OPB or something else), and what registers are used to program this mapping. It is possible that this cannot be reprogrammed, but more likely there is a hidden register that is made available to the boot loader but is not intended to be reconfigured by the OS.
After investigating the approaches you suggested, I need to clarify the hardware constraints we face:
The BST C1200 SoC has fundamental hardware limitations:
- System RAM starts at 0x8.00000000 (above 32-bit addressable range)
- The eMMC controller's DMA engine is limited to 32-bit addressing
- The SMMU does not function for address translation in this path due to hardware design flaws
- These limitations were finalized during silicon design and cannot be modified in software
Regarding your suggestion about programming the bus controller mapping, we have thoroughly reviewed the BST C1200 datasheet and confirmed:
- No accessible registers exist to reprogram the address mapping
- The 32-bit DMA limitation is a hard constraint of the controller IP
Given these silicon-level constraints, the current bounce buffer approach represents the only viable solution to provide eMMC functionality on this platform.
We understand this is not an ideal architectural solution and appreciate your patience in reviewing this hardware-constrained implementation. I want to assure you that these design limitations have been addressed in our subsequent chip generations.
We would appreciate your consideration of this approach given the documented hardware constraints. Thank you again for your time and expertise in reviewing this patch.
Best regards,
Albert Yang
Arnd Bergmann
maintainerRe: [PATCH v2 5/8] mmc: sdhci: add Black Sesame Technologies BST C1200 controller driver
Quoted 13 lines · Albert Yang
On Fri, Jul 11, 2025, at 08:55, Arnd Bergmann wrote:
After investigating the approaches you suggested, I need to clarify the hardware constraints we face:
The BST C1200 SoC has fundamental hardware limitations:
- System RAM starts at 0x8.00000000 (above 32-bit addressable range)
- The eMMC controller's DMA engine is limited to 32-bit addressing
- The SMMU does not function for address translation in this path due to hardware design flaws
- These limitations were finalized during silicon design and cannot be modified in software
Quoted 8 lines
Regarding your suggestion about programming the bus controller mapping, we have thoroughly reviewed the BST C1200 datasheet and confirmed:
- No accessible registers exist to reprogram the address mapping
- The 32-bit DMA limitation is a hard constraint of the controller IPGiven these silicon-level constraints, the current bounce buffer approach represents the only viable solution to provide eMMC functionality on this platform.
Thanks for checking and confirming. I think what you had in v2 is probably close to what we want then. Please update the comments in the code that explain the workaround and send it as v3 so we can have another look.
Arnd
Re: [PATCH v2 6/8] arm64: dts: bst: add support for Black Sesame Technologies C1200 CDCU1.0 board and defconfig
In reply to Rob HerringQuoted 10 lines · Robin Murphy
arch/arm64/boot/dts/bst/bstc1200.dtsi line 66
Quoted 8 lines · Albert Yang
arch/arm64/boot/dts/bst/bstc1200.dtsi new file +8
-0+ timer { + compatible = "arm,armv8-timer"; + interrupt-parent = <&gic>; + always-on; + interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 11 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>, + <GIC_PPI 10 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_LOW)>;
Quoted 2 lines
Your PPIs target 8 of the 4 CPUS? Either way you don't have GICv2, please use the GICv3 binding.
Thank you for pointing out the issue. The mask has been removed according to the GIC v3 format.
Quoted 13 lines
arch/arm64/boot/dts/bst/bstc1200.dtsi line 86
Quoted 12 lines
arch/arm64/boot/dts/bst/bstc1200.dtsi new file +11
-0+ mmc0: mmc@22200000 { + compatible = "bst,c1200-dwcmshc-sdhci"; + reg = <0x0 0x22200000 0x0 0x1000>, + <0x0 0x23006000 0x0 0x1000>; + interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&clk_mmc>; + clock-names = "core"; + max-frequency = <200000000>; + bus-width = <8>; + non-removable; + dma-coherent;
Quoted 4 lines
Given the funky DMA setup, I can't help be mildly suspicious of this - is the device genuinely I/O coherent and capable of snooping the CPU caches, or are you only getting away with it because
dma_init_coherent_memory()happens to remap as non-cacheable regardless?
We allocated a portion of SRAM to serve as a bounce buffer. This buffer is incorporated into the system's CMA (Contiguous Memory Allocator) framework through a shared DMA mechanism and requires memory coherency.
Best Regards,
Albert
Re: [PATCH v2 6/8] arm64: dts: bst: add support for Black Sesame Technologies C1200 CDCU1.0 board
In reply to Rob HerringQuoted 11 lines · Rob Herring
Quoted 9 lines · Albert Yang
Before (incorrect):
memory@800151000 { reg = <0x80x001510000x00x1000>; }; memory@800254000 { reg = <0x80x002540000x00x1000>; };
...After (correct):
memory@800151000 { reg = <0x8 0x00151000 0x0 0x1000>, <0x8 0x00254000 0x0 0x1000>,
Quoted 5 lines
These are very odd. Are these really main memory vs. some on chip SRAM or some other specific purpose?
A 4KB block doesn't really work if the OS uses 16 or 64KB pages, but I guess that would be up to the OS to ignore them.
Thank you for pointing out this issue. My colleagues and I have discussed that these two 4ks are indeed ineffective, so we will remove them in v3
Best Regards,
Albert