mediatek: update patches
[openwrt/openwrt.git] / target / linux / mediatek / patches-4.4 / 0023-ARM-dts-mediatek-add-MT7623-basic-support.patch
index f1d90a81868d04de3bbe9b23416a8b230f1aeb4d..22cd1edbca95a556a3ab4a6045a9304924d3bec4 100644 (file)
@@ -1,18 +1,18 @@
-From 5536a546755527a862cb2494814c5244d3d8e30a Mon Sep 17 00:00:00 2001
+From 51d5ca9e151eb323bd965e72ad1e1dc93fcf7b13 Mon Sep 17 00:00:00 2001
 From: John Crispin <blogic@openwrt.org>
 Date: Tue, 5 Jan 2016 12:16:17 +0100
-Subject: [PATCH 23/90] ARM: dts: mediatek: add MT7623 basic support
+Subject: [PATCH 023/102] ARM: dts: mediatek: add MT7623 basic support
 
 This adds basic chip support for Mediatek MT7623.
 
 Signed-off-by: John Crispin <blogic@openwrt.org>
 ---
  arch/arm/boot/dts/Makefile        |    1 +
- arch/arm/boot/dts/mt7623-evb.dts  |  474 ++++++++++++++++++++++++++++++
- arch/arm/boot/dts/mt7623.dtsi     |  583 +++++++++++++++++++++++++++++++++++++
+ arch/arm/boot/dts/mt7623-evb.dts  |  421 ++++++++++++++++++++++++++
+ arch/arm/boot/dts/mt7623.dtsi     |  601 +++++++++++++++++++++++++++++++++++++
  arch/arm/mach-mediatek/Kconfig    |    4 +
  arch/arm/mach-mediatek/mediatek.c |    1 +
- 5 files changed, 1063 insertions(+)
+ 5 files changed, 1028 insertions(+)
  create mode 100644 arch/arm/boot/dts/mt7623-evb.dts
  create mode 100644 arch/arm/boot/dts/mt7623.dtsi
 
@@ -30,10 +30,10 @@ index 30bbc37..2bce370 100644
  dtb-$(CONFIG_ARCH_ZX) += zx296702-ad1.dtb
 diff --git a/arch/arm/boot/dts/mt7623-evb.dts b/arch/arm/boot/dts/mt7623-evb.dts
 new file mode 100644
-index 0000000..70b92a4
+index 0000000..5ad1448
 --- /dev/null
 +++ b/arch/arm/boot/dts/mt7623-evb.dts
