Skip to content

Commit e569152

Browse files
rogerqr-vignesh
authored andcommitted
arm64: dts: ti: am62-lp-sk: Add overlay for NAND expansion card
The NAND expansion card (PROC143E1) connects over the User/MCU/PRU Expansion port on the am62-lp-sk EVM. The following pins are shared between McASP1 and GPMC-NAND so both cannot work simultaneously. Pin name McASP1 function GPMC function ======== =============== ============= J17 MCASP1_AXR0 GPMC0_WEN P21 MCASP1_AFSX GPMC0_WAIT0 K17 MCASP1_ACLKX GPMC0_BE0N_CLE K20 MCASP1_AXR2 GPMC0_ADVN_ALE The factory default sets the pins for McASP1 use. (i.e. Resistor Array RA1 installed, RA4 not installed). For NAND use, RA1 has to be removed and RA4 must be installed. Signed-off-by: Roger Quadros <rogerq@kernel.org> Link: https://lore.kernel.org/r/20240622-am62lp-sk-nand-v1-2-caee496eaf42@kernel.org Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
1 parent a0286c7 commit e569152

3 files changed

Lines changed: 121 additions & 0 deletions

File tree

arch/arm64/boot/dts/ti/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ dtb-$(CONFIG_ARCH_K3) += k3-am625-verdin-wifi-yavia.dtb
2525
dtb-$(CONFIG_ARCH_K3) += k3-am625-phyboard-lyra-1-4-ghz-opp.dtbo
2626
dtb-$(CONFIG_ARCH_K3) += k3-am62x-phyboard-lyra-gpio-fan.dtbo
2727
dtb-$(CONFIG_ARCH_K3) += k3-am62-lp-sk.dtb
28+
dtb-$(CONFIG_ARCH_K3) += k3-am62-lp-sk-nand.dtbo
2829

