-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add MTD/NAND support for Olimex-A20-MICRO
- Loading branch information
1 parent
c5a3e8b
commit 3d10e9c
Showing
4 changed files
with
298 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c | ||
index 2af9869..13c0d43 100644 | ||
--- a/drivers/mtd/nand/nand_ids.c | ||
+++ b/drivers/mtd/nand/nand_ids.c | ||
@@ -48,6 +48,10 @@ struct nand_flash_dev nand_flash_ids[] = { | ||
{"SDTNRGAMA 64G 3.3V 8-bit", | ||
{ .id = {0x45, 0xde, 0x94, 0x93, 0x76, 0x50} }, | ||
SZ_16K, SZ_8K, SZ_4M, 0, 6, 1280, NAND_ECC_INFO(40, SZ_1K) }, | ||
+ {"H27UBG8T2BTR-BC 32G 3.3V 8-bit", | ||
+ { .id = {0xad, 0xd7, 0x94, 0xda, 0x74, 0xc3} }, | ||
+ SZ_8K, SZ_4K, SZ_2M, NAND_NEED_SCRAMBLING, 6, 640, | ||
+ NAND_ECC_INFO(40, SZ_1K), 0 }, | ||
{"H27UCG8T2ATR-BC 64G 3.3V 8-bit", | ||
{ .id = {0xad, 0xde, 0x94, 0xda, 0x74, 0xc4} }, | ||
SZ_8K, SZ_8K, SZ_2M, NAND_NEED_SCRAMBLING, 6, 640, | ||
diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi | ||
index bd0c476..41995ec 100644 | ||
--- a/arch/arm/boot/dts/sun7i-a20.dtsi | ||
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi | ||
@@ -1229,6 +1229,44 @@ | ||
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; | ||
}; | ||
|
||
+ nand_pins_a: nand_base0@0 { | ||
+ allwinner,pins = "PC0", "PC1", "PC2", | ||
+ "PC5", "PC8", "PC9", "PC10", | ||
+ "PC11", "PC12", "PC13", "PC14", | ||
+ "PC15"; | ||
+ allwinner,function = "nand0"; | ||
+ allwinner,drive = <0>; | ||
+ allwinner,pull = <0>; | ||
+ }; | ||
+ | ||
+ nand_cs0_pins_a: nand_cs@0 { | ||
+ allwinner,pins = "PC4"; | ||
+ allwinner,function = "nand0"; | ||
+ allwinner,drive = <0>; | ||
+ allwinner,pull = <0>; | ||
+ }; | ||
+ | ||
+ nand_cs1_pins_a: nand_cs@1 { | ||
+ allwinner,pins = "PC3"; | ||
+ allwinner,function = "nand0"; | ||
+ allwinner,drive = <0>; | ||
+ allwinner,pull = <0>; | ||
+ }; | ||
+ | ||
+ nand_rb0_pins_a: nand_rb@0 { | ||
+ allwinner,pins = "PC6"; | ||
+ allwinner,function = "nand0"; | ||
+ allwinner,drive = <0>; | ||
+ allwinner,pull = <0>; | ||
+ }; | ||
+ | ||
+ nand_rb1_pins_a: nand_rb@1 { | ||
+ allwinner,pins = "PC7"; | ||
+ allwinner,function = "nand0"; | ||
+ allwinner,drive = <0>; | ||
+ allwinner,pull = <0>; | ||
+ }; | ||
+ | ||
ps20_pins_a: ps20@0 { | ||
allwinner,pins = "PI20", "PI21"; | ||
allwinner,function = "ps2"; | ||
diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | ||
index 7e3006f..04e05b9 100644 | ||
--- a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | ||
+++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | ||
@@ -213,6 +213,46 @@ | ||
status = "okay"; | ||
}; | ||
|
||
+&nfc { | ||
+ status = "okay"; | ||
+ pinctrl-names = "default"; | ||
+ pinctrl-0 = <&nand_pins_a &nand_cs0_pins_a &nand_rb0_pins_a>; | ||
+ | ||
+ nand@0 { | ||
+ #address-cells = <2>; | ||
+ #size-cells = <2>; | ||
+ reg = <0>; | ||
+ allwinner,rb = <0>; | ||
+ nand-ecc-mode = "hw"; | ||
+ allwinner,randomize; | ||
+ | ||
+ spl@0 { | ||
+ label = "SPL"; | ||
+ reg = /bits/ 64 <0x0 0x400000>; | ||
+ }; | ||
+ | ||
+ spl-backup@400000 { | ||
+ label = "SPL.backup"; | ||
+ reg = /bits/ 64 <0x400000 0x400000>; | ||
+ }; | ||
+ | ||
+ u-boot@800000 { | ||
+ label = "U-Boot"; | ||
+ reg = /bits/ 64 <0x800000 0x400000>; | ||
+ }; | ||
+ | ||
+ env@c00000 { | ||
+ label = "env"; | ||
+ reg = /bits/ 64 <0xc00000 0x400000>; | ||
+ }; | ||
+ | ||
+ rootfs@1000000 { | ||
+ label = "rootfs"; | ||
+ reg = /bits/ 64 <0x1000000 0x1ff000000>; | ||
+ }; | ||
+ }; | ||
+}; | ||
+ | ||
&ohci0 { | ||
status = "okay"; | ||
}; |
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,115 @@ | ||
diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c | ||
index 2af9869..13c0d43 100644 | ||
--- a/drivers/mtd/nand/nand_ids.c | ||
+++ b/drivers/mtd/nand/nand_ids.c | ||
@@ -48,6 +48,10 @@ struct nand_flash_dev nand_flash_ids[] = { | ||
{"SDTNRGAMA 64G 3.3V 8-bit", | ||
{ .id = {0x45, 0xde, 0x94, 0x93, 0x76, 0x50} }, | ||
SZ_16K, SZ_8K, SZ_4M, 0, 6, 1280, NAND_ECC_INFO(40, SZ_1K) }, | ||
+ {"H27UBG8T2BTR-BC 32G 3.3V 8-bit", | ||
+ { .id = {0xad, 0xd7, 0x94, 0xda, 0x74, 0xc3} }, | ||
+ SZ_8K, SZ_4K, SZ_2M, NAND_NEED_SCRAMBLING, 6, 640, | ||
+ NAND_ECC_INFO(40, SZ_1K), 0 }, | ||
{"H27UCG8T2ATR-BC 64G 3.3V 8-bit", | ||
{ .id = {0xad, 0xde, 0x94, 0xda, 0x74, 0xc4} }, | ||
SZ_8K, SZ_8K, SZ_2M, NAND_NEED_SCRAMBLING, 6, 640, | ||
diff --git a/arch/arm/boot/dts/sun7i-a20.dtsi b/arch/arm/boot/dts/sun7i-a20.dtsi | ||
index bd0c476..41995ec 100644 | ||
--- a/arch/arm/boot/dts/sun7i-a20.dtsi | ||
+++ b/arch/arm/boot/dts/sun7i-a20.dtsi | ||
@@ -1229,6 +1229,44 @@ | ||
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>; | ||
}; | ||
|
||
+ nand_pins_a: nand_base0@0 { | ||
+ allwinner,pins = "PC0", "PC1", "PC2", | ||
+ "PC5", "PC8", "PC9", "PC10", | ||
+ "PC11", "PC12", "PC13", "PC14", | ||
+ "PC15"; | ||
+ allwinner,function = "nand0"; | ||
+ allwinner,drive = <0>; | ||
+ allwinner,pull = <0>; | ||
+ }; | ||
+ | ||
+ nand_cs0_pins_a: nand_cs@0 { | ||
+ allwinner,pins = "PC4"; | ||
+ allwinner,function = "nand0"; | ||
+ allwinner,drive = <0>; | ||
+ allwinner,pull = <0>; | ||
+ }; | ||
+ | ||
+ nand_cs1_pins_a: nand_cs@1 { | ||
+ allwinner,pins = "PC3"; | ||
+ allwinner,function = "nand0"; | ||
+ allwinner,drive = <0>; | ||
+ allwinner,pull = <0>; | ||
+ }; | ||
+ | ||
+ nand_rb0_pins_a: nand_rb@0 { | ||
+ allwinner,pins = "PC6"; | ||
+ allwinner,function = "nand0"; | ||
+ allwinner,drive = <0>; | ||
+ allwinner,pull = <0>; | ||
+ }; | ||
+ | ||
+ nand_rb1_pins_a: nand_rb@1 { | ||
+ allwinner,pins = "PC7"; | ||
+ allwinner,function = "nand0"; | ||
+ allwinner,drive = <0>; | ||
+ allwinner,pull = <0>; | ||
+ }; | ||
+ | ||
ps20_pins_a: ps20@0 { | ||
allwinner,pins = "PI20", "PI21"; | ||
allwinner,function = "ps2"; | ||
diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | ||
index 7e3006f..04e05b9 100644 | ||
--- a/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | ||
+++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-micro.dts | ||
@@ -213,6 +213,46 @@ | ||
status = "okay"; | ||
}; | ||
|
||
+&nfc { | ||
+ status = "okay"; | ||
+ pinctrl-names = "default"; | ||
+ pinctrl-0 = <&nand_pins_a &nand_cs0_pins_a &nand_rb0_pins_a>; | ||
+ | ||
+ nand@0 { | ||
+ #address-cells = <2>; | ||
+ #size-cells = <2>; | ||
+ reg = <0>; | ||
+ allwinner,rb = <0>; | ||
+ nand-ecc-mode = "hw"; | ||
+ allwinner,randomize; | ||
+ | ||
+ spl@0 { | ||
+ label = "SPL"; | ||
+ reg = /bits/ 64 <0x0 0x400000>; | ||
+ }; | ||
+ | ||
+ spl-backup@400000 { | ||
+ label = "SPL.backup"; | ||
+ reg = /bits/ 64 <0x400000 0x400000>; | ||
+ }; | ||
+ | ||
+ u-boot@800000 { | ||
+ label = "U-Boot"; | ||
+ reg = /bits/ 64 <0x800000 0x400000>; | ||
+ }; | ||
+ | ||
+ env@c00000 { | ||
+ label = "env"; | ||
+ reg = /bits/ 64 <0xc00000 0x400000>; | ||
+ }; | ||
+ | ||
+ rootfs@1000000 { | ||
+ label = "rootfs"; | ||
+ reg = /bits/ 64 <0x1000000 0x1ff000000>; | ||
+ }; | ||
+ }; | ||
+}; | ||
+ | ||
&ohci0 { | ||
status = "okay"; | ||
}; |