-@@ -0,0 +1,474 @@
+@@ -0,0 +1,421 @@
 +/*
 + * Copyright (c) 2016 MediaTek Inc.
 + * Author: John Crispin <blogic@openwrt.org>
@@ -323,127 +323,32 @@ index 0000000..70b92a4
 +      status = "okay";
 +};
 +
-+&mmc0 {
-+      status = "okay";
-+      pinctrl-names = "default", "state_uhs";
-+      pinctrl-0 = <&mmc0_pins_default>;
-+      pinctrl-1 = <&mmc0_pins_uhs>;
-+      bus-width = <8>;
-+      max-frequency = <50000000>;
-+      cap-mmc-highspeed;
-+      vmmc-supply = <&mt6323_vemc3v3_reg>;
-+      vqmmc-supply = <&mt6323_vio18_reg>;
-+      non-removable;
-+};
-+
-+&mmc1 {
-+      status = "okay";
-+      pinctrl-names = "default", "state_uhs";
-+      pinctrl-0 = <&mmc1_pins_default>;
-+      pinctrl-1 = <&mmc1_pins_uhs>;
-+      bus-width = <4>;
-+      max-frequency = <50000000>;
-+      cap-sd-highspeed;
-+      sd-uhs-sdr25;
-+//    cd-gpios = <&pio 132 0>;
-+      vmmc-supply = <&mt6323_vmch_reg>;
-+      vqmmc-supply = <&mt6323_vmc_reg>;
-+};
-+
 +&pio {
-+      mmc0_pins_default: mmc0default {
-+              pins_cmd_dat {
-+                      pinmux = <MT7623_PIN_111_MSDC0_DAT7_FUNC_MSDC0_DAT7>,
-+                               <MT7623_PIN_112_MSDC0_DAT6_FUNC_MSDC0_DAT6>,
-+                               <MT7623_PIN_113_MSDC0_DAT5_FUNC_MSDC0_DAT5>,
-+                               <MT7623_PIN_114_MSDC0_DAT4_FUNC_MSDC0_DAT4>,
-+                               <MT7623_PIN_118_MSDC0_DAT3_FUNC_MSDC0_DAT3>,
-+                               <MT7623_PIN_119_MSDC0_DAT2_FUNC_MSDC0_DAT2>,
-+                               <MT7623_PIN_120_MSDC0_DAT1_FUNC_MSDC0_DAT1>,
-+                               <MT7623_PIN_121_MSDC0_DAT0_FUNC_MSDC0_DAT0>,
-+                               <MT7623_PIN_116_MSDC0_CMD_FUNC_MSDC0_CMD>;
-+                      input-enable;
-+                      bias-pull-up;
-+              };
-+
-+              pins_clk {
-+                      pinmux = <MT7623_PIN_117_MSDC0_CLK_FUNC_MSDC0_CLK>;
-+                      bias-pull-down;
-+              };
-+
-+              pins_rst {
-+                      pinmux = <MT7623_PIN_115_MSDC0_RSTB_FUNC_MSDC0_RSTB>;
-+                      bias-pull-up;
-+              };
-+      };
-+
-+      mmc0_pins_uhs: mmc0 {
-+              pins_cmd_dat {
-+                      pinmux = <MT7623_PIN_111_MSDC0_DAT7_FUNC_MSDC0_DAT7>,
-+                               <MT7623_PIN_112_MSDC0_DAT6_FUNC_MSDC0_DAT6>,
-+                               <MT7623_PIN_113_MSDC0_DAT5_FUNC_MSDC0_DAT5>,
-+                               <MT7623_PIN_114_MSDC0_DAT4_FUNC_MSDC0_DAT4>,
-+                               <MT7623_PIN_118_MSDC0_DAT3_FUNC_MSDC0_DAT3>,
-+                               <MT7623_PIN_119_MSDC0_DAT2_FUNC_MSDC0_DAT2>,
-+                               <MT7623_PIN_120_MSDC0_DAT1_FUNC_MSDC0_DAT1>,
-+                               <MT7623_PIN_121_MSDC0_DAT0_FUNC_MSDC0_DAT0>,
-+                               <MT7623_PIN_116_MSDC0_CMD_FUNC_MSDC0_CMD>;
-+                      input-enable;
-+                      drive-strength = <MTK_DRIVE_2mA>;
-+                      bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
-+              };
-+
-+              pins_clk {
-+                      pinmux = <MT7623_PIN_117_MSDC0_CLK_FUNC_MSDC0_CLK>;
-+                      drive-strength = <MTK_DRIVE_2mA>;
-+                      bias-pull-down = <MTK_PUPD_SET_R1R0_01>;
++      nand_pins_default: nanddefault {
++              pins_dat {
++                      pinmux = <MT7623_PIN_111_MSDC0_DAT7_FUNC_NLD7>,
++                               <MT7623_PIN_112_MSDC0_DAT6_FUNC_NLD6>,
++                               <MT7623_PIN_114_MSDC0_DAT4_FUNC_NLD4>,
++                               <MT7623_PIN_118_MSDC0_DAT3_FUNC_NLD3>,
++                               <MT7623_PIN_121_MSDC0_DAT0_FUNC_NLD0>,
++                               <MT7623_PIN_120_MSDC0_DAT1_FUNC_NLD1>,
++                               <MT7623_PIN_113_MSDC0_DAT5_FUNC_NLD5>,
++                               <MT7623_PIN_115_MSDC0_RSTB_FUNC_NLD8>,
++                               <MT7623_PIN_119_MSDC0_DAT2_FUNC_NLD2>;
++                              input-enable;
++                              drive-strength = <MTK_DRIVE_8mA>;
++                              bias-pull-up;
 +              };
 +
-+              pins_rst {
-+                      pinmux = <MT7623_PIN_115_MSDC0_RSTB_FUNC_MSDC0_RSTB>;
-+                      bias-pull-up;
-+              };
-+      };
-+
-+      mmc1_pins_default: mmc1default {
-+              pins_cmd_dat {
-+                      pinmux = <MT7623_PIN_107_MSDC1_DAT0_FUNC_MSDC1_DAT0>,
-+                               <MT7623_PIN_108_MSDC1_DAT1_FUNC_MSDC1_DAT1>,
-+                               <MT7623_PIN_109_MSDC1_DAT2_FUNC_MSDC1_DAT2>,
-+                               <MT7623_PIN_110_MSDC1_DAT3_FUNC_MSDC1_DAT3>,
-+                               <MT7623_PIN_105_MSDC1_CMD_FUNC_MSDC1_CMD>;
-+                      input-enable;
-+                      drive-strength = <MTK_DRIVE_4mA>;
-+                      bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
-+              };
-+
-+              pins_clk {
-+                      pinmux = <MT7623_PIN_106_MSDC1_CLK_FUNC_MSDC1_CLK>;
-+                      bias-pull-down;
-+                      drive-strength = <MTK_DRIVE_4mA>;
-+              };
-+
-+//            pins_insert {
-+//                    pinmux = <MT8173_PIN_132_I2S0_DATA1_FUNC_GPIO132>;
-+//                    bias-pull-up;
-+//            };
-+      };
-+
-+      mmc1_pins_uhs: mmc1 {
-+              pins_cmd_dat {
-+                      pinmux = <MT7623_PIN_107_MSDC1_DAT0_FUNC_MSDC1_DAT0>,
-+                               <MT7623_PIN_108_MSDC1_DAT1_FUNC_MSDC1_DAT1>,
-+                               <MT7623_PIN_109_MSDC1_DAT2_FUNC_MSDC1_DAT2>,
-+                               <MT7623_PIN_110_MSDC1_DAT3_FUNC_MSDC1_DAT3>,
-+                               <MT7623_PIN_105_MSDC1_CMD_FUNC_MSDC1_CMD>;
-+                      input-enable;
-+                      drive-strength = <MTK_DRIVE_4mA>;
++              pins_we {
++                      pinmux = <MT7623_PIN_117_MSDC0_CLK_FUNC_NWEB>;
++                      drive-strength = <MTK_DRIVE_8mA>;
 +                      bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
 +              };
 +
-+              pins_clk {
-+                      pinmux = <MT7623_PIN_106_MSDC1_CLK_FUNC_MSDC1_CLK>;
-+                      drive-strength = <MTK_DRIVE_4mA>;
++              pins_ale {
++                      pinmux = <MT7623_PIN_116_MSDC0_CMD_FUNC_NALE>;
++                      drive-strength = <MTK_DRIVE_8mA>;
 +                      bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
 +              };
 +      };
@@ -474,6 +379,48 @@ index 0000000..70b92a4
 +      };
 +};
 +
++&nandc {
++      status = "okay";
++      pinctrl-names = "default";
++      pinctrl-0 = <&nand_pins_default>;
++      nand@0 {
++              reg = <0>;
++              partitions {
++                      compatible = "fixed-partitions";
++                      #address-cells = <1>;
++                      #size-cells = <1>;
++
++                      partition@C0000 {
++                              label = "uboot-env";
++                              reg = <0xC0000 0x40000>;
++                      };
++
++                      partition@100000 {
++                              label = "factory";
++                              reg = <0x100000 0x40000>;
++                      };
++
++                      partition@140000 {
++                              label = "kernel";
++                              reg = <0x140000 0x2000000>;
++                      };
++
++                      partition@2140000 {
++                              label = "recovery";
++                              reg = <0x2140000 0x2000000>;
++                      };
++
++                      partition@4140000 {
++                              label = "rootfs";
++                              reg = <0x4140000 0x1000000>;
++                      };
++              };
++      };
++};
++&bch {
++      status = "okay";
++};
++
 +&usb1 {
 +      vusb33-supply = <&mt6323_vusb_reg>;
 +      vbus-supply = <&usb_p1_vbus>;
@@ -510,10 +457,10 @@ index 0000000..70b92a4
 +};
 diff --git a/arch/arm/boot/dts/mt7623.dtsi b/arch/arm/boot/dts/mt7623.dtsi
 new file mode 100644
-index 0000000..0536b2c
+index 0000000..cbbdf16
 --- /dev/null
 +++ b/arch/arm/boot/dts/mt7623.dtsi
-@@ -0,0 +1,583 @@
+@@ -0,0 +1,601 @@
 +/*
 + * Copyright (c) 2016 MediaTek Inc.
 + * Author: John Crispin <blogic@openwrt.org>
@@ -850,15 +797,26 @@ index 0000000..0536b2c
 +              status = "disabled";
 +      };
 +
-+      nand: nfi@1100d000 {
++      nandc: nfi@1100d000 {
 +              compatible = "mediatek,mt2701-nfc";
-+              reg = <0 0x1100d000 0 0x1000>, <0 0x1100e000 0 0x1000>;
-+              interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_LOW>,
-+                           <GIC_SPI 55 IRQ_TYPE_LEVEL_LOW>;
-+              clocks = <&pericfg CLK_PERI_NFI>, <&pericfg CLK_PERI_NFI_ECC>,
++              reg = <0 0x1100d000 0 0x1000>;
++              interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_LOW>;
++              power-domains = <&scpsys MT2701_POWER_DOMAIN_IFR_MSC>;
++              clocks = <&pericfg CLK_PERI_NFI>,
 +                       <&pericfg CLK_PERI_NFI_PAD>;
-+              clock-names = "nfi_clk", "nfiecc_clk", "pad_clk";
-+      //      nand-on-flash-bbt;
++              clock-names = "nfi_clk", "pad_clk";
++              status = "disabled";
++              ecc-engine = <&bch>;
++              #address-cells = <1>;
++              #size-cells = <0>;
++      };
++
++      bch: ecc@1100e000 {
++              compatible = "mediatek,mt2701-ecc";
++              reg = <0 0x1100e000 0 0x1000>;
++              interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_LOW>;
++              clocks = <&pericfg CLK_PERI_NFI_ECC>;
++              clock-names = "nfiecc_clk";
 +              status = "disabled";
 +      };
 +
@@ -1063,8 +1021,15 @@ index 0000000..0536b2c
 +                      compatible = "mediatek,eth-mac";
 +                      reg = <1>;
 +
-+                      phy-handle = <&phy5>;
 +                      status = "disabled";
++                      
++                      phy-mode = "rgmii";
++                      
++                      fixed-link {
++                              speed = <1000>;
++                              full-duplex;
++                              pause;
++                      };
 +              };
 +      
 +              mdio-bus {