2930
# Boards with AM62Ax SoC
3031
dtb-$(CONFIG_ARCH_K3) += k3-am62a7-sk.dtb
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
/*
3+
* Copyright (C) 2022-2024 Texas Instruments Incorporated - https://www.ti.com/
4+
*/
5+
6+
/dts-v1/;
7+
/plugin/;
8+
#include <dt-bindings/gpio/gpio.h>
9+
#include <dt-bindings/interrupt-controller/irq.h>
10+
#include "k3-pinctrl.h"
11+
12+
&mcasp1 {
13+
status = "disabled";
14+
};
15+
16+
&main_pmx0 {
17+
gpmc0_pins_default: gpmc0-pins-default {
18+
pinctrl-single,pins = <
19+
AM62X_IOPAD(0x003c, PIN_INPUT, 0) /* (K19) GPMC0_AD0 */
20+
AM62X_IOPAD(0x0040, PIN_INPUT, 0) /* (L19) GPMC0_AD1 */
21+
AM62X_IOPAD(0x0044, PIN_INPUT, 0) /* (L20) GPMC0_AD2 */
22+
AM62X_IOPAD(0x0048, PIN_INPUT, 0) /* (L21) GPMC0_AD3 */
23+
AM62X_IOPAD(0x004c, PIN_INPUT, 0) /* (M21) GPMC0_AD4 */
24+
AM62X_IOPAD(0x0050, PIN_INPUT, 0) /* (L17) GPMC0_AD5 */
25+
AM62X_IOPAD(0x0054, PIN_INPUT, 0) /* (L18) GPMC0_AD6 */
26+
AM62X_IOPAD(0x0058, PIN_INPUT, 0) /* (M20) GPMC0_AD7 */
27+
AM62X_IOPAD(0x0098, PIN_INPUT, 0) /* (P21) GPMC0_WAIT0 */
28+
AM62X_IOPAD(0x00a8, PIN_OUTPUT, 0) /* (J18) GPMC0_CSn0 */
29+
AM62X_IOPAD(0x0084, PIN_OUTPUT, 0) /* (K20) GPMC0_ADVn_ALE */
30+
AM62X_IOPAD(0x0088, PIN_OUTPUT, 0) /* (K21) GPMC0_OEn_REn */
31+
AM62X_IOPAD(0x008c, PIN_OUTPUT, 0) /* (J17) GPMC0_WEn */
32+
AM62X_IOPAD(0x0090, PIN_OUTPUT, 0) /* (K17) GPMC0_BE0n_CLE */
33+
AM62X_IOPAD(0x00a0, PIN_OUTPUT, 0) /* (J20) GPMC0_WPn */
34+
>;
35+
};
36+
};
37+
38+
&elm0 {
39+
status = "okay";
40+
};
41+
42+
&gpmc0 {
43+
status = "okay";
44+
pinctrl-names = "default";
45+
pinctrl-0 = <&gpmc0_pins_default>;
46+
#address-cells = <2>;
47+
#size-cells = <1>;
48+
49+
nand@0,0 {
50+
compatible = "ti,am64-nand";
51+
reg = <0 0 64>; /* device IO registers */
52+
interrupt-parent = <&gpmc0>;
53+
interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */
54+
<1 IRQ_TYPE_NONE>; /* termcount */
55+
rb-gpios = <&gpmc0 0 GPIO_ACTIVE_HIGH>; /* gpmc_wait0 */
56+
ti,nand-xfer-type = "prefetch-polled";
57+
ti,nand-ecc-opt = "bch8"; /* BCH8: Bootrom limitation */
58+
ti,elm-id = <&elm0>;
59+
nand-bus-width = <8>;
60+
gpmc,device-width = <1>;
61+
gpmc,sync-clk-ps = <0>;
62+
gpmc,cs-on-ns = <0>;
63+
gpmc,cs-rd-off-ns = <40>;
64+
gpmc,cs-wr-off-ns = <40>;
65+
gpmc,adv-on-ns = <0>;
66+
gpmc,adv-rd-off-ns = <25>;
67+
gpmc,adv-wr-off-ns = <25>;
68+
gpmc,we-on-ns = <0>;
69+
gpmc,we-off-ns = <20>;
70+
gpmc,oe-on-ns = <3>;
71+
gpmc,oe-off-ns = <30>;
72+
gpmc,access-ns = <30>;
73+
gpmc,rd-cycle-ns = <40>;
74+
gpmc,wr-cycle-ns = <40>;
75+
gpmc,bus-turnaround-ns = <0>;
76+
gpmc,cycle2cycle-delay-ns = <0>;
77+
gpmc,clk-activation-ns = <0>;
78+
gpmc,wr-access-ns = <40>;
79+
gpmc,wr-data-mux-bus-ns = <0>;
80+
81+
partitions {
82+
compatible = "fixed-partitions";
83+
#address-cells = <1>;
84+
#size-cells = <1>;
85+
86+
partition@0 {
87+
label = "NAND.tiboot3";
88+
reg = <0x00000000 0x00200000>; /* 2M */
89+
};
90+
partition@200000 {
91+
label = "NAND.tispl";
92+
reg = <0x00200000 0x00200000>; /* 2M */
93+
};
94+
partition@400000 {
95+
label = "NAND.tiboot3.backup"; /* 2M */
96+
reg = <0x00400000 0x00200000>; /* BootROM looks at 4M */
97+
};
98+
partition@600000 {
99+
label = "NAND.u-boot";
100+
reg = <0x00600000 0x00400000>; /* 4M */
101+
};
102+
partition@a00000 {
103+
label = "NAND.u-boot-env";
104+
reg = <0x00a00000 0x00040000>; /* 256K */
105+
};
106+
partition@a40000 {
107+
label = "NAND.u-boot-env.backup";
108+
reg = <0x00a40000 0x00040000>; /* 256K */
109+
};
110+
partition@a80000 {
111+
label = "NAND.file-system";
112+
reg = <0x00a80000 0x3f580000>;
113+
};
114+
};
115+
};
116+
};

arch/arm64/boot/dts/ti/k3-am62-lp-sk.dts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,7 @@
228228
&tlv320aic3106 {
229229
DVDD-supply = <&buck2_reg>;
230230
};
231+
232+
&gpmc0 {
233+
ranges = <0 0 0x00 0x51000000 0x01000000>; /* CS0 space. Min partition = 16MB */
234+
};

0 commit comments

Comments
 (0)