| 1 |
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause |
| 2 |
%YAML 1.2 |
| 3 |
--- |
| 4 |
$id: http://devicetree.org/schemas/mtd/brcm,brcmnand.yaml# |
| 5 |
$schema: http://devicetree.org/meta-schemas/core.yaml# |
| 6 |
|
| 7 |
title: Broadcom STB NAND Controller |
| 8 |
|
| 9 |
maintainers: |
| 10 |
- Brian Norris <[email protected]> |
| 11 |
- Kamal Dasu <[email protected]> |
| 12 |
- William Zhang <[email protected]> |
| 13 |
|
| 14 |
description: | |
| 15 |
The Broadcom Set-Top Box NAND controller supports low-level access to raw NAND |
| 16 |
flash chips. It has a memory-mapped register interface for both control |
| 17 |
registers and for its data input/output buffer. On some SoCs, this controller |
| 18 |
is paired with a custom DMA engine (inventively named "Flash DMA") which |
| 19 |
supports basic PROGRAM and READ functions, among other features. |
| 20 |
|
| 21 |
This controller was originally designed for STB SoCs (BCM7xxx) but is now |
| 22 |
available on a variety of Broadcom SoCs, including some BCM3xxx, MIPS based |
| 23 |
Broadband SoC (BCM63xx), ARM based Broadband SoC (BCMBCA) and iProc/Cygnus. |
| 24 |
Its history includes several similar (but not fully register compatible) |
| 25 |
versions. |
| 26 |
|
| 27 |
-- Additional SoC-specific NAND controller properties -- |
| 28 |
|
| 29 |
The NAND controller is integrated differently on the variety of SoCs on which |
| 30 |
it is found. Part of this integration involves providing status and enable |
| 31 |
bits with which to control the 8 exposed NAND interrupts, as well as hardware |
| 32 |
for configuring the endianness of the data bus. On some SoCs, these features |
| 33 |
are handled via standard, modular components (e.g., their interrupts look like |
| 34 |
a normal IRQ chip), but on others, they are controlled in unique and |
| 35 |
interesting ways, sometimes with registers that lump multiple NAND-related |
| 36 |
functions together. The former case can be described simply by the standard |
| 37 |
interrupts properties in the main controller node. But for the latter |
| 38 |
exceptional cases, we define additional 'compatible' properties and associated |
| 39 |
register resources within the NAND controller node above. |
| 40 |
|
| 41 |
properties: |
| 42 |
compatible: |
| 43 |
oneOf: |
| 44 |
- items: |
| 45 |
- enum: |
| 46 |
- brcm,brcmnand-v2.1 |
| 47 |
- brcm,brcmnand-v2.2 |
| 48 |
- brcm,brcmnand-v4.0 |
| 49 |
- brcm,brcmnand-v5.0 |
| 50 |
- brcm,brcmnand-v6.0 |
| 51 |
- brcm,brcmnand-v6.1 |
| 52 |
- brcm,brcmnand-v6.2 |
| 53 |
- brcm,brcmnand-v7.0 |
| 54 |
- brcm,brcmnand-v7.1 |
| 55 |
- brcm,brcmnand-v7.2 |
| 56 |
- brcm,brcmnand-v7.3 |
| 57 |
- const: brcm,brcmnand |
| 58 |
- description: BCMBCA SoC-specific NAND controller |
| 59 |
items: |
| 60 |
- const: brcm,nand-bcm63138 |
| 61 |
- enum: |
| 62 |
- brcm,brcmnand-v7.0 |
| 63 |
- brcm,brcmnand-v7.1 |
| 64 |
- const: brcm,brcmnand |
| 65 |
- description: iProc SoC-specific NAND controller |
| 66 |
items: |
| 67 |
- const: brcm,nand-iproc |
| 68 |
- const: brcm,brcmnand-v6.1 |
| 69 |
- description: BCM63168 SoC-specific NAND controller |
| 70 |
items: |
| 71 |
- const: brcm,nand-bcm63168 |
| 72 |
- const: brcm,nand-bcm6368 |
| 73 |
- const: brcm,brcmnand-v4.0 |
| 74 |
- const: brcm,brcmnand |
| 75 |
|
| 76 |
reg: |
| 77 |
minItems: 1 |
| 78 |
maxItems: 6 |
| 79 |
|
| 80 |
reg-names: |
| 81 |
minItems: 1 |
| 82 |
maxItems: 6 |
| 83 |
items: |
| 84 |
enum: [ nand, flash-dma, flash-edu, nand-cache, nand-int-base, iproc-idm, iproc-ext ] |
| 85 |
|
| 86 |
interrupts: |
| 87 |
minItems: 1 |
| 88 |
items: |
| 89 |
- description: NAND CTLRDY interrupt |
| 90 |
- description: FLASH_DMA_DONE (if flash DMA is available) or FLASH_EDU_DONE (if EDU is available) |
| 91 |
|
| 92 |
interrupt-names: |
| 93 |
minItems: 1 |
| 94 |
items: |
| 95 |
- const: nand_ctlrdy |
| 96 |
- enum: |
| 97 |
- flash_dma_done |
| 98 |
- flash_edu_done |
| 99 |
|
| 100 |
clocks: |
| 101 |
maxItems: 1 |
| 102 |
description: reference to the clock for the NAND controller |
| 103 |
|
| 104 |
clock-names: |
| 105 |
const: nand |
| 106 |
|
| 107 |
brcm,nand-has-wp: |
| 108 |
description: > |
| 109 |
Some versions of this IP include a write-protect |
| 110 |
(WP) control bit. It is always available on >= |
| 111 |
v7.0. Use this property to describe the rare |
| 112 |
earlier versions of this core that include WP |
| 113 |
type: boolean |
| 114 |
|
| 115 |
brcm,wp-not-connected: |
| 116 |
description: |
| 117 |
Use this property when WP pin is not physically wired to the NAND chip. |
| 118 |
Write protection feature cannot be used. By default, controller assumes |
| 119 |
the pin is connected and feature is used. |
| 120 |
$ref: /schemas/types.yaml#/definitions/flag |
| 121 |
|
| 122 |
patternProperties: |
| 123 |
"^nand@[a-f0-9]$": |
| 124 |
type: object |
| 125 |
$ref: raw-nand-chip.yaml |
| 126 |
properties: |
| 127 |
compatible: |
| 128 |
const: brcm,nandcs |
| 129 |
|
| 130 |
nand-ecc-step-size: |
| 131 |
enum: [ 512, 1024 ] |
| 132 |
|
| 133 |
brcm,nand-oob-sector-size: |
| 134 |
description: | |
| 135 |
integer, to denote the spare area sector size |
| 136 |
expected for the ECC layout in use. This size, in |
| 137 |
addition to the strength and step-size, |
| 138 |
determines how the hardware BCH engine will lay |
| 139 |
out the parity bytes it stores on the flash. |
| 140 |
This property can be automatically determined by |
| 141 |
the flash geometry (particularly the NAND page |
| 142 |
and OOB size) in many cases, but when booting |
| 143 |
from NAND, the boot controller has only a limited |
| 144 |
number of available options for its default ECC |
| 145 |
layout. |
| 146 |
$ref: /schemas/types.yaml#/definitions/uint32 |
| 147 |
|
| 148 |
brcm,nand-ecc-use-strap: |
| 149 |
description: |
| 150 |
This property requires the host system to get the ECC related |
| 151 |
settings from the SoC NAND boot strap configuration instead of |
| 152 |
the generic NAND ECC settings. This is a common hardware design |
| 153 |
on BCMBCA based boards. This strap ECC option and generic NAND |
| 154 |
ECC option can not be specified at the same time. |
| 155 |
$ref: /schemas/types.yaml#/definitions/flag |
| 156 |
|
| 157 |
unevaluatedProperties: false |
| 158 |
|
| 159 |
allOf: |
| 160 |
- $ref: nand-controller.yaml# |
| 161 |
- if: |
| 162 |
properties: |
| 163 |
compatible: |
| 164 |
contains: |
| 165 |
const: brcm,nand-bcm63138 |
| 166 |
then: |
| 167 |
properties: |
| 168 |
reg-names: |
| 169 |
items: |
| 170 |
- const: nand |
| 171 |
- const: nand-int-base |
| 172 |
- if: |
| 173 |
properties: |
| 174 |
compatible: |
| 175 |
contains: |
| 176 |
const: brcm,nand-bcm6368 |
| 177 |
then: |
| 178 |
properties: |
| 179 |
reg-names: |
| 180 |
items: |
| 181 |
- const: nand |
| 182 |
- const: nand-int-base |
| 183 |
- const: nand-cache |
| 184 |
- if: |
| 185 |
properties: |
| 186 |
compatible: |
| 187 |
contains: |
| 188 |
const: brcm,nand-iproc |
| 189 |
then: |
| 190 |
properties: |
| 191 |
reg-names: |
| 192 |
items: |
| 193 |
- const: nand |
| 194 |
- const: iproc-idm |
| 195 |
- const: iproc-ext |
| 196 |
- if: |
| 197 |
required: |
| 198 |
- interrupts |
| 199 |
properties: |
| 200 |
interrupts: |
| 201 |
minItems: 2 |
| 202 |
then: |
| 203 |
required: |
| 204 |
- interrupt-names |
| 205 |
|
| 206 |
- if: |
| 207 |
patternProperties: |
| 208 |
"^nand@[a-f0-9]$": |
| 209 |
required: |
| 210 |
- brcm,nand-ecc-use-strap |
| 211 |
then: |
| 212 |
patternProperties: |
| 213 |
"^nand@[a-f0-9]$": |
| 214 |
properties: |
| 215 |
nand-ecc-strength: false |
| 216 |
nand-ecc-step-size: false |
| 217 |
nand-ecc-maximize: false |
| 218 |
nand-ecc-algo: false |
| 219 |
brcm,nand-oob-sector-size: false |
| 220 |
|
| 221 |
unevaluatedProperties: false |
| 222 |
|
| 223 |
required: |
| 224 |
- reg |
| 225 |
- reg-names |
| 226 |
|
| 227 |
examples: |
| 228 |
- | |
| 229 |
nand-controller@f0442800 { |
| 230 |
compatible = "brcm,brcmnand-v7.0", "brcm,brcmnand"; |
| 231 |
reg = <0xf0442800 0x600>, |
| 232 |
<0xf0443000 0x100>; |
| 233 |
reg-names = "nand", "flash-dma"; |
| 234 |
interrupt-parent = <&hif_intr2_intc>; |
| 235 |
interrupts = <24>, <4>; |
| 236 |
interrupt-names = "nand_ctlrdy", "flash_dma_done"; |
| 237 |
|
| 238 |
#address-cells = <1>; |
| 239 |
#size-cells = <0>; |
| 240 |
|
| 241 |
nand@1 { |
| 242 |
compatible = "brcm,nandcs"; |
| 243 |
reg = <1>; // Chip select 1 |
| 244 |
nand-on-flash-bbt; |
| 245 |
nand-ecc-strength = <12>; |
| 246 |
nand-ecc-step-size = <512>; |
| 247 |
|
| 248 |
#address-cells = <1>; |
| 249 |
#size-cells = <1>; |
| 250 |
}; |
| 251 |
}; |
| 252 |
- | |
| 253 |
nand-controller@10000200 { |
| 254 |
compatible = "brcm,nand-bcm63168", "brcm,nand-bcm6368", |
| 255 |
"brcm,brcmnand-v4.0", "brcm,brcmnand"; |
| 256 |
reg = <0x10000200 0x180>, |
| 257 |
<0x100000b0 0x10>, |
| 258 |
<0x10000600 0x200>; |
| 259 |
reg-names = "nand", "nand-int-base", "nand-cache"; |
| 260 |
interrupt-parent = <&periph_intc>; |
| 261 |
interrupts = <50>; |
| 262 |
clocks = <&periph_clk 20>; |
| 263 |
clock-names = "nand"; |
| 264 |
|
| 265 |
#address-cells = <1>; |
| 266 |
#size-cells = <0>; |
| 267 |
|
| 268 |
nand@0 { |
| 269 |
compatible = "brcm,nandcs"; |
| 270 |
reg = <0>; |
| 271 |
nand-on-flash-bbt; |
| 272 |
nand-ecc-strength = <1>; |
| 273 |
nand-ecc-step-size = <512>; |
| 274 |
|
| 275 |
#address-cells = <1>; |
| 276 |
#size-cells = <1>; |
| 277 |
}; |
| 278 |
}; |