Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Luke Wren <wren6991@gmail.com>
- Loading branch information
1 parent
0815226
commit fda45e5
Showing
8 changed files
with
402 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
Documentation/devicetree/bindings/mtd/brcm,bcm2835-smi-nand.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
* BCM2835 SMI NAND flash | ||
|
||
This driver is a shim between the BCM2835 SMI driver (SMI is a peripheral for | ||
talking to parallel register interfaces) and Linux's MTD layer. | ||
|
||
Required properties: | ||
- compatible: "brcm,bcm2835-smi-nand" | ||
- status: "okay" | ||
|
||
Optional properties: | ||
- partition@n, where n is an integer from a consecutive sequence starting at 0 | ||
- Difficult to store partition table on NAND device - normally put it | ||
in the source code, kernel bootparams, or device tree (the best way!) | ||
- Sub-properties: | ||
- label: the partition name, as shown by mtdinfo /dev/mtd* | ||
- reg: the size and offset of this partition. | ||
- (optional) read-only: an empty property flagging as read only | ||
|
||
Example: | ||
|
||
nand: flash@0 { | ||
compatible = "brcm,bcm2835-smi-nand"; | ||
status = "okay"; | ||
|
||
partition@0 { | ||
label = "stage2"; | ||
// 128k | ||
reg = <0 0x20000>; | ||
read-only; | ||
}; | ||
partition@1 { | ||
label = "firmware"; | ||
// 16M | ||
reg = <0x20000 0x1000000>; | ||
read-only; | ||
}; | ||
partition@2 { | ||
label = "root"; | ||
// 2G | ||
reg = <0x1020000 0x80000000>; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Description: Overlay to enable NAND flash through | ||
// the secondary memory interface | ||
// Author: Luke Wren | ||
|
||
/dts-v1/; | ||
/plugin/; | ||
|
||
/{ | ||
compatible = "brcm,bcm2708"; | ||
|
||
fragment@0 { | ||
target = <&smi>; | ||
__overlay__ { | ||
pinctrl-names = "default"; | ||
pinctrl-0 = <&smi_pins>; | ||
status = "okay"; | ||
}; | ||
}; | ||
|
||
fragment@1 { | ||
target = <&soc>; | ||
__overlay__ { | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
|
||
nand: flash@0 { | ||
compatible = "brcm,bcm2835-smi-nand"; | ||
smi_handle = <&smi>; | ||
#address-cells = <1>; | ||
#size-cells = <1>; | ||
status = "okay"; | ||
|
||
partition@0 { | ||
label = "stage2"; | ||
// 128k | ||
reg = <0 0x20000>; | ||
read-only; | ||
}; | ||
partition@1 { | ||
label = "firmware"; | ||
// 16M | ||
reg = <0x20000 0x1000000>; | ||
read-only; | ||
}; | ||
partition@2 { | ||
label = "root"; | ||
// 2G (will need to use 64 bit for >=4G) | ||
reg = <0x1020000 0x80000000>; | ||
}; | ||
}; | ||
}; | ||
}; | ||
|
||
fragment@2 { | ||
target = <&gpio>; | ||
__overlay__ { | ||
smi_pins: smi_pins { | ||
brcm,pins = <0 1 2 3 4 5 6 7 8 9 10 11 | ||
12 13 14 15>; | ||
/* Alt 1: SMI */ | ||
brcm,function = <5 5 5 5 5 5 5 5 5 5 5 | ||
5 5 5 5 5>; | ||
/* /CS, /WE and /OE are pulled high, as they are | ||
generally active low signals */ | ||
brcm,pull = <2 2 2 2 2 2 2 2 0 0 0 0 0 0 0 0>; | ||
}; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.