Skip to content

Instantly share code, notes, and snippets.

@krusic22
Last active January 23, 2023 01:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krusic22/549479c13803f0a8bc31bd93a7c99e79 to your computer and use it in GitHub Desktop.
Save krusic22/549479c13803f0a8bc31bd93a7c99e79 to your computer and use it in GitHub Desktop.
OpenWRT 22.03 DTS for Nokia AC400i. (Working WiFi, Ethernet (1Gig both ports), nand)
#include "qcom-ipq8065.dtsi"
#include <dt-bindings/input/input.h>
/ {
model = "Nokia AC400i";
compatible = "nokia,ac400i", "qcom,ipq8065", "qcom,ipq8064";
reserved-memory {
nss@40000000 {
reg = <0x40000000 0x1000000>;
no-map;
};
smem: smem@41000000 {
reg = <0x41000000 0x200000>;
no-map;
};
wifi_dump@44000000 {
reg = <0x44000000 0x600000>;
no-map;
};
};
aliases {
mdio-gpio0 = &mdio0;
ethernet0 = &gmac0;
ethernet1 = &gmac1;
led-boot = &pwr_red;
led-failsafe = &pwr_red;
led-running = &pwr_green;
led-upgrade = &pwr_green;
};
chosen {
bootargs-override = " console=ttyMSM0,115200n8 ubi.mtd=rootfs root=/dev/ubiblock0_2";
};
keys {
compatible = "gpio-keys";
pinctrl-0 = <&button_pins>;
pinctrl-names = "default";
reset {
label = "reset";
gpios = <&qcom_pinmux 15 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
leds {
compatible = "gpio-leds";
pinctrl-0 = <&led_pins>;
pinctrl-names = "default";
5g_red {
label = "red:5g";
gpios = <&qcom_pinmux 65 GPIO_ACTIVE_HIGH>;
};
5g_green {
label = "green:5g";
gpios = <&qcom_pinmux 64 GPIO_ACTIVE_HIGH>;
};
2g_red {
label = "red:2g";
gpios = <&qcom_pinmux 53 GPIO_ACTIVE_HIGH>;
};
2g_green {
label = "green:2g";
gpios = <&qcom_pinmux 54 GPIO_ACTIVE_HIGH>;
};
eth1_red {
label = "red:eth1";
gpios = <&qcom_pinmux 68 GPIO_ACTIVE_HIGH>;
};
eth1_green {
label = "green:eth1";
gpios = <&qcom_pinmux 22 GPIO_ACTIVE_LOW>;
};
eth2_red {
label = "red:eth2";
gpios = <&qcom_pinmux 67 GPIO_ACTIVE_HIGH>;
};
eth2_green {
label = "green:eth2";
gpios = <&qcom_pinmux 23 GPIO_ACTIVE_LOW>;
};
ctrl_red {
label = "red:ctrl";
gpios = <&qcom_pinmux 55 GPIO_ACTIVE_HIGH>;
};
ctrl_green {
label = "green:ctrl";
gpios = <&qcom_pinmux 56 GPIO_ACTIVE_HIGH>;
};
pwr_red: pwr_red {
label = "red:pwr";
gpios = <&qcom_pinmux 2 GPIO_ACTIVE_LOW>;
};
pwr_green: pwr_green {
label = "green:pwr";
gpios = <&qcom_pinmux 26 GPIO_ACTIVE_HIGH>;
};
};
};
&qcom_pinmux {
spi_pins: spi_pins {
mux {
pins = "gpio18", "gpio19";
function = "gsbi5";
drive-strength = <10>;
bias-pull-down;
};
clk {
pins = "gpio21";
function = "gsbi5";
drive-strength = <12>;
bias-pull-down;
};
cs {
pins = "gpio20";
function = "gpio";
drive-strength = <10>;
bias-pull-up;
};
};
led_pins: led_pins {
mux {
pins = "gpio65", "gpio64",
"gpio53", "gpio54",
"gpio68", "gpio22",
"gpio67", "gpio23",
"gpio55", "gpio56",
"gpio2", "gpio26";
function = "gpio";
drive-strength = <2>;
bias-pull-up;
};
};
button_pins: button_pins {
mux {
pins = "gpio15";
function = "gpio";
drive-strength = <2>;
bias-pull-up;
};
};
rgmii2_pins: rgmii2_pins {
mux {
pins = "gpio27", "gpio28",
"gpio29", "gpio30",
"gpio31", "gpio32",
"gpio51", "gpio52",
"gpio59", "gpio60",
"gpio61", "gpio62",
"gpio66";
};
};
};
&gsbi5 {
qcom,mode = <GSBI_PROT_SPI>;
status = "okay";
spi4: spi@1a280000 {
status = "okay";
spi-max-frequency = <50000000>;
pinctrl-0 = <&spi_pins>;
pinctrl-names = "default";
cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
m25p80@0 {
compatible = "jedec,spi-nor";
#address-cells = <1>;
#size-cells = <1>;
spi-max-frequency = <50000000>;
reg = <0>;
partitions {
compatible = "qcom,smem-part";
};
};
};
};
&usb3_0 {
status = "okay";
};
&usb3_1 {
status = "okay";
};
&pcie0 {
status = "okay";
/delete-property/ pinctrl-0;
/delete-property/ pinctrl-names;
/delete-property/ perst-gpios;
};
&pcie1 {
status = "okay";
/delete-property/ pinctrl-0;
/delete-property/ pinctrl-names;
/delete-property/ perst-gpios;
};
&mdio0 {
status = "okay";
pinctrl-0 = <&mdio0_pins>;
pinctrl-names = "default";
phy0: ethernet-phy@0 {
reg = <0>;
};
phy1: ethernet-phy@1 {
reg = <1>;
};
};
//POE
&gmac0 {
status = "okay";
qcom,id = <0>;
phy-handle = <&phy0>;
mdiobus = <&mdio0>;
pinctrl-0 = <&rgmii2_pins>;
pinctrl-names = "default";
phy-mode = "rgmii";
fixed-link {
speed = <1000>;
full-duplex;
};
};
//LAN1
&gmac1 {
status = "okay";
qcom,id = <1>;
phy-handle = <&phy1>;
mdiobus = <&mdio0>;
phy-mode = "rgmii";
fixed-link {
speed = <1000>;
full-duplex;
};
};
&nand_controller {
status = "okay";
pinctrl-0 = <&nand_pins>;
pinctrl-names = "default";
nand@0 {
reg = <0>;
compatible = "qcom,nandcs";
nand-ecc-strength = <4>;
nand-bus-width = <8>;
nand-ecc-step-size = <512>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
rootfs@0 {
label = "rootfs";
reg = <0x0000000 0x4000000>;
};
rootfs_1@4000000 {
label = "rootfs_1";
reg = <0x4000000 0x4000000>;
};
cfg@8000000 {
label = "cfg";
reg = <0x8000000 0x8000000>;
};
};
};
};
&adm_dma {
status = "okay";
};
//&sdcc1 {
//status = "okay";
//};
//&sdcc3 {
//status = "okay";
//};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment