diff --git a/Documentation/devicetree/bindings/net/hisilicon-femac.txt b/Documentation/devicetree/bindings/net/hisilicon-femac.txt
index d11af5e..ef9e641 100644
--- a/Documentation/devicetree/bindings/net/hisilicon-femac.txt
+++ b/Documentation/devicetree/bindings/net/hisilicon-femac.txt
@@ -4,7 +4,9 @@ Required properties:
- compatible: should contain one of the following version strings:
* "hisilicon,hisi-femac-v1"
* "hisilicon,hisi-femac-v2"
- and the soc string "hisilicon,hi3516cv300-femac".
+ and one of the following soc strings:
+ * "hisilicon,hi3516cv300-femac"
+ * "hisilicon,hi3536dv100-femac"
- reg: specifies base physical address(s) and size of the device registers.
The first region is the MAC core register base and size.
The second region is the global MAC control register.
diff --git a/Documentation/devicetree/bindings/net/hisilicon-gemac-mdio.txt b/Documentation/devicetree/bindings/net/hisilicon-gemac-mdio.txt
new file mode 100644
index 0000000..c6f8202
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/hisilicon-gemac-mdio.txt
@@ -0,0 +1,22 @@
+Hisilicon Gigabit Ethernet MDIO Controller interface
+
+Required properties:
+- compatible: should be "hisilicon,hisi-gemac-mdio".
+- reg: address and length of the register set for the device.
+- clocks: A phandle to the reference clock for this device.
+
+- PHY subnode: inherits from phy binding [1]
+[1] Documentation/devicetree/bindings/net/phy.txt
+
+Example:
+mdio: mdio@100503c0 {
+ compatible = "hisilicon,hisi-gemac-mdio";
+ reg = <0x100503c0 0x20>;
+ clocks = <&crg HI3519V100_MDIO_CLK>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ phy0: phy@1 {
+ reg = <1>;
+ };
+};
diff --git a/Documentation/devicetree/bindings/net/hisilicon-higmac.txt b/Documentation/devicetree/bindings/net/hisilicon-higmac.txt
new file mode 100644
index 0000000..ea096d2
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/hisilicon-higmac.txt
@@ -0,0 +1,52 @@
+Hisilicon higmac controller
+
+Required properties:
+- compatible: should be "hisilicon,higmac" and one of the following:
+ - "hisilicon,higmac-v1"
+ - "hisilicon,higmac-v2"
+ - "hisilicon,higmac-v3"
+ - "hisilicon,higmac-v4"
+ - "hisilicon,higmac-v5"
+- reg: specifies base physical address(s) and size of the device registers.
+ The first region is the MAC register base and size.
+ The second region is external interface control register.
+- interrupts: should contain the MAC interrupt.
+- #address-cells: must be <1>.
+- #size-cells: must be <0>.
+- phy-mode: see ethernet.txt [1].
+- phy-handle: see ethernet.txt [1].
+- mac-address: see ethernet.txt [1].
+- clocks: clock phandle and specifier pair.
+- resets: reset controller phandle and specifier pair.
+
+- PHY subnode: inherits from phy binding [2]
+
+[1] Documentation/devicetree/bindings/net/ethernet.txt
+[2] Documentation/devicetree/bindings/net/phy.txt
+
+Example:
+ higmac: ethernet@10050000 {
+ compatible = "hisilicon,higmac";
+ reg = <0x10050000 0x1000>,<0x120100ec 0x4>;
+ interrupts = <0 25 4>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ phy-mode = "rgmii";
+ phy-handle = <ð_phy>;
+ mac-address = [00 00 00 00 00 00];
+ clocks = <&clock HI3519_ETH_CLK>,
+ <&clock HI3519_ETH_MACIF_CLK>;
+ clock-names = "higmac_clk",
+ "macif_clk";
+
+ resets = <&clock 0xcc 0>,
+ <&clock 0xcc 2>,
+ <&clock 0xcc 7>;
+ reset-names = "port_reset",
+ "macif_reset",
+ "phy_reset";
+
+ eth_phy: ethernet-phy@1 {
+ reg = <1>;
+ };
+ };
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index b5d529f..100df1d 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -747,6 +747,8 @@ source "arch/arm/mach-highbank/Kconfig"
source "arch/arm/mach-hisi/Kconfig"
+source "arch/arm/mach-hibvt/Kconfig"
+
source "arch/arm/mach-integrator/Kconfig"
source "arch/arm/mach-iop32x/Kconfig"
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index d83f7c3..4a150d5 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -287,6 +287,22 @@ choice
Say Y here if you want kernel low-level debugging support
on HI3620 UART.
+ config DEBUG_HI3516A_UART
+ bool "Hisilicon Hi3516A Debug UART"
+ depends on ARCH_HI3516A
+ select DEBUG_UART_PL01X
+ help
+ Say Y here if you want kernel low-level debugging support
+ on HI3516A UART.
+
+ config DEBUG_HI3536DV100_UART
+ bool "Hisilicon Hi3536DV100 Debug UART"
+ depends on ARCH_HI3536DV100
+ select DEBUG_UART_PL01X
+ help
+ Say Y here if you want kernel low-level debugging support
+ on HI3536DV100 UART.
+
config DEBUG_HIGHBANK_UART
bool "Kernel low-level debugging messages via Highbank UART"
depends on ARCH_HIGHBANK
@@ -1530,6 +1546,8 @@ config DEBUG_UART_PHYS
default 0xf991e000 if DEBUG_QCOM_UARTDM
default 0xfc00c000 if DEBUG_AT91_SAMA5D4_USART3
default 0xfcb00000 if DEBUG_HI3620_UART
+ default 0x20080000 if DEBUG_HI3516A_UART
+ default 0x12080000 if DEBUG_HI3536DV100_UART
default 0xfd883000 if DEBUG_ALPINE_UART0
default 0xfe800000 if ARCH_IOP32X
default 0xff690000 if DEBUG_RK32_UART2
@@ -1619,6 +1637,8 @@ config DEBUG_UART_VIRT
default 0xfe300000 if DEBUG_BCM_KONA_UART
default 0xfe800000 if ARCH_IOP32X
default 0xfeb00000 if DEBUG_HI3620_UART || DEBUG_HIX5HD2_UART
+ default 0xfe900000 if DEBUG_HI3516A_UART
+ default 0xfe480000 if DEBUG_HI3536DV100_UART
default 0xfeb24000 if DEBUG_RK3X_UART0
default 0xfeb26000 if DEBUG_RK3X_UART1
default 0xfeb30c00 if DEBUG_KEYSTONE_UART0
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 6be9ee1..53409ce 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -170,6 +170,7 @@ machine-$(CONFIG_ARCH_FOOTBRIDGE) += footbridge
machine-$(CONFIG_ARCH_GEMINI) += gemini
machine-$(CONFIG_ARCH_HIGHBANK) += highbank
machine-$(CONFIG_ARCH_HISI) += hisi
+machine-$(CONFIG_ARCH_HISI_BVT) += hibvt
machine-$(CONFIG_ARCH_INTEGRATOR) += integrator
machine-$(CONFIG_ARCH_IOP13XX) += iop13xx
machine-$(CONFIG_ARCH_IOP32X) += iop32x
@@ -268,6 +269,10 @@ endif
endif
endif
+ifeq ($(CONFIG_ARCH_HISI_BVT),y)
+KBUILD_CPPFLAGS += $(patsubst %,-I%include,$(machdirs) $(platdirs))
+endif
+
export TEXT_OFFSET GZFLAGS MMUEXT
# Do we have FASTFPE?
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index 50f8d1b..9732bdf 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -16,6 +16,8 @@ OBJCOPYFLAGS :=-O binary -R .comment -S
ifneq ($(MACHINE),)
include $(MACHINE)/Makefile.boot
endif
+include $(srctree)/arch/arm/mach-hibvt/Makefile.boot
+include $(srctree)/arch/arm/boot/dts/Makefile
# Note: the following conditions must always be true:
# ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET)
@@ -24,10 +26,12 @@ endif
ZRELADDR := $(zreladdr-y)
PARAMS_PHYS := $(params_phys-y)
INITRD_PHYS := $(initrd_phys-y)
+DTB_OBJS ?= $(dtb-y)
+DTB_OBJS_FULL := $(addprefix $(obj)/dts/,$(DTB_OBJS))
export ZRELADDR INITRD_PHYS PARAMS_PHYS
-targets := Image zImage xipImage bootpImage uImage
+targets := Image zImage xipImage bootpImage uImage zImage-dtb
ifeq ($(CONFIG_XIP_KERNEL),y)
@@ -55,6 +59,10 @@ $(obj)/compressed/vmlinux: $(obj)/Image FORCE
$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
$(call if_changed,objcopy)
+$(obj)/zImage-dtb: $(obj)/zImage $(DTB_OBJS_FULL) FORCE
+ @cat $(obj)/zImage $(DTB_OBJS_FULL) > $@
+ @$(kecho) ' Kernel: $@ is ready'
+
endif
ifneq ($(LOADADDR),)
@@ -75,7 +83,7 @@ if [ $(words $(UIMAGE_LOADADDR)) -ne 1 ]; then \
false; \
fi
-$(obj)/uImage: $(obj)/zImage FORCE
+$(obj)/uImage: $(obj)/zImage-dtb FORCE
@$(check_for_multiple_loadaddr)
$(call if_changed,uimage)
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S
index fc6d541..9c0a324 100644
--- a/arch/arm/boot/compressed/head.S
+++ b/arch/arm/boot/compressed/head.S
@@ -218,6 +218,20 @@ not_angel:
addcc r0, r0, pc
cmpcc r4, r0
orrcc r4, r4, #1 @ remember we skipped cache_on
+
+/*TODO all the Cortex-A7 Single Core must fix this bug */
+#if defined(CONFIG_ARCH_HI3516A) || defined(CONFIG_ARCH_HI3536DV100)
+/*
+ * This is a bug on Cortex-A7 MPCORE. see buglist of Cortex-A7
+ * The D-caches are disabled when ACTLR.SMP is set to 0 regardless of the
+ * value of the cache enable bit. so we must set SMP bit of ACTLR register
+ * before enable D cache
+ */
+ mrc p15, 0, r0, c1, c0, 1
+ orr r0, #(1 << 6)
+ mcr p15, 0, r0, c1, c0, 1
+#endif
+
blcs cache_on
restart: adr r0, LC0
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 7037201..e79e35e 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -174,6 +174,10 @@ dtb-$(CONFIG_ARCH_HISI) += \
hi3519-demb.dtb
dtb-$(CONFIG_ARCH_HIX5HD2) += \
hisi-x5hd2-dkb.dtb
+dtb-$(CONFIG_ARCH_HI3516A) += \
+ hi3516a-demb.dtb
+dtb-$(CONFIG_ARCH_HI3536DV100) += \
+ hi3536dv100-demb.dtb
dtb-$(CONFIG_ARCH_INTEGRATOR) += \
integratorap.dtb \
integratorcp.dtb
diff --git a/arch/arm/boot/dts/hi3516a-demb.dts b/arch/arm/boot/dts/hi3516a-demb.dts
new file mode 100644
index 0000000..2038867
--- /dev/null
+++ b/arch/arm/boot/dts/hi3516a-demb.dts
@@ -0,0 +1,229 @@
+/*
+ * Copyright (c) 2013-2014 Linaro Ltd.
+ * Copyright (c) 2015-2017 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/dts-v1/;
+#include "hi3516a.dtsi"
+
+/ {
+ model = "Hisilicon HI3516A DEMO Board";
+ compatible = "hiSilicon,hi3516a";
+
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ cpu@0 {
+ device_type = "cpu";
+ compatible = "arm,cortex-a7";
+ reg = <0>;
+
+ operating-points = <
+ /* KHz uV */
+ 600000 1100000
+ 732000 1200000
+ 850000 1300000
+ 500000 1060000
+ 400000 1020000
+ >;
+
+ clocks = <&clock HI3516A_A7_MUX>,
+ <&clock HI3516A_FIXED_400M>,
+ <&clock HI3516A_FIXED_500M>,
+ <&clock HI3516A_APLL_CLK>;
+ clock-names = "a7_mux","400m", "500m","apll";
+
+ vcc-supply = <&a7_regulator>;
+ };
+ };
+
+ avs {
+ compatible = "hi3516a,avs";
+ avs-num = <2>;
+ avs-name-array = "cpu-avs","media-avs";
+ cpu_avs: cpu_avs{
+ avs-name = "cpu-avs";
+ opp-num = <5>;
+ opp-freq = <600000 732000 850000 500000 400000>;
+ opp-volt-min = <940000 1000000 1070000 940000 940000>;
+ opp-hpm = <270 325 365 255 240>;
+ opp-div = <11 14 16 10 8>;
+ opp-volt-max = <1310000>;
+ };
+
+ media_avs: media_avs{
+ avs-name = "media-avs";
+ opp-num = <5>;
+ opp-freq = <0 1 2 3 4>;
+ opp-volt-min = <930000 930000 930000 930000 930000>;
+ opp-hpm = <245 245 245 260 285>;
+ opp-div = <3 3 4 5 5>;
+ opp-volt-max = <1310000>;
+ };
+ };
+
+ memory {
+ device_type = "memory";
+ reg = <0x80000000 0x40000000>;
+ };
+};
+
+&uart0 {
+ status = "okay";
+};
+
+&dual_timer0 {
+ status = "okay";
+};
+
+&i2c_bus0 {
+ status = "okay";
+};
+
+&i2c_bus1 {
+ status = "okay";
+};
+
+&i2c_bus2 {
+ status = "okay";
+};
+
+&spi_bus0{
+ status = "okay";
+ num-cs = <1>;
+
+ spidev@0 {
+ compatible = "rohm,dh2228fv";
+ reg = <0>;
+ pl022,interface = <0>;
+ pl022,com_mode = <0>;
+ spi-max-frequency = <24000000>;
+ };
+};
+
+&spi_bus1{
+ status = "okay";
+ num-cs = <3>;
+
+ spidev@0 {
+ compatible = "rohm,dh2228fv";
+ reg = <0>;
+ pl022,interface = <0>;
+ pl022,com_mode = <0>;
+ spi-max-frequency = <24000000>;
+ };
+
+ spidev@1 {
+ compatible = "rohm,dh2228fv";
+ reg = <1>;
+ pl022,interface = <0>;
+ pl022,com_mode = <0>;
+ spi-max-frequency = <24000000>;
+ };
+
+ spidev@2 {
+ compatible = "rohm,dh2228fv";
+ reg = <2>;
+ pl022,interface = <0>;
+ pl022,com_mode = <0>;
+ spi-max-frequency = <24000000>;
+ };
+};
+
+&mdio {
+ ethphy: ethernet-phy@1 {
+ reg = <1>;
+ };
+};
+
+&higmac {
+ phy-handle = <ðphy>;
+ phy-mode = "rgmii";
+};
+
+&mmc0 {
+ status = "okay";
+};
+
+&mmc1 {
+ status = "okay";
+};
+
+&gpio_chip0 {
+ status = "okay";
+};
+
+&gpio_chip1 {
+ status = "okay";
+};
+
+&gpio_chip2 {
+ status = "okay";
+};
+
+&gpio_chip3 {
+ status = "okay";
+};
+
+&gpio_chip4 {
+ status = "okay";
+};
+
+&gpio_chip5 {
+ status = "okay";
+};
+
+&gpio_chip6 {
+ status = "okay";
+};
+
+&gpio_chip7 {
+ status = "okay";
+};
+
+&gpio_chip8 {
+ status = "okay";
+};
+
+&gpio_chip9 {
+ status = "okay";
+};
+
+&gpio_chip10 {
+ status = "okay";
+};
+
+&gpio_chip11 {
+ status = "okay";
+};
+
+&gpio_chip12 {
+ status = "okay";
+};
+
+&gpio_chip13 {
+ status = "okay";
+};
+
+&gpio_chip14 {
+ status = "okay";
+};
+
+&gpio_chip15 {
+ status = "okay";
+};
diff --git a/arch/arm/boot/dts/hi3516a.dtsi b/arch/arm/boot/dts/hi3516a.dtsi
new file mode 100644
index 0000000..c24ec89
--- /dev/null
+++ b/arch/arm/boot/dts/hi3516a.dtsi
@@ -0,0 +1,679 @@
+/*
+ * Copyright (c) 2013-2014 Linaro Ltd.
+ * Copyright (c) 2015-2017 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include "skeleton.dtsi"
+#include
+
+/ {
+ aliases {
+ serial0 = &uart0;
+ i2c0 = &i2c_bus0;
+ i2c1 = &i2c_bus1;
+ i2c2 = &i2c_bus2;
+ spi0 = &spi_bus0;
+ spi1 = &spi_bus1;
+ gpio0 = &gpio_chip0;
+ gpio1 = &gpio_chip1;
+ gpio2 = &gpio_chip2;
+ gpio3 = &gpio_chip3;
+ gpio4 = &gpio_chip4;
+ gpio5 = &gpio_chip5;
+ gpio6 = &gpio_chip6;
+ gpio7 = &gpio_chip7;
+ gpio8 = &gpio_chip8;
+ gpio9 = &gpio_chip9;
+ gpio10 = &gpio_chip10;
+ gpio11 = &gpio_chip11;
+ gpio12 = &gpio_chip12;
+ gpio13 = &gpio_chip13;
+ gpio14 = &gpio_chip14;
+ gpio15 = &gpio_chip15;
+ };
+
+ clock: clock@20030000 {
+ compatible = "hisilicon,hi3516a-clock";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ #clock-cells = <1>;
+ #reset-cells = <2>;
+ reg = <0x20030000 0x1000>;
+ };
+
+ gic: interrupt-controller@20300000 {
+ compatible = "arm,cortex-a7-gic";
+ #interrupt-cells = <3>;
+ #address-cells = <0>;
+ interrupt-controller;
+ /* gic dist base, gic cpu base , no virtual support */
+ reg = <0x20301000 0x1000>, <0x20302000 0x100>;
+ };
+
+ sysctrl: system-controller@20050000 {
+ compatible = "hisilicon,sysctrl";
+ reg = <0x20050000 0x1000>;
+ reboot-offset = <0x4>;
+ #clock-cells = <1>;
+ };
+
+ soc {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "simple-bus";
+ interrupt-parent = <&gic>;
+ ranges;
+
+ clk_3m: clk_3m {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <3000000>;
+ };
+
+ clk_apb: clk_apb {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <50000000>;
+ };
+
+ pmu {
+ compatible = "arm,cortex-a7-pmu";
+ interrupts = <0 32 4>;
+ };
+
+ amba {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "arm,amba-bus";
+ ranges;
+
+ uart0: uart@20080000 {
+ compatible = "arm,pl011", "arm,primecell";
+ reg = <0x20080000 0x1000>;
+ interrupts = <0 8 4>;
+ clocks = <&clock HI3516A_UART0_CLK>;
+ clock-names = "apb_pclk";
+ status = "disabled";
+ };
+
+ uart1: uart@20090000 {
+ compatible = "arm,pl011", "arm,primecell";
+ reg = <0x20090000 0x1000>;
+ interrupts = <0 9 4>;
+ clocks = <&clock HI3516A_UART1_CLK>;
+ clock-names = "apb_pclk";
+ status = "disabled";
+ };
+
+ uart2: uart@200a0000 {
+ compatible = "arm,pl011", "arm,primecell";
+ reg = <0x200a0000 0x1000>;
+ interrupts = <0 10 4>;
+ clocks = <&clock HI3516A_UART2_CLK>;
+ clock-names = "apb_pclk";
+ status = "disabled";
+ };
+
+ uart3: uart@20230000 {
+ compatible = "arm,pl011", "arm,primecell";
+ reg = <0x20230000 0x1000>;
+ interrupts = <0 11 4>;
+ clocks = <&clock HI3516A_UART3_CLK>;
+ clock-names = "apb_pclk";
+ status = "disabled";
+ };
+
+ };
+
+ usb_phy: phy {
+ compatible = "hisilicon,hisi-usb-phy";
+ reg = <0x20030000 0x10000>, <0x20120000 0x10000>,
+ <0x20050000 0x10000>;
+ #phy-cells = <0>;
+ };
+
+ ehci@0x100b0000 {
+ compatible = "generic-ehci";
+ reg = <0x100b0000 0x10000>;
+ interrupts = <0 21 4>;
+
+ clocks = <&clock HI3516A_USB2_CTRL_UTMI0_REQ>,
+ <&clock HI3516A_USB2_HRST_REQ>;
+ clock-names = "usb2_cttl_utmi0_req", "usb2_hrst_req";
+ };
+
+ ohci@0x100a0000 {
+ compatible = "generic-ohci";
+ reg = <0x100a0000 0x10000>;
+ interrupts = <0 22 4>;
+
+ clocks = <&clock HI3516A_USB2_CTRL_UTMI0_REQ>,
+ <&clock HI3516A_USB2_HRST_REQ>;
+ clock-names = "usb2_cttl_utmi0_req", "usb2_hrst_req";
+ };
+
+ hiudc@0x10080000 {
+ compatible = "hiudc";
+ reg = <0x10080000 0x10000>;
+ interrupts = <0 23 4>;
+
+ clocks = <&clock HI3516A_USB2_HRST_REQ>;
+ clock-names = "clk";
+ };
+
+ dual_timer0: dual_timer@20000000 {
+ compatible = "arm,sp804", "arm,primecell";
+ interrupts = <0 3 4>;
+ reg = <0x20000000 0x1000>;
+ clocks = <&clk_apb>, <&clk_3m>, <&clk_apb>;
+ clock-names = "timer00", "timer01", "apb_pclk";
+ status = "disabled";
+ };
+
+ dual_timer1: dual_timer@20010000 {
+ compatible = "arm,sp804", "arm,primecell";
+ /* timer0 & timer1 */
+ interrupts = <0 4 4>;
+ reg = <0x20010000 0x1000>;
+ clocks = <&clk_3m>, <&clk_3m>, <&clk_apb>;
+ clock-names = "timer12", "timer13", "apb_pclk";
+ status = "disabled";
+ };
+
+ i2c_bus0: i2c@200d0000 {
+ compatible = "hisilicon,hisi-i2c-hisilicon";
+ reg = <0x200d0000 0x100>;
+ interrupts = <0 14 4>;
+ clocks = <&clock HI3516A_SYSAXI_CLK>;
+ clock-frequency = <100000>;
+ io-size = <0x1000>;
+ id = <0>;
+ status = "disabled";
+ };
+
+ i2c_bus1: i2c@20240000 {
+ compatible = "hisilicon,hisi-i2c-hisilicon";
+ reg = <0x20240000 0x100>;
+ interrupts = <0 57 4>;
+ clocks = <&clock HI3516A_SYSAXI_CLK>;
+ clock-frequency = <100000>;
+ io-size = <0x1000>;
+ id = <1>;
+ status = "disabled";
+ };
+
+ i2c_bus2: i2c@20250000 {
+ compatible = "hisilicon,hisi-i2c-hisilicon";
+ reg = <0x20250000 0x100>;
+ interrupts = <0 58 4>;
+ clocks = <&clock HI3516A_SYSAXI_CLK>;
+ clock-frequency = <100000>;
+ io-size = <0x1000>;
+ id = <2>;
+ status = "disabled";
+ };
+
+ spi_bus0: spi@200c0000 {
+ compatible = "arm,pl022", "arm,primecell";
+ arm,primecell-periphid = <0x00800022>;
+ reg = <0x200c0000 0x1000>;
+ interrupts = <0 12 4>;
+ clocks = <&clock HI3516A_SPI0_CLK>;
+ clock-names = "apb_pclk";
+ status = "disabled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+
+ spi_bus1: spi@200e0000 {
+ compatible = "arm,pl022", "arm,primecell";
+ arm,primecell-periphid = <0x00800022>;
+ reg = <0x200e0000 0x1000>, <0x20120004 0x4>;
+ interrupts = <0 13 4>;
+ clocks = <&clock HI3516A_SPI1_CLK>;
+ clock-names = "apb_pclk";
+ status = "disabled";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ hisi,spi_cs_sb = <26>;
+ hisi,spi_cs_mask_bit = <0x0c000000>;
+ };
+
+ hisfc350: spi_nor_controller@10010000 {
+ compatible = "hisilicon,hisi-spi-nor";
+ interrupts = <0 17 4>;
+ reg = <0x10010000 0x1000>, <0x58000000 0x1000000>;
+ reg-names = "control", "memory";
+ clocks = <&clock HI3516A_SNOR_CLK>;
+ assigned-clocks = <&clock HI3516A_SNOR_CLK>;
+ assigned-clock-rates = <24000000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ hi_sfc {
+ compatible = "jedec,spi-nor";
+ reg = <1>;
+ };
+ };
+
+ hisnfc100: spi_nand_controller@10040000 {
+ compatible = "hisilicon,hisi-spi-nand";
+ reg = <0x10040000 0x1000>, <0x54000000 0x1000000>;
+ reg-names = "control", "memory";
+ clocks = <&clock HI3516A_SNAND_CLK>;
+ assigned-clocks = <&clock HI3516A_SNAND_CLK>;
+ assigned-clock-rates = <24000000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ hinand {
+ compatible = "jedec,spi-nand";
+ reg = <1>;
+ };
+ };
+
+ hinfc610: nand_controller@10000000 {
+ compatible = "hisilicon,hisi-parallel-nand";
+ reg = <0x10000000 0x1000>, <0x50000000 0x1000000>;
+ reg-names = "control", "memory";
+ clocks = <&clock HI3516A_NAND_CLK>;
+ assigned-clocks = <&clock HI3516A_NAND_CLK>;
+ assigned-clock-rates = <198000000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ hinand {
+ compatible = "jedec,parallel-nand";
+ reg = <1>;
+ };
+ };
+
+ gpio_chip0: gpio_chip@20140000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x20140000 0x10000>;
+ interrupts = <0 47 4>;
+ clocks = <&clock HI3516A_SYSAXI_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip1: gpio_chip@20150000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x20150000 0x10000>;
+ interrupts = <0 48 4>;
+ clocks = <&clock HI3516A_SYSAXI_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip2: gpio_chip@20160000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x20160000 0x10000>;
+ interrupts = <0 49 4>;
+ clocks = <&clock HI3516A_SYSAXI_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip3: gpio_chip@20170000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x20170000 0x10000>;
+ interrupts = <0 50 4>;
+ clocks = <&clock HI3516A_SYSAXI_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip4: gpio_chip@20180000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x20180000 0x10000>;
+ interrupts = <0 51 4>;
+ clocks = <&clock HI3516A_SYSAXI_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip5: gpio_chip@20190000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x20190000 0x10000>;
+ interrupts = <0 52 4>;
+ clocks = <&clock HI3516A_SYSAXI_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip6: gpio_chip@201a0000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x201a0000 0x10000>;
+ interrupts = <0 53 4>;
+ clocks = <&clock HI3516A_SYSAXI_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip7: gpio_chip@201b0000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x201b0000 0x10000>;
+ interrupts = <0 54 4>;
+ clocks = <&clock HI3516A_SYSAXI_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip8: gpio_chip@201c0000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x201c0000 0x10000>;
+ interrupts = <0 55 4>;
+ clocks = <&clock HI3516A_SYSAXI_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip9: gpio_chip@201d0000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x201d0000 0x10000>;
+ interrupts = <0 55 4>;
+ clocks = <&clock HI3516A_SYSAXI_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip10: gpio_chip@201e0000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x201e0000 0x10000>;
+ interrupts = <0 54 4>;
+ clocks = <&clock HI3516A_SYSAXI_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip11: gpio_chip@201f0000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x201f0000 0x10000>;
+ interrupts = <0 53 4>;
+ clocks = <&clock HI3516A_SYSAXI_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip12: gpio_chip@20200000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x20200000 0x10000>;
+ interrupts = <0 52 4>;
+ clocks = <&clock HI3516A_SYSAXI_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip13: gpio_chip@20210000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x20210000 0x10000>;
+ interrupts = <0 51 4>;
+ clocks = <&clock HI3516A_SYSAXI_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip14: gpio_chip@20220000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x20220000 0x10000>;
+ interrupts = <0 50 4>;
+ clocks = <&clock HI3516A_SYSAXI_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip15: gpio_chip@20260000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x20260000 0x10000>;
+ interrupts = <0 49 4>;
+ clocks = <&clock HI3516A_SYSAXI_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ regulators@20270000 {
+ compatible = "hi3516a,regulators";
+ reg = <0x20270000 0x1000>;
+ regulator-num = <2>;
+ regulator-name-array = "regulator-a7","regulator-media";
+
+ a7_regulator: a7_regulator{
+ regulator-name = "regulator-a7";
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <1310000>;
+ regulator-always-on;
+ reg_offset = <0x4>;
+ };
+
+ media_regulator: media_regulator{
+ regulator-name = "regulator-media";
+ regulator-min-microvolt = <800000>;
+ regulator-max-microvolt = <1310000>;
+ regulator-always-on;
+ reg_offset = <0xC>;
+ };
+ };
+ mdio: mdio@100903c0 {
+ compatible = "hisilicon,hisi-gemac-mdio";
+ reg = <0x100903c0 0x20>;
+ clocks = <&clock HI3516A_ETH_CLK>,
+ <&clock HI3516A_ETH_PHY_MUX>;
+ assigned-clocks = <&clock HI3516A_ETH_PHY_MUX>;
+ assigned-clock-rates = <25000000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+
+ higmac: ethernet@10090000 {
+ compatible = "hisilicon,higmac";
+ reg = <0x10090000 0x1000>,<0x200300ec 0x4>;
+ interrupts = <0 25 4>;
+
+ clocks = <&clock HI3516A_ETH_CLK>,
+ <&clock HI3516A_ETH_MACIF_CLK>;
+ clock-names = "higmac_clk",
+ "macif_clk";
+
+ resets = <&clock 0xcc 0>,
+ <&clock 0xcc 2>;
+ reset-names = "port_reset",
+ "macif_reset";
+
+ mac-address = [00 00 00 00 00 00];
+ };
+
+ mmc0: himci.SD@0x206e0000 {
+ compatible = "hisilicon,hi3516a-himci";
+ reg = <0x206e0000 0x1000>;
+ interrupts = <0 19 4>;
+ clocks = <&clock HI3516A_MMC0_CLK>;
+ clock-names = "mmc_clk";
+ resets = <&clock 0xc4 0>;
+ reset-names = "mmc_reset";
+ max-frequency = <100000000>;
+ bus-width = <4>;
+ cap-sd-highspeed;
+ sd-uhs-sdr12;
+ sd-uhs-sdr25;
+ sd-uhs-sdr50;
+ sd-uhs-sdr104;
+ devid = <0>;
+ status = "disabled";
+ };
+
+ mmc1: himci.SD@0x206f0000 {
+ compatible = "hisilicon,hi3516a-himci";
+ reg = <0x206f0000 0x1000>;
+ interrupts = <0 20 4>;
+ clocks = <&clock HI3516A_MMC1_CLK>;
+ clock-names = "mmc_clk";
+ resets = <&clock 0xc4 8>;
+ reset-names = "mmc_reset";
+ max-frequency = <100000000>;
+ bus-width = <4>;
+ cap-sd-highspeed;
+ sd-uhs-sdr12;
+ sd-uhs-sdr25;
+ sd-uhs-sdr50;
+ sd-uhs-sdr104;
+ devid = <1>;
+ status = "disabled";
+ };
+ };
+
+ media {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "simple-bus";
+ interrupt-parent = <&gic>;
+ ranges;
+
+ sys: sys@20030000 {
+ compatible = "hisilicon,hi35xx_sys";
+ reg = <0x20030000 0x10000>, <0x20050000 0x10000>,
+ <0x20110000 0x10000>, <0x20120000 0x10000>;
+ reg-names = "crg", "sys", "ddr", "misc";
+ };
+
+ audio: audio@20650000 {
+ compatible = "hisilicon,hi35xx_aiao";
+ interrupts = <0 39 4>;
+ reg = <0x20650000 0x10000>;
+ reg-names = "aiao";
+ };
+
+ ive: ive@206a0000 {
+ compatible = "hisilicon,hi35xx_ive";
+ interrupts = <0 45 4>;
+ reg = <0x206a0000 0x10000>;
+ };
+
+ vda: vda@206c0000 {
+ compatible = "hisilicon,hi35xx_vda";
+ interrupts = <0 44 4>;
+ reg = <0x206c0000 0x10000>;
+ };
+
+ mipi: mipi@20680000 {
+ compatible = "hisilicon,hi35xx_mipi";
+ interrupts = <0 34 4>;
+ reg = <0x20680000 0x10000>;
+ };
+
+ isp: isp@20580000 {
+ compatible = "hisilicon,hi35xx_isp";
+ interrupts = <0 35 4>;
+ reg = <0x20580000 0x10000>, <0x205a0000 0x20000>;
+ reg-names = "reg_vicap_base_va", "reg_isp_base_va";
+ };
+
+ viu: viu@20580000 {
+ compatible = "hisilicon,hi35xx_viu";
+ interrupts = <0 35 4>;
+ reg = <0x20580000 0x40000>;
+ };
+
+ vou: vou@205c0000 {
+ compatible = "hisilicon,hi35xx_vou";
+ interrupts = <0 33 4>;
+ reg = <0x205c0000 0x10000>;
+ };
+
+ vgs: vgs@20630000 {
+ compatible = "hisilicon,hi35xx_vgs";
+ interrupts = <0 38 4>;
+ reg = <0x20630000 0x10000>;
+ };
+
+ vpss: vpss@20600000 {
+ compatible = "hisilicon,hi35xx_vpss";
+ interrupts = <0 36 4>;
+ reg = <0x20600000 0x10000>;
+ };
+
+ vedu: vedu@20640000 {
+ compatible = "hisilicon,hi35xx_vedu";
+ interrupts = <0 43 4>;
+ reg = <0x20640000 0x10000>;
+ };
+
+ avc: avc@20620000 {
+ compatible = "hisilicon,hi35xx_avc";
+ interrupts = <0 40 4>;
+ reg = <0x20620000 0x10000>;
+ };
+
+ jpege: jpege@20660000 {
+ compatible = "hisilicon,hi35xx_jpege";
+ interrupts = <0 41 4>;
+ reg = <0x20660000 0x10000>;
+ };
+
+ tde: tde@20610000 {
+ compatible = "hisilicon,hi35xx_tde";
+ interrupts = <0 37 4>;
+ reg = <0x20610000 0x10000>;
+ };
+
+ pwm: pwm@20130000 {
+ compatible = "hisilicon,hi3516cv300-pwm";
+ reg = <0x20130000 0x10000>;
+ };
+
+ wtdg: wtdg@20040000 {
+ compatible = "hisilicon,hi_wdg";
+ reg = <0x20040000 0x10000>;
+ reg-names = "wtdg";
+ };
+
+ rtc: rtc@20060000 {
+ compatible = "hisilicon,hi_rtc";
+ interrupts = <0 7 4>, <0 56 4>;
+ interrupt-names = "rtc", "rtc_temp";
+ reg = <0x20060000 0x10000>;
+ };
+
+ ir: ir@20070000{
+ compatible = "hisilicon,hi_ir";
+ interrupts = <0 15 4>;
+ reg = <0x20070000 0x10000>;
+ };
+
+ cipher: cipher@100c0000{
+ compatible = "hisilicon,hi_cipher";
+ interrupts = <0 26 4>;
+ reg = <0x100c0000 0x10000>;
+ };
+ };
+};
diff --git a/arch/arm/boot/dts/hi3536dv100-demb.dts b/arch/arm/boot/dts/hi3536dv100-demb.dts
new file mode 100644
index 0000000..cb6968f
--- /dev/null
+++ b/arch/arm/boot/dts/hi3536dv100-demb.dts
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2013-2014 Linaro Ltd.
+ * Copyright (c) 2015-2017 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/dts-v1/;
+#include "hi3536dv100.dtsi"
+
+/ {
+ model = "Hisilicon HI3536DV100 DEMO Board";
+ compatible = "hisilicon,hi3536dv100";
+
+ memory {
+ device_type = "memory";
+ reg = <0x80000000 0x20000000>;
+ };
+};
+
+&uart0 {
+ status = "okay";
+};
+
+&i2c_bus0 {
+ status = "okay";
+ clock-frequency = <100000>;
+};
+
+&dual_timer0 {
+ status = "okay";
+};
+
+&mdio0 {
+ hisilicon,phy-reset-delays-us = <10000 20000 150000>;
+ phy0: ethernet-phy@1 {
+ reg = <1>;
+ };
+};
+
+&hisi_femac0 {
+ mac-address = [00 00 00 00 00 00];
+ phy-mode = "mii";
+ phy-handle = <&phy0>;
+};
+
+&hisfc {
+ hi_sfc {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <160000000>;
+ };
+};
+
+&hisnfc {
+ hinand {
+ compatible = "jedec,spi-nand";
+ reg = <0>;
+ spi-max-frequency = <160000000>;
+ };
+};
+
+&hidmac {
+ status = "okay";
+};
+
+&gpio_chip0 {
+ status = "okay";
+};
+
+&gpio_chip1 {
+ status = "okay";
+};
+
+&gpio_chip2 {
+ status = "okay";
+};
+
+&gpio_chip3 {
+ status = "okay";
+};
+
+&gpio_chip4 {
+ status = "okay";
+};
+
+&gpio_chip5 {
+ status = "okay";
+};
+
+&pmux {
+
+ i2s1_pmux: i2s1_pmux {
+ pinctrl-single,pins = <
+ 0x0070 0x2
+ 0x0078 0x2
+ 0x007c 0x2
+ 0x0090 0x2
+ 0x0094 0x2
+ >;
+ };
+ i2s2_pmux: i2s2_pmux {
+ pinctrl-single,pins = <
+ 0x0040 0x3 /*I2S_SD_RX*/
+ 0x0044 0x3 /*I2S_MCLK*/
+ 0x0048 0x3 /*I2S_WS*/
+ 0x004c 0x3 /*I2S_BCLK*/
+ 0x0050 0x3 /*I2S_SD_TX*/
+ >;
+ };
+};
+
+&sys_config_ctrl {
+ padctrl-ability,demo = <
+ 0x120f08ac 0xb0
+ 0x120f08b4 0xb0
+ 0x120f08b8 0xb0
+ 0x120f08cc 0xb0
+ 0x120f08d0 0xb0
+ >;
+ padctrl-ability,sck = <
+ 0x120f0868 0x80
+ 0x120f086c 0xa0
+ 0x120f0870 0xa0
+ 0x120f0874 0xa0
+ 0x120f0878 0xa0
+ >;
+ sysctrl-ddr,pins = <
+ 0x12120078 0x55322100 /* JPGD - JPGE - TFE - VGS - VDH - A7 - VDP - AIAO */
+ 0x1212007c 0x65665526 /* FMC - DMA1 - DMA9 - DDRT - SATA - ETH1 - ETH0 - VOIE */
+ 0x12120080 0x66666666 /* - - - - - - CIPHER - USB */
+ 0x12120084 0x55522100 /* JPGD - JPGE - TFE - VGS - VDH - A7 - VDP - AIAO */
+ 0x12120088 0x65665526 /* FMC - DMA1 - DMA9 - DDRT - SATA - ETH1 - ETH0 - VOIE */
+ 0x1212008c 0x66626666 /* - - - - - - CIPHER - USB */
+ 0x12120094 0x10 /* aio_vdp_axi_pri*/
+ 0x12120090 0x80020000 /* aio_vdp_axi_timeout*/
+ 0x12110020 0x000fff01 /* AXI_ACTION[19:8]:wr_rcv_mode=0,12ports */
+ 0x12110200 0x00200000 /* ports0 */
+ 0x12110210 0x00300000 /* ports1 */
+ 0x12110220 0x00300000 /* ports2 */
+ 0x12110230 0x00300000 /* ports3 */
+ 0x12110240 0x00300000 /* ports4 */
+ 0x12110250 0x00300000 /* ports5 */
+ 0x12110260 0x00300000 /* ports6 */
+ 0x12110270 0x00300000 /* ports7 */
+ 0x12110204 0x76543210 /* ports0 */
+ 0x12110214 0x76543210 /* ports1 */
+ 0x12110224 0x76543210 /* ports2 */
+ 0x12110234 0x76543210 /* ports3 */
+ 0x12110244 0x76543210 /* ports4 */
+ 0x12110254 0x76543210 /* ports5 */
+ 0x12110264 0x76543210 /* ports6 */
+ 0x12110274 0x76543210 /* ports7 */
+ 0x12110208 0x76543210 /* ports0 */
+ 0x12110218 0x76543210 /* ports1 */
+ 0x12110228 0x76543210 /* ports2 */
+ 0x12110238 0x76543210 /* ports3 */
+ 0x12110248 0x76543210 /* ports4 */
+ 0x12110258 0x76543210 /* ports5 */
+ 0x12110268 0x76543210 /* ports6 */
+ 0x12110278 0x76543210 /* ports7 */
+ 0x12114000 0x00000002 /*qosb_push_ctrl */
+ 0x1211410c 0x0000000a /*qosb_dmc_lvl */
+ 0x12114110 0x0000000a /*qosb_dmc_lvl */
+ 0x1211408c 0xb3032010 /*qosb_wbuf_ctrl */
+ 0x12114090 0xb3032010 /*qosb_wbuf_ctrl */
+ 0x121140f4 0x00000033 /*row-hit enable */
+ 0x121140ec 0x00000044 /*row-hit */
+ 0x121140f0 0x00003333 /*row-hit */
+ 0x121141f4 0x00000000 /*qosb_wbuf_pri_ctrl*/
+ 0x121141f0 0x00000001 /*enable qosbuf timeout,through prilvl to remap timeout level*/
+ 0x1211409c 0x0000000a /* wr_tout3 ~wr_tout0 */
+ 0x121140ac 0x0000000a /* rd_tout3 ~rd_tout0 */
+ 0x121141f8 0x00800002 /* qosb_rhit_ctrl,open_window=128,close_window=2*/
+ >;
+ pinctrl-names = "demo", "sck", "default";
+ pinctrl-0 = <&i2s1_pmux>;
+ pinctrl-1 = <&i2s2_pmux>;
+ pinctrl-2 = <>;
+};
diff --git a/arch/arm/boot/dts/hi3536dv100.dtsi b/arch/arm/boot/dts/hi3536dv100.dtsi
new file mode 100644
index 0000000..968d91d
--- /dev/null
+++ b/arch/arm/boot/dts/hi3536dv100.dtsi
@@ -0,0 +1,441 @@
+/*
+ * Copyright (c) 2013-2014 Linaro Ltd.
+ * Copyright (c) 2015-2017 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include "skeleton.dtsi"
+#include
+/ {
+ aliases {
+ serial0 = &uart0;
+ i2c0 = &i2c_bus0;
+ gpio0 = &gpio_chip0;
+ gpio1 = &gpio_chip1;
+ gpio2 = &gpio_chip2;
+ gpio3 = &gpio_chip3;
+ gpio4 = &gpio_chip4;
+ gpio5 = &gpio_chip5;
+ };
+
+ cpus {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ cpu@0 {
+ device_type = "cpu";
+ compatible = "arm,cortex-a7";
+ reg = <0>;
+ };
+ };
+
+ clock: clock@12040000 {
+ compatible = "hisilicon,hi3536dv100-clock";
+ #address-cells = <1>;
+ #size-cells = <1>;
+ #clock-cells = <1>;
+ #reset-cells = <2>;
+ reg = <0x12040000 0x1000>;
+ };
+
+ gic: interrupt-controller@10300000 {
+ compatible = "arm,cortex-a7-gic";
+ #interrupt-cells = <3>;
+ #address-cells = <0>;
+ interrupt-controller;
+ /* gic dist base, gic cpu base , no virtual support */
+ reg = <0x10301000 0x1000>, <0x10302000 0x100>;
+ };
+
+ soc {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "simple-bus";
+ interrupt-parent = <&gic>;
+ ranges;
+
+ clk_3m: clk_3m {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <3000000>;
+ };
+
+ clk_apb: clk_apb {
+ compatible = "fixed-clock";
+ #clock-cells = <0>;
+ clock-frequency = <50000000>;
+ };
+
+ pmu {
+ compatible = "arm,cortex-a7-pmu";
+ interrupts = <0 54 4>;
+ };
+
+ sysctrl: system-controller@12050000 {
+ compatible = "hisilicon,sysctrl";
+ reg = <0x12050000 0x1000>;
+ reboot-offset = <0x4>;
+ #clock-cells = <1>;
+ };
+
+ amba {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "arm,amba-bus";
+ ranges;
+
+ dual_timer0: dual_timer@12000000 {
+ compatible = "arm,sp804", "arm,primecell";
+ /* timer0 & timer1 */
+ interrupts = <0 1 4>;
+ reg = <0x12000000 0x1000>;
+ clocks = <&clk_3m>, <&clk_3m>, <&clk_apb>;
+ clock-names = "timer00", "timer01", "apb_pclk";
+ status = "disabled";
+ };
+
+ dual_timer1: dual_timer@12010000 {
+ compatible = "arm,sp804", "arm,primecell";
+ /* timer2 & timer3 */
+ interrupts = <0 2 4>;
+ reg = <0x12010000 0x1000>;
+ clocks = <&clk_3m>, <&clk_3m>, <&clk_apb>;
+ clock-names = "timer10", "timer11", "apb_pclk";
+ status = "disabled";
+ };
+
+ dual_timer2: dual_timer@12020000 {
+ compatible = "arm,sp804", "arm,primecell";
+ /* timer4 & timer5 */
+ interrupts = <0 3 4>;
+ reg = <0x12020000 0x1000>;
+ clocks = <&clk_3m>, <&clk_3m>, <&clk_apb>;
+ clock-names = "timer20", "timer21", "apb_pclk";
+ status = "disabled";
+ };
+
+ dual_timer3: dual_timer@12030000 {
+ compatible = "arm,sp804", "arm,primecell";
+ /* timer6 & timer7 */
+ interrupts = <0 4 4>;
+ reg = <0x12030000 0x1000>;
+ clocks = <&clk_3m>, <&clk_3m>, <&clk_apb>;
+ clock-names = "timer30", "timer31", "apb_pclk";
+ status = "disabled";
+ };
+
+ uart0: uart@12080000 {
+ compatible = "arm,pl011", "arm,primecell";
+ reg = <0x12080000 0x1000>;
+ interrupts = <0 6 4>;
+ clocks = <&clock HI3536DV100_UART0_CLK>;
+ clock-names = "apb_pclk";
+ status = "disabled";
+ };
+
+ uart1: uart@12090000 {
+ compatible = "arm,pl011", "arm,primecell";
+ reg = <0x12090000 0x1000>;
+ interrupts = <0 7 4>;
+ clocks = <&clock HI3536DV100_UART1_CLK>;
+ clock-names = "apb_pclk";
+ status = "disabled";
+ };
+
+ uart2: uart@120a0000 {
+ compatible = "arm,pl011", "arm,primecell";
+ reg = <0x120a0000 0x1000>;
+ interrupts = <0 8 4>;
+ clocks = <&clock HI3536DV100_UART2_CLK>;
+ clock-names = "apb_pclk";
+ status = "disabled";
+ };
+
+ };
+
+ i2c_bus0: i2c@120c0000 {
+ compatible = "hisilicon,hi3536dv100-i2c",
+ "hisilicon,hibvt-i2c";
+ reg = <0x120c0000 0x1000>;
+ clocks = <&clock HI3536DV100_SYSAPB_CLK>;
+ status = "disabled";
+ };
+
+ sata_phy: phy@10030000 {
+ compatible = "hisilicon,hisi-sata-phy";
+ reg = <0x10030000 0x10000>;
+ #phy-cells = <0>;
+ };
+
+ ahci: sata@10030000 {
+ compatible = "hisilicon,hisi-ahci";
+ reg = <0x10030000 0x1000>;
+ interrupts = <0 17 4>;
+ phys = <&sata_phy>;
+ phy-names = "sata-phy";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+
+ mdio0: mdio@10011100 {
+ compatible = "hisilicon,hisi-femac-mdio";
+ reg = <0x10011100 0x10>, <0x12120064 0x4>,
+ <0x12121000 0x4>;
+ clocks = <&clock HI3536DV100_ETH0_CLK>,
+ <&clock HI3536DV100_ETH0_PHY_CLK>;
+ clock-names = "mdio", "phy";
+ resets = <&clock 0xc4 3>, <&clock 0xc4 9>;
+ reset-names = "external-phy", "internal-phy";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+
+ hisi_femac0: ethernet@10010000 {
+ compatible = "hisilicon,hi3536dv100-femac",
+ "hisilicon,hisi-femac-v2";
+ reg = <0x10010000 0x1000>,<0x10011300 0x200>;
+ interrupts = <0 11 4>;
+ clocks = <&clock HI3536DV100_ETH0_CLK>;
+ resets = <&clock 0xc4 0>;
+ reset-names = "mac";
+ };
+
+ usb_phy: usbphy {
+ compatible = "hisilicon,hisi-usb-phy";
+ reg = <0x12040000 0x1000>, <0x12120000 0x10000>;
+ };
+
+ ehci@0x11010000 {
+ compatible = "generic-ehci";
+ reg = <0x11010000 0x10000>;
+ interrupts = <0 19 4>;
+ };
+
+ ohci@0x11000000 {
+ compatible = "generic-ohci";
+ reg = <0x11000000 0x10000>;
+ interrupts = <0 18 4>;
+ };
+
+ fmc: flash-memory-controller@10000000 {
+ compatible = "hisilicon,hisi-fmc";
+ reg = <0x10000000 0x1000>, <0x14000000 0x1000000>;
+ reg-names = "control", "memory";
+ clocks = <&clock HI3536DV100_FMC_CLK>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ hisfc:spi-nor@0 {
+ compatible = "hisilicon,fmc-spi-nor";
+ assigned-clocks = <&clock HI3536DV100_FMC_CLK>;
+ assigned-clock-rates = <24000000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+
+ hisnfc:spi-nand@0 {
+ compatible = "hisilicon,fmc-spi-nand";
+ assigned-clocks = <&clock HI3536DV100_FMC_CLK>;
+ assigned-clock-rates = <24000000>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
+ };
+
+ hidmac: hidma-controller@11020000 {
+ compatible = "hisilicon,hisi-dmac";
+ reg = <0x11020000 0x1000>;
+ interrupts = <0 14 4>;
+ clocks = <&clock HI3536DV100_DMAC_CLK>;
+ clock-names = "dmac_clk";
+ resets = <&clock 0xc8 4>;
+ reset-names = "dma-reset";
+ #dma-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip0: gpio_chip@12150000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x12150000 0x10000>;
+ interrupts = <0 55 4>;
+ clocks = <&clock HI3536DV100_SYSAPB_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip1: gpio_chip@12160000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x12160000 0x10000>;
+ interrupts = <0 56 4>;
+ clocks = <&clock HI3536DV100_SYSAPB_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip2: gpio_chip@12170000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x12170000 0x10000>;
+ interrupts = <0 57 4>;
+ clocks = <&clock HI3536DV100_SYSAPB_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip3: gpio_chip@12180000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x12180000 0x10000>;
+ interrupts = <0 58 4>;
+ clocks = <&clock HI3536DV100_SYSAPB_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip4: gpio_chip@12190000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x12190000 0x10000>;
+ interrupts = <0 59 4>;
+ clocks = <&clock HI3536DV100_SYSAPB_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ gpio_chip5: gpio_chip@121a0000 {
+ compatible = "arm,pl061", "arm,primecell";
+ reg = <0x121a0000 0x10000>;
+ interrupts = <0 60 4>;
+ clocks = <&clock HI3536DV100_SYSAPB_CLK>;
+ clock-names = "apb_pclk";
+ #gpio-cells = <2>;
+ status = "disabled";
+ };
+
+ pmux: pinmux@120F0000 {
+ compatible = "pinctrl-single";
+ reg = <0x120F0000 0x3A8>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ #gpio-range-cells = <3>;
+ ranges;
+
+ pinctrl-single,register-width = <32>;
+ pinctrl-single,function-mask = <7>;
+ /* pin base, nr pins & gpio function */
+ pinctrl-single,gpio-range = <&range 0 54 0
+ &range 55 6 1 &range 61 5 0>;
+
+ range: gpio-range {
+ #pinctrl-single,gpio-range-cells = <3>;
+ };
+ };
+ };
+
+ media {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "simple-bus";
+ interrupt-parent = <&gic>;
+ ranges;
+
+ osal: osal {
+ compatible = "hisilicon,osal";
+ };
+
+ sys: sys@12040000 {
+ compatible = "hisilicon,hi35xx_sys";
+ reg = <0x12040000 0x10000>, <0x12050000 0x10000>,
+ <0x12110000 0x10000>, <0x12120000 0x10000>;
+ reg-names = "crg", "sys", "ddr", "misc";
+ };
+
+ rtc: rtc@120b0000 {
+ compatible = "hisilicon,hi35xx-rtc";
+ interrupts = <0 5 4>;
+ reg = <0x120b0000 0x10000>;
+ };
+
+ vou: vou@13020000 {
+ compatible = "hisilicon,hi35xx_vou";
+ interrupts = <0 34 4>;
+ reg = <0x13020000 0x10000>;
+ };
+
+ vgs: vgs@13100000 {
+ compatible = "hisilicon,hi35xx_vgs";
+ interrupts = <0 28 4>;
+ reg = <0x13100000 0x10000>;
+ };
+
+ audio: audio@13040000 {
+ compatible = "hisilicon,hi35xx_aiao";
+ interrupts = <0 32 4>;
+ reg = <0x13040000 0x10000>, <0x130500d0 0x10000>;
+ reg-names = "aiao", "acodec";
+ };
+
+ vdec: vdec@13200000 {
+ compatible = "hisilicon,hi35xx_vdec";
+ interrupts = <0 21 4>, <0 23 4>;
+ interrupt-names = "vdm", "scd";
+ reg = <0x13200000 0xc000>, <0x1320c000 0x4000>;
+ reg-names = "vdm", "scd";
+ };
+
+ tde: tde@13130000 {
+ compatible = "hisilicon,hi35xx_tde";
+ interrupts = <0 29 4>;
+ reg = <0x13130000 0x1000>;
+ };
+
+ jpgd: jpgd@13110000 {
+ compatible = "hisilicon,hi35xx_jpgd";
+ interrupts = <0 31 4>;
+ interrupt-names = "jpgd";
+ reg = <0x13110000 0x10000>;
+ reg-names = "jpgd";
+ };
+
+ hiir: hiir@0x12140000 {
+ compatible = "hisilicon,hi_ir";
+ interrupts = <0 9 4>;
+ reg = <0x12140000 0x10000>;
+ };
+
+ cipher: cipher@0x11030000 {
+ compatible = "hisilicon,hi_isr";
+ interrupts = <0 13 4>;
+ reg = <0x11030000 0x10000>;
+ };
+
+ jpege: jpege@13120000 {
+ compatible = "hisilicon,hi35xx_jpege";
+ interrupts = <0 30 4>;
+ reg = <0x13120000 0x10000>;
+ };
+
+ pin_ctrl_ddr: pin_ctrl_ddr {
+ compatible = "hisilicon,pinctrl-ddr";
+ };
+
+ sys_config_ctrl: sys_config_ctrl {
+ compatible = "hisilicon,sys_config_ctrl";
+ };
+ };
+};
diff --git a/arch/arm/configs/hi3516a_full_defconfig b/arch/arm/configs/hi3516a_full_defconfig
new file mode 100644
index 0000000..26beaeb
--- /dev/null
+++ b/arch/arm/configs/hi3516a_full_defconfig
@@ -0,0 +1,2722 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Linux/arm 4.9.37 Kernel Configuration
+#
+CONFIG_ARM=y
+CONFIG_ARM_HAS_SG_CHAIN=y
+CONFIG_MIGHT_HAVE_PCI=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_HAVE_PROC_CPU=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_FIX_EARLYCON_MEM=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_ARCH_SUPPORTS_UPROBES=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_ARM_PATCH_PHYS_VIRT=y
+CONFIG_GENERIC_BUG=y
+CONFIG_PGTABLE_LEVELS=2
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_IRQ_WORK=y
+CONFIG_BUILDTIME_EXTABLE_SORT=y
+
+#
+# General setup
+#
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_CROSS_COMPILE=""
+# CONFIG_COMPILE_TEST is not set
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_HAVE_KERNEL_GZIP=y
+CONFIG_HAVE_KERNEL_LZMA=y
+CONFIG_HAVE_KERNEL_XZ=y
+CONFIG_HAVE_KERNEL_LZO=y
+CONFIG_HAVE_KERNEL_LZ4=y
+CONFIG_KERNEL_GZIP=y
+# CONFIG_KERNEL_LZMA is not set
+# CONFIG_KERNEL_XZ is not set
+# CONFIG_KERNEL_LZO is not set
+# CONFIG_KERNEL_LZ4 is not set
+CONFIG_DEFAULT_HOSTNAME="(none)"
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+CONFIG_CROSS_MEMORY_ATTACH=y
+CONFIG_FHANDLE=y
+CONFIG_USELIB=y
+# CONFIG_AUDIT is not set
+CONFIG_HAVE_ARCH_AUDITSYSCALL=y
+
+#
+# IRQ subsystem
+#
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_IRQ_DOMAIN=y
+CONFIG_IRQ_DOMAIN_HIERARCHY=y
+CONFIG_HANDLE_DOMAIN_IRQ=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_SPARSE_IRQ=y
+CONFIG_ARCH_CLOCKSOURCE_DATA=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+
+#
+# Timers subsystem
+#
+CONFIG_HZ_PERIODIC=y
+# CONFIG_NO_HZ_IDLE is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+
+#
+# CPU/Task time and stats accounting
+#
+CONFIG_TICK_CPU_ACCOUNTING=y
+# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set
+CONFIG_IRQ_TIME_ACCOUNTING=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_TINY_RCU=y
+# CONFIG_RCU_EXPERT is not set
+CONFIG_SRCU=y
+# CONFIG_TASKS_RCU is not set
+# CONFIG_RCU_STALL_COMMON is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_RCU_EXPEDITE_BOOT is not set
+# CONFIG_BUILD_BIN2C is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=17
+CONFIG_NMI_LOG_BUF_SHIFT=13
+CONFIG_GENERIC_SCHED_CLOCK=y
+CONFIG_CGROUPS=y
+# CONFIG_MEMCG is not set
+# CONFIG_BLK_CGROUP is not set
+# CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUP_PIDS is not set
+CONFIG_CGROUP_FREEZER=y
+# CONFIG_CPUSETS is not set
+# CONFIG_CGROUP_DEVICE is not set
+# CONFIG_CGROUP_CPUACCT is not set
+# CONFIG_CGROUP_DEBUG is not set
+# CONFIG_CHECKPOINT_RESTORE is not set
+CONFIG_NAMESPACES=y
+CONFIG_UTS_NS=y
+CONFIG_IPC_NS=y
+# CONFIG_USER_NS is not set
+CONFIG_PID_NS=y
+CONFIG_NET_NS=y
+# CONFIG_SCHED_AUTOGROUP is not set
+# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
+# CONFIG_RD_XZ is not set
+# CONFIG_RD_LZO is not set
+CONFIG_RD_LZ4=y
+CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_HAVE_UID16=y
+CONFIG_BPF=y
+# CONFIG_EXPERT is not set
+CONFIG_UID16=y
+CONFIG_MULTIUSER=y
+# CONFIG_SGETMASK_SYSCALL is not set
+CONFIG_SYSFS_SYSCALL=y
+# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_ABSOLUTE_PERCPU is not set
+CONFIG_KALLSYMS_BASE_RELATIVE=y
+CONFIG_PRINTK=y
+CONFIG_PRINTK_NMI=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+# CONFIG_BPF_SYSCALL is not set
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_ADVISE_SYSCALLS=y
+# CONFIG_USERFAULTFD is not set
+CONFIG_MEMBARRIER=y
+# CONFIG_EMBEDDED is not set
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_PERF_USE_VMALLOC=y
+
+#
+# Kernel Performance Events And Counters
+#
+# CONFIG_PERF_EVENTS is not set
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+CONFIG_COMPAT_BRK=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLAB_FREELIST_RANDOM is not set
+# CONFIG_SYSTEM_DATA_VERIFICATION is not set
+# CONFIG_PROFILING is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+# CONFIG_JUMP_LABEL is not set
+# CONFIG_UPROBES is not set
+# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_ARCH_USE_BUILTIN_BSWAP=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_OPTPROBES=y
+CONFIG_HAVE_NMI=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+CONFIG_HAVE_DMA_CONTIGUOUS=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GENERIC_IDLE_POLL_SETUP=y
+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_PERF_REGS=y
+CONFIG_HAVE_PERF_USER_STACK_DUMP=y
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
+CONFIG_HAVE_GCC_PLUGINS=y
+# CONFIG_GCC_PLUGINS is not set
+CONFIG_HAVE_CC_STACKPROTECTOR=y
+# CONFIG_CC_STACKPROTECTOR is not set
+CONFIG_CC_STACKPROTECTOR_NONE=y
+# CONFIG_CC_STACKPROTECTOR_REGULAR is not set
+# CONFIG_CC_STACKPROTECTOR_STRONG is not set
+CONFIG_HAVE_CONTEXT_TRACKING=y
+CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
+CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
+CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
+CONFIG_MODULES_USE_ELF_REL=y
+CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
+CONFIG_HAVE_ARCH_MMAP_RND_BITS=y
+CONFIG_HAVE_EXIT_THREAD=y
+CONFIG_ARCH_MMAP_RND_BITS_MIN=8
+CONFIG_ARCH_MMAP_RND_BITS_MAX=16
+CONFIG_ARCH_MMAP_RND_BITS=8
+# CONFIG_HAVE_ARCH_HASH is not set
+# CONFIG_ISA_BUS_API is not set
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_OLD_SIGSUSPEND3=y
+CONFIG_OLD_SIGACTION=y
+# CONFIG_CPU_NO_EFFICIENT_FFS is not set
+# CONFIG_HAVE_ARCH_VMAP_STACK is not set
+
+#
+# GCOV-based kernel profiling
+#
+CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+# CONFIG_MODULE_SIG is not set
+# CONFIG_MODULE_COMPRESS is not set
+# CONFIG_TRIM_UNUSED_KSYMS is not set
+CONFIG_BLOCK=y
+CONFIG_LBDAF=y
+CONFIG_BLK_DEV_BSG=y
+# CONFIG_BLK_DEV_BSGLIB is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+CONFIG_BLK_CMDLINE_PARSER=y
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_AIX_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+CONFIG_EFI_PARTITION=y
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_CMDLINE_PARTITION=y
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_DEADLINE=y
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="deadline"
+CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
+CONFIG_INLINE_READ_UNLOCK=y
+CONFIG_INLINE_READ_UNLOCK_IRQ=y
+CONFIG_INLINE_WRITE_UNLOCK=y
+CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
+CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
+CONFIG_FREEZER=y
+
+#
+# System Type
+#
+CONFIG_MMU=y
+CONFIG_ARCH_MULTIPLATFORM=y
+# CONFIG_ARCH_GEMINI is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_DOVE is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_W90X900 is not set
+# CONFIG_ARCH_LPC32XX is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C24XX is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP1 is not set
+
+#
+# Multiple platform selection
+#
+
+#
+# CPU Core family selection
+#
+# CONFIG_ARCH_MULTI_V6 is not set
+CONFIG_ARCH_MULTI_V7=y
+CONFIG_ARCH_MULTI_V6_V7=y
+# CONFIG_ARCH_MULTI_CPU_AUTO is not set
+# CONFIG_ARCH_VIRT is not set
+# CONFIG_ARCH_MVEBU is not set
+# CONFIG_ARCH_ALPINE is not set
+# CONFIG_ARCH_ARTPEC is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_BCM is not set
+# CONFIG_ARCH_BERLIN is not set
+# CONFIG_ARCH_DIGICOLOR is not set
+# CONFIG_ARCH_HIGHBANK is not set
+# CONFIG_ARCH_HISI is not set
+CONFIG_ARCH_HISI_BVT=y
+
+#
+# Hisilicon BVT platform type
+#
+CONFIG_HI_ZRELADDR=0x80008000
+CONFIG_HI_PARAMS_PHYS=0x00000100
+CONFIG_HI_INITRD_PHYS=0x00800000
+CONFIG_ARCH_HI3516A=y
+# CONFIG_ARCH_HI3536DV100 is not set
+# CONFIG_ARCH_KEYSTONE is not set
+# CONFIG_ARCH_MESON is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_MEDIATEK is not set
+
+#
+# TI OMAP/AM/DM/DRA Family
+#
+# CONFIG_ARCH_OMAP3 is not set
+# CONFIG_ARCH_OMAP4 is not set
+# CONFIG_SOC_OMAP5 is not set
+# CONFIG_SOC_AM33XX is not set
+# CONFIG_SOC_AM43XX is not set
+# CONFIG_SOC_DRA7XX is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_QCOM is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_ROCKCHIP is not set
+# CONFIG_ARCH_SOCFPGA is not set
+# CONFIG_PLAT_SPEAR is not set
+# CONFIG_ARCH_STI is not set
+# CONFIG_ARCH_S5PV210 is not set
+# CONFIG_ARCH_EXYNOS is not set
+# CONFIG_ARCH_RENESAS is not set
+# CONFIG_ARCH_SUNXI is not set
+# CONFIG_ARCH_SIRF is not set
+# CONFIG_ARCH_TANGO is not set
+# CONFIG_ARCH_TEGRA is not set
+# CONFIG_ARCH_UNIPHIER is not set
+# CONFIG_ARCH_U8500 is not set
+# CONFIG_ARCH_VEXPRESS is not set
+# CONFIG_ARCH_WM8850 is not set
+# CONFIG_ARCH_ZX is not set
+# CONFIG_ARCH_ZYNQ is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_V7=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_PABRT_V7=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+# CONFIG_ARM_LPAE is not set
+# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
+CONFIG_ARM_THUMB=y
+# CONFIG_ARM_THUMBEE is not set
+CONFIG_ARM_VIRT_EXT=y
+# CONFIG_SWP_EMULATE is not set
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_KUSER_HELPERS=y
+CONFIG_VDSO=y
+CONFIG_MIGHT_HAVE_CACHE_L2X0=y
+# CONFIG_CACHE_L2X0 is not set
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
+CONFIG_ARM_L1_CACHE_SHIFT=6
+CONFIG_ARM_DMA_MEM_BUFFERABLE=y
+# CONFIG_DEBUG_RODATA is not set
+CONFIG_MULTI_IRQ_HANDLER=y
+# CONFIG_ARM_ERRATA_430973 is not set
+# CONFIG_ARM_ERRATA_720789 is not set
+# CONFIG_ARM_ERRATA_754322 is not set
+# CONFIG_ARM_ERRATA_775420 is not set
+# CONFIG_ARM_ERRATA_773022 is not set
+# CONFIG_ARM_ERRATA_818325_852422 is not set
+# CONFIG_ARM_ERRATA_821420 is not set
+# CONFIG_ARM_ERRATA_825619 is not set
+# CONFIG_ARM_ERRATA_852421 is not set
+# CONFIG_ARM_ERRATA_852423 is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI is not set
+# CONFIG_PCI_DOMAINS_GENERIC is not set
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_HAVE_SMP=y
+# CONFIG_SMP is not set
+CONFIG_HAVE_ARM_ARCH_TIMER=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_3G_OPT is not set
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_ARM_PSCI is not set
+CONFIG_ARCH_NR_GPIO=0
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_HZ_FIXED=0
+CONFIG_HZ_100=y
+# CONFIG_HZ_200 is not set
+# CONFIG_HZ_250 is not set
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_500 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=100
+# CONFIG_SCHED_HRTICK is not set
+# CONFIG_THUMB2_KERNEL is not set
+CONFIG_ARM_PATCH_IDIV=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+CONFIG_HAVE_ARCH_PFN_VALID=y
+# CONFIG_HIGHMEM is not set
+# CONFIG_CPU_SW_DOMAIN_PAN is not set
+CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
+# CONFIG_ARM_MODULE_PLTS is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_NO_BOOTMEM=y
+# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_COMPACTION=y
+CONFIG_MIGRATION=y
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+# CONFIG_KSM is not set
+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
+CONFIG_NEED_PER_CPU_KM=y
+# CONFIG_CLEANCACHE is not set
+# CONFIG_FRONTSWAP is not set
+# CONFIG_CMA is not set
+# CONFIG_ZPOOL is not set
+# CONFIG_ZBUD is not set
+# CONFIG_ZSMALLOC is not set
+CONFIG_GENERIC_EARLY_IOREMAP=y
+# CONFIG_IDLE_PAGE_TRACKING is not set
+CONFIG_FORCE_MAX_ZONEORDER=11
+CONFIG_ALIGNMENT_TRAP=y
+# CONFIG_UACCESS_WITH_MEMCPY is not set
+# CONFIG_SECCOMP is not set
+CONFIG_SWIOTLB=y
+CONFIG_IOMMU_HELPER=y
+# CONFIG_PARAVIRT is not set
+# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
+# CONFIG_XEN is not set
+
+#
+# Boot options
+#
+CONFIG_USE_OF=y
+CONFIG_ATAGS=y
+# CONFIG_DEPRECATED_PARAM_STRUCT is not set
+CONFIG_ZBOOT_ROM_TEXT=0
+CONFIG_ZBOOT_ROM_BSS=0
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_ARM_ATAG_DTB_COMPAT=y
+CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y
+# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set
+CONFIG_CMDLINE=""
+# CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
+CONFIG_AUTO_ZRELADDR=y
+# CONFIG_EFI is not set
+
+#
+# CPU Power Management
+#
+
+#
+# CPU Frequency scaling
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_GOV_ATTR_SET=y
+CONFIG_CPU_FREQ_GOV_COMMON=y
+CONFIG_CPU_FREQ_STAT=y
+# CONFIG_CPU_FREQ_STAT_DETAILS is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+
+#
+# CPU frequency scaling drivers
+#
+CONFIG_CPUFREQ_DT=y
+CONFIG_CPUFREQ_DT_PLATDEV=y
+# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set
+# CONFIG_QORIQ_CPUFREQ is not set
+
+#
+# CPU Idle
+#
+# CONFIG_CPU_IDLE is not set
+# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+# CONFIG_KERNEL_MODE_NEON is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_ELFCORE=y
+CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
+CONFIG_BINFMT_SCRIPT=y
+# CONFIG_BINFMT_FLAT is not set
+# CONFIG_HAVE_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+CONFIG_COREDUMP=y
+
+#
+# Power management options
+#
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+CONFIG_HIBERNATE_CALLBACKS=y
+CONFIG_HIBERNATION=y
+CONFIG_PM_STD_PARTITION=""
+CONFIG_PM_SLEEP=y
+# CONFIG_PM_AUTOSLEEP is not set
+# CONFIG_PM_WAKELOCKS is not set
+CONFIG_PM=y
+CONFIG_PM_DEBUG=y
+# CONFIG_PM_ADVANCED_DEBUG is not set
+CONFIG_PM_SLEEP_DEBUG=y
+# CONFIG_APM_EMULATION is not set
+CONFIG_PM_OPP=y
+CONFIG_PM_CLK=y
+# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
+CONFIG_CPU_PM=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARM_CPU_SUSPEND=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_DIAG is not set
+CONFIG_UNIX=y
+# CONFIG_UNIX_DIAG is not set
+CONFIG_XFRM=y
+CONFIG_XFRM_ALGO=y
+CONFIG_XFRM_USER=y
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+CONFIG_NET_KEY=y
+# CONFIG_NET_KEY_MIGRATE is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+# CONFIG_IP_FIB_TRIE_STATS is not set
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_VERBOSE=y
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE_DEMUX is not set
+# CONFIG_NET_IP_TUNNEL is not set
+CONFIG_IP_MROUTE=y
+# CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+CONFIG_SYN_COOKIES=y
+# CONFIG_NET_UDP_TUNNEL is not set
+# CONFIG_NET_FOU is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_INET_UDP_DIAG is not set
+# CONFIG_INET_DIAG_DESTROY is not set
+CONFIG_TCP_CONG_ADVANCED=y
+CONFIG_TCP_CONG_BIC=m
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+# CONFIG_TCP_CONG_HSTCP is not set
+# CONFIG_TCP_CONG_HYBLA is not set
+# CONFIG_TCP_CONG_VEGAS is not set
+# CONFIG_TCP_CONG_NV is not set
+# CONFIG_TCP_CONG_SCALABLE is not set
+# CONFIG_TCP_CONG_LP is not set
+# CONFIG_TCP_CONG_VENO is not set
+# CONFIG_TCP_CONG_YEAH is not set
+# CONFIG_TCP_CONG_ILLINOIS is not set
+# CONFIG_TCP_CONG_DCTCP is not set
+# CONFIG_TCP_CONG_CDG is not set
+# CONFIG_TCP_CONG_BBR is not set
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
+CONFIG_TCP_MD5SIG=y
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NET_PTP_CLASSIFY is not set
+# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_RDS is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_L2TP is not set
+# CONFIG_BRIDGE is not set
+CONFIG_HAVE_NET_DSA=y
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_PHONET is not set
+# CONFIG_IEEE802154 is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+CONFIG_DNS_RESOLVER=y
+# CONFIG_BATMAN_ADV is not set
+# CONFIG_OPENVSWITCH is not set
+# CONFIG_VSOCKETS is not set
+# CONFIG_NETLINK_DIAG is not set
+# CONFIG_MPLS is not set
+# CONFIG_HSR is not set
+# CONFIG_NET_SWITCHDEV is not set
+# CONFIG_NET_L3_MASTER_DEV is not set
+# CONFIG_NET_NCSI is not set
+# CONFIG_SOCK_CGROUP_DATA is not set
+# CONFIG_CGROUP_NET_PRIO is not set
+# CONFIG_CGROUP_NET_CLASSID is not set
+CONFIG_NET_RX_BUSY_POLL=y
+CONFIG_BQL=y
+# CONFIG_BPF_JIT is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_AF_KCM is not set
+# CONFIG_STREAM_PARSER is not set
+CONFIG_FIB_RULES=y
+CONFIG_WIRELESS=y
+CONFIG_WEXT_CORE=y
+CONFIG_WEXT_PROC=y
+CONFIG_CFG80211=m
+# CONFIG_NL80211_TESTMODE is not set
+# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
+CONFIG_CFG80211_DEFAULT_PS=y
+# CONFIG_CFG80211_INTERNAL_REGDB is not set
+CONFIG_CFG80211_CRDA_SUPPORT=y
+CONFIG_CFG80211_WEXT=y
+# CONFIG_LIB80211 is not set
+CONFIG_MAC80211=m
+CONFIG_MAC80211_HAS_RC=y
+CONFIG_MAC80211_RC_MINSTREL=y
+CONFIG_MAC80211_RC_MINSTREL_HT=y
+# CONFIG_MAC80211_RC_MINSTREL_VHT is not set
+CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
+CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
+CONFIG_MAC80211_MESH=y
+# CONFIG_MAC80211_MESSAGE_TRACING is not set
+# CONFIG_MAC80211_DEBUG_MENU is not set
+CONFIG_MAC80211_STA_HASH_MAX_SIZE=0
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_RFKILL_REGULATOR is not set
+# CONFIG_NET_9P is not set
+# CONFIG_CAIF is not set
+# CONFIG_CEPH_LIB is not set
+# CONFIG_NFC is not set
+# CONFIG_LWTUNNEL is not set
+# CONFIG_DST_CACHE is not set
+# CONFIG_NET_DEVLINK is not set
+CONFIG_MAY_USE_DEVLINK=y
+CONFIG_HAVE_CBPF_JIT=y
+
+#
+# Device Drivers
+#
+CONFIG_ARM_AMBA=y
+
+#
+# Generic Driver Options
+#
+# CONFIG_UEVENT_HELPER is not set
+CONFIG_DEVTMPFS=y
+# CONFIG_DEVTMPFS_MOUNT is not set
+CONFIG_STANDALONE=y
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
+CONFIG_ALLOW_DEV_COREDUMP=y
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_GENERIC_CPU_DEVICES is not set
+# CONFIG_DMA_SHARED_BUFFER is not set
+
+#
+# Bus devices
+#
+# CONFIG_BRCMSTB_GISB_ARB is not set
+# CONFIG_VEXPRESS_CONFIG is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_TESTS is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+CONFIG_MTD_OF_PARTS=y
+# CONFIG_MTD_AR7_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_SM_FTL is not set
+# CONFIG_MTD_OOPS is not set
+# CONFIG_MTD_SWAP is not set
+# CONFIG_MTD_PARTITIONED_MASTER is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 is not set
+# CONFIG_MTD_SST25L is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOCG3 is not set
+CONFIG_MTD_NAND_ECC=y
+# CONFIG_MTD_NAND_ECC_SMC is not set
+CONFIG_MTD_NAND=y
+# CONFIG_MTD_NAND_ECC_BCH is not set
+# CONFIG_MTD_SM_COMMON is not set
+# CONFIG_MTD_NAND_DENALI_DT is not set
+# CONFIG_MTD_NAND_GPIO is not set
+# CONFIG_MTD_NAND_OMAP_BCH_BUILD is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_DOCG4 is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_BRCMNAND is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_NAND_HISI504 is not set
+# CONFIG_MTD_NAND_MTK is not set
+# CONFIG_MTD_SPI_NAND_HISI_BVT is not set
+CONFIG_MTD_NAND_HINFC610=y
+CONFIG_HINFC610_MAX_CHIP=1
+CONFIG_HINFC610_DBG_NAND_DEBUG=y
+CONFIG_HINFC610_DBG_NAND_DUMP=y
+CONFIG_HINFC610_DBG_NAND_ERASE_COUNT=y
+CONFIG_HINFC610_DBG_NAND_ECC_COUNT=y
+CONFIG_HINFC610_DBG_NAND_READ_RETRY=y
+CONFIG_HINFC610_AUTO_PAGESIZE_ECC=y
+# CONFIG_HINFC610_PAGESIZE_AUTO_ECC_NONE is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR & LPDDR2 PCM memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+# CONFIG_MTD_LPDDR2_NVM is not set
+CONFIG_MTD_SPI_NOR=y
+# CONFIG_MTD_MT81xx_NOR is not set
+# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
+# CONFIG_SPI_CADENCE_QUADSPI is not set
+# CONFIG_SPI_HISI_SFC is not set
+CONFIG_MTD_SPI_IDS=y
+CONFIG_CLOSE_SPI_8PIN_4IO=y
+CONFIG_MTD_HISFC350=y
+CONFIG_HISFC350_SYSCTRL_ADDRESS=0x20030000
+CONFIG_HISFC350_CHIP_NUM=2
+# CONFIG_HISFC350_SHOW_CYCLE_TIMING is not set
+# CONFIG_HISFC350_ENABLE_CHIPSELECT_0 is not set
+CONFIG_HISFC350_ENABLE_CHIPSELECT_1=y
+# CONFIG_HISFC350_ENABLE_INTR_DMA is not set
+CONFIG_CMD_SPI_BLOCK_PROTECTION=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
+CONFIG_MTD_UBI_BEB_LIMIT=20
+# CONFIG_MTD_UBI_FASTMAP is not set
+# CONFIG_MTD_UBI_GLUEBI is not set
+# CONFIG_MTD_UBI_BLOCK is not set
+CONFIG_DTC=y
+CONFIG_OF=y
+# CONFIG_OF_UNITTEST is not set
+CONFIG_OF_FLATTREE=y
+CONFIG_OF_EARLY_FLATTREE=y
+CONFIG_OF_ADDRESS=y
+CONFIG_OF_IRQ=y
+CONFIG_OF_NET=y
+CONFIG_OF_MDIO=y
+CONFIG_OF_RESERVED_MEM=y
+# CONFIG_OF_OVERLAY is not set
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_NULL_BLK is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_DRBD is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=65536
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_MG_DISK is not set
+# CONFIG_BLK_DEV_RBD is not set
+# CONFIG_NVME_TARGET is not set
+
+#
+# Misc devices
+#
+# CONFIG_SENSORS_LIS3LV02D is not set
+# CONFIG_AD525X_DPOT is not set
+# CONFIG_DUMMY_IRQ is not set
+# CONFIG_ICS932S401 is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_APDS9802ALS is not set
+# CONFIG_ISL29003 is not set
+# CONFIG_ISL29020 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_SENSORS_BH1770 is not set
+# CONFIG_SENSORS_APDS990X is not set
+# CONFIG_HMC6352 is not set
+# CONFIG_DS1682 is not set
+# CONFIG_TI_DAC7512 is not set
+# CONFIG_USB_SWITCH_FSA9480 is not set
+# CONFIG_LATTICE_ECP3_CONFIG is not set
+# CONFIG_SRAM is not set
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_AT25 is not set
+# CONFIG_EEPROM_LEGACY is not set
+# CONFIG_EEPROM_MAX6875 is not set
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_EEPROM_93XX46 is not set
+
+#
+# Texas Instruments shared transport line discipline
+#
+# CONFIG_TI_ST is not set
+# CONFIG_SENSORS_LIS3_SPI is not set
+# CONFIG_SENSORS_LIS3_I2C is not set
+
+#
+# Altera FPGA firmware download module
+#
+# CONFIG_ALTERA_STAPL is not set
+
+#
+# Intel MIC Bus Driver
+#
+
+#
+# SCIF Bus Driver
+#
+
+#
+# VOP Bus Driver
+#
+
+#
+# Intel MIC Host Driver
+#
+
+#
+# Intel MIC Card Driver
+#
+
+#
+# SCIF Driver
+#
+
+#
+# Intel MIC Coprocessor State Management (COSM) Drivers
+#
+
+#
+# VOP Driver
+#
+# CONFIG_ECHO is not set
+# CONFIG_CXL_BASE is not set
+# CONFIG_CXL_AFU_DRIVER_OPS is not set
+
+#
+# SCSI device support
+#
+CONFIG_SCSI_MOD=y
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+CONFIG_SCSI_NETLINK=y
+# CONFIG_SCSI_MQ_DEFAULT is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+CONFIG_SCSI_FC_ATTRS=y
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_ISCSI_BOOT_SYSFS is not set
+# CONFIG_SCSI_UFSHCD is not set
+# CONFIG_LIBFC is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_SCSI_OSD_INITIATOR is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+# CONFIG_TARGET_CORE is not set
+CONFIG_NETDEVICES=y
+CONFIG_NET_CORE=y
+# CONFIG_BONDING is not set
+# CONFIG_DUMMY is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_NET_TEAM is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_VXLAN is not set
+# CONFIG_MACSEC is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_TUN is not set
+# CONFIG_TUN_VNET_CROSS_LE is not set
+# CONFIG_VETH is not set
+# CONFIG_NLMON is not set
+
+#
+# CAIF transport drivers
+#
+
+#
+# Distributed Switch Architecture drivers
+#
+CONFIG_ETHERNET=y
+# CONFIG_ALTERA_TSE is not set
+# CONFIG_NET_VENDOR_AMAZON is not set
+# CONFIG_NET_VENDOR_ARC is not set
+# CONFIG_NET_VENDOR_AURORA is not set
+# CONFIG_NET_CADENCE is not set
+# CONFIG_NET_VENDOR_BROADCOM is not set
+# CONFIG_NET_VENDOR_CIRRUS is not set
+# CONFIG_DM9000 is not set
+# CONFIG_DNET is not set
+# CONFIG_NET_VENDOR_EZCHIP is not set
+# CONFIG_NET_VENDOR_FARADAY is not set
+CONFIG_NET_VENDOR_HISILICON=y
+# CONFIG_HIX5HD2_GMAC is not set
+# CONFIG_HISI_FEMAC is not set
+# CONFIG_HIP04_ETH is not set
+# CONFIG_HNS is not set
+# CONFIG_HNS_DSAF is not set
+# CONFIG_HNS_ENET is not set
+CONFIG_HIETH_GMAC=y
+# CONFIG_HIGMAC_DESC_4WORD is not set
+# CONFIG_HIGMAC_RXCSUM is not set
+CONFIG_RX_FLOW_CTRL_SUPPORT=y
+CONFIG_TX_FLOW_CTRL_SUPPORT=y
+CONFIG_TX_FLOW_CTRL_PAUSE_TIME=0xFFFF
+CONFIG_TX_FLOW_CTRL_PAUSE_INTERVAL=0xFFFF
+CONFIG_TX_FLOW_CTRL_ACTIVE_THRESHOLD=16
+CONFIG_TX_FLOW_CTRL_DEACTIVE_THRESHOLD=32
+# CONFIG_NET_VENDOR_INTEL is not set
+# CONFIG_NET_VENDOR_MARVELL is not set
+# CONFIG_NET_VENDOR_MICREL is not set
+# CONFIG_NET_VENDOR_MICROCHIP is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+# CONFIG_NET_VENDOR_NETRONOME is not set
+# CONFIG_ETHOC is not set
+# CONFIG_NET_VENDOR_QUALCOMM is not set
+# CONFIG_NET_VENDOR_RENESAS is not set
+# CONFIG_NET_VENDOR_ROCKER is not set
+# CONFIG_NET_VENDOR_SAMSUNG is not set
+# CONFIG_NET_VENDOR_SEEQ is not set
+# CONFIG_NET_VENDOR_SMSC is not set
+# CONFIG_NET_VENDOR_STMICRO is not set
+# CONFIG_NET_VENDOR_SYNOPSYS is not set
+# CONFIG_NET_VENDOR_VIA is not set
+# CONFIG_NET_VENDOR_WIZNET is not set
+CONFIG_PHYLIB=y
+CONFIG_SWPHY=y
+
+#
+# MDIO bus device drivers
+#
+# CONFIG_MDIO_BCM_UNIMAC is not set
+# CONFIG_MDIO_BITBANG is not set
+# CONFIG_MDIO_BUS_MUX_GPIO is not set
+# CONFIG_MDIO_BUS_MUX_MMIOREG is not set
+# CONFIG_MDIO_HISI_FEMAC is not set
+CONFIG_MDIO_HISI_GEMAC=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_AMD_PHY is not set
+# CONFIG_AQUANTIA_PHY is not set
+# CONFIG_AT803X_PHY is not set
+# CONFIG_BCM7XXX_PHY is not set
+# CONFIG_BCM87XX_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_DP83848_PHY is not set
+# CONFIG_DP83867_PHY is not set
+CONFIG_FIXED_PHY=y
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_INTEL_XWAY_PHY is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_MICREL_PHY is not set
+# CONFIG_MICROCHIP_PHY is not set
+# CONFIG_MICROSEMI_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_TERANETICS_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_XILINX_GMII2RGMII is not set
+# CONFIG_MICREL_KS8995MA is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+CONFIG_USB_NET_DRIVERS=y
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_RTL8152 is not set
+# CONFIG_USB_LAN78XX is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_USB_IPHETH is not set
+# CONFIG_WLAN is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+# CONFIG_WAN is not set
+# CONFIG_ISDN is not set
+# CONFIG_NVM is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+# CONFIG_INPUT_SPARSEKMAP is not set
+# CONFIG_INPUT_MATRIXKMAP is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ADP5588 is not set
+# CONFIG_KEYBOARD_ADP5589 is not set
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_QT1070 is not set
+# CONFIG_KEYBOARD_QT2160 is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_GPIO is not set
+# CONFIG_KEYBOARD_GPIO_POLLED is not set
+# CONFIG_KEYBOARD_TCA6416 is not set
+# CONFIG_KEYBOARD_TCA8418 is not set
+# CONFIG_KEYBOARD_MATRIX is not set
+# CONFIG_KEYBOARD_LM8333 is not set
+# CONFIG_KEYBOARD_MAX7359 is not set
+# CONFIG_KEYBOARD_MCS is not set
+# CONFIG_KEYBOARD_MPR121 is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_OPENCORES is not set
+# CONFIG_KEYBOARD_SAMSUNG is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_OMAP4 is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_CAP11XX is not set
+# CONFIG_KEYBOARD_BCM is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_BYD=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_CYPRESS=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_SENTELIC is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+CONFIG_MOUSE_PS2_FOCALTECH=y
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 is not set
+# CONFIG_MOUSE_CYAPA is not set
+# CONFIG_MOUSE_ELAN_I2C is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_MOUSE_GPIO is not set
+# CONFIG_MOUSE_SYNAPTICS_I2C is not set
+# CONFIG_MOUSE_SYNAPTICS_USB is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_AD714X is not set
+# CONFIG_INPUT_ATMEL_CAPTOUCH is not set
+# CONFIG_INPUT_BMA150 is not set
+# CONFIG_INPUT_E3X0_BUTTON is not set
+# CONFIG_INPUT_MMA8450 is not set
+# CONFIG_INPUT_MPU3050 is not set
+# CONFIG_INPUT_GP2A is not set
+# CONFIG_INPUT_GPIO_BEEPER is not set
+# CONFIG_INPUT_GPIO_TILT_POLLED is not set
+# CONFIG_INPUT_GPIO_DECODER is not set
+# CONFIG_INPUT_ATI_REMOTE2 is not set
+# CONFIG_INPUT_KEYSPAN_REMOTE is not set
+# CONFIG_INPUT_KXTJ9 is not set
+# CONFIG_INPUT_POWERMATE is not set
+# CONFIG_INPUT_YEALINK is not set
+# CONFIG_INPUT_CM109 is not set
+# CONFIG_INPUT_REGULATOR_HAPTIC is not set
+CONFIG_INPUT_UINPUT=y
+# CONFIG_INPUT_PCF8574 is not set
+# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
+# CONFIG_INPUT_ADXL34X is not set
+# CONFIG_INPUT_CMA3000 is not set
+# CONFIG_INPUT_DRV260X_HAPTICS is not set
+# CONFIG_INPUT_DRV2665_HAPTICS is not set
+# CONFIG_INPUT_DRV2667_HAPTICS is not set
+# CONFIG_RMI4_CORE is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_AMBAKMI is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_SERIO_ALTERA_PS2 is not set
+# CONFIG_SERIO_PS2MULT is not set
+# CONFIG_SERIO_ARC_PS2 is not set
+# CONFIG_SERIO_APBPS2 is not set
+# CONFIG_USERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_TTY=y
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_VT_CONSOLE_SLEEP=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_N_GSM is not set
+# CONFIG_TRACE_SINK is not set
+CONFIG_DEVMEM=y
+# CONFIG_DEVKMEM is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_EARLYCON=y
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_AMBA_PL010 is not set
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+# CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST is not set
+# CONFIG_SERIAL_MAX3100 is not set
+# CONFIG_SERIAL_MAX310X is not set
+# CONFIG_SERIAL_UARTLITE is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_SCCNXP is not set
+# CONFIG_SERIAL_SC16IS7XX is not set
+# CONFIG_SERIAL_BCM63XX is not set
+# CONFIG_SERIAL_ALTERA_JTAGUART is not set
+# CONFIG_SERIAL_ALTERA_UART is not set
+# CONFIG_SERIAL_IFX6X60 is not set
+# CONFIG_SERIAL_XILINX_PS_UART is not set
+# CONFIG_SERIAL_ARC is not set
+# CONFIG_SERIAL_FSL_LPUART is not set
+# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set
+# CONFIG_SERIAL_ST_ASC is not set
+# CONFIG_SERIAL_STM32 is not set
+# CONFIG_HVC_DCC is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_XILLYBUS is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_COMPAT=y
+CONFIG_I2C_CHARDEV=y
+# CONFIG_I2C_MUX is not set
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_CBUS_GPIO is not set
+# CONFIG_I2C_DESIGNWARE_PLATFORM is not set
+# CONFIG_I2C_EMEV2 is not set
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_HIBVT is not set
+# CONFIG_I2C_NOMADIK is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_PXA_PCI is not set
+# CONFIG_I2C_RK3X is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_XILINX is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_DIOLAN_U2C is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_ROBOTFUZZ_OSIF is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+CONFIG_I2C_HISI=y
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_SLAVE is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_ALTERA is not set
+# CONFIG_SPI_AXI_SPI_ENGINE is not set
+# CONFIG_SPI_BITBANG is not set
+# CONFIG_SPI_CADENCE is not set
+# CONFIG_SPI_DESIGNWARE is not set
+# CONFIG_SPI_GPIO is not set
+# CONFIG_SPI_FSL_SPI is not set
+# CONFIG_SPI_OC_TINY is not set
+CONFIG_SPI_PL022=y
+# CONFIG_SPI_PXA2XX_PCI is not set
+# CONFIG_SPI_ROCKCHIP is not set
+# CONFIG_SPI_SC18IS602 is not set
+# CONFIG_SPI_XCOMM is not set
+# CONFIG_SPI_XILINX is not set
+# CONFIG_SPI_ZYNQMP_GQSPI is not set
+
+#
+# SPI Protocol Masters
+#
+CONFIG_SPI_SPIDEV=y
+# CONFIG_SPI_LOOPBACK_TEST is not set
+# CONFIG_SPI_TLE62X0 is not set
+# CONFIG_SPMI is not set
+# CONFIG_HSI is not set
+
+#
+# PPS support
+#
+# CONFIG_PPS is not set
+
+#
+# PPS generators support
+#
+
+#
+# PTP clock support
+#
+# CONFIG_PTP_1588_CLOCK is not set
+
+#
+# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
+#
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+CONFIG_GPIOLIB=y
+CONFIG_OF_GPIO=y
+CONFIG_GPIOLIB_IRQCHIP=y
+# CONFIG_DEBUG_GPIO is not set
+CONFIG_GPIO_SYSFS=y
+
+#
+# Memory mapped GPIO drivers
+#
+# CONFIG_GPIO_74XX_MMIO is not set
+# CONFIG_GPIO_ALTERA is not set
+# CONFIG_GPIO_DWAPB is not set
+# CONFIG_GPIO_EM is not set
+# CONFIG_GPIO_GENERIC_PLATFORM is not set
+# CONFIG_GPIO_GRGPIO is not set
+# CONFIG_GPIO_MOCKUP is not set
+# CONFIG_GPIO_MPC8XXX is not set
+CONFIG_GPIO_PL061=y
+# CONFIG_GPIO_XILINX is not set
+# CONFIG_GPIO_ZEVIO is not set
+# CONFIG_GPIO_ZX is not set
+
+#
+# I2C GPIO expanders
+#
+# CONFIG_GPIO_ADP5588 is not set
+# CONFIG_GPIO_ADNP is not set
+# CONFIG_GPIO_MAX7300 is not set
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+# CONFIG_GPIO_SX150X is not set
+# CONFIG_GPIO_TPIC2810 is not set
+# CONFIG_GPIO_TS4900 is not set
+
+#
+# MFD GPIO expanders
+#
+# CONFIG_HTC_EGPIO is not set
+
+#
+# SPI GPIO expanders
+#
+# CONFIG_GPIO_74X164 is not set
+# CONFIG_GPIO_MAX7301 is not set
+# CONFIG_GPIO_MC33880 is not set
+# CONFIG_GPIO_PISOSR is not set
+
+#
+# SPI or I2C GPIO expanders
+#
+# CONFIG_GPIO_MCP23S08 is not set
+
+#
+# USB GPIO expanders
+#
+# CONFIG_W1 is not set
+# CONFIG_POWER_AVS is not set
+CONFIG_POWER_RESET=y
+# CONFIG_POWER_RESET_BRCMKONA is not set
+# CONFIG_POWER_RESET_GPIO is not set
+# CONFIG_POWER_RESET_GPIO_RESTART is not set
+CONFIG_POWER_RESET_HISI=y
+# CONFIG_POWER_RESET_LTC2952 is not set
+# CONFIG_POWER_RESET_RESTART is not set
+# CONFIG_POWER_RESET_SYSCON is not set
+# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set
+CONFIG_POWER_SUPPLY=y
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+# CONFIG_TEST_POWER is not set
+# CONFIG_BATTERY_DS2780 is not set
+# CONFIG_BATTERY_DS2781 is not set
+# CONFIG_BATTERY_DS2782 is not set
+# CONFIG_BATTERY_SBS is not set
+# CONFIG_BATTERY_BQ27XXX is not set
+# CONFIG_BATTERY_MAX17040 is not set
+# CONFIG_BATTERY_MAX17042 is not set
+# CONFIG_CHARGER_MAX8903 is not set
+# CONFIG_CHARGER_LP8727 is not set
+# CONFIG_CHARGER_GPIO is not set
+# CONFIG_CHARGER_MANAGER is not set
+# CONFIG_CHARGER_BQ2415X is not set
+# CONFIG_CHARGER_BQ24190 is not set
+# CONFIG_CHARGER_BQ24735 is not set
+# CONFIG_CHARGER_BQ25890 is not set
+# CONFIG_CHARGER_SMB347 is not set
+# CONFIG_BATTERY_GAUGE_LTC2941 is not set
+# CONFIG_CHARGER_RT9455 is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+CONFIG_BCMA_POSSIBLE=y
+
+#
+# Broadcom specific AMBA
+#
+# CONFIG_BCMA is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_ACT8945A is not set
+# CONFIG_MFD_AS3711 is not set
+# CONFIG_MFD_AS3722 is not set
+# CONFIG_PMIC_ADP5520 is not set
+# CONFIG_MFD_AAT2870_CORE is not set
+# CONFIG_MFD_ATMEL_FLEXCOM is not set
+# CONFIG_MFD_ATMEL_HLCDC is not set
+# CONFIG_MFD_BCM590XX is not set
+# CONFIG_MFD_AXP20X_I2C is not set
+# CONFIG_MFD_CROS_EC is not set
+# CONFIG_MFD_ASIC3 is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_DA9052_SPI is not set
+# CONFIG_MFD_DA9052_I2C is not set
+# CONFIG_MFD_DA9055 is not set
+# CONFIG_MFD_DA9062 is not set
+# CONFIG_MFD_DA9063 is not set
+# CONFIG_MFD_DA9150 is not set
+# CONFIG_MFD_DLN2 is not set
+# CONFIG_MFD_EXYNOS_LPASS is not set
+# CONFIG_MFD_MC13XXX_SPI is not set
+# CONFIG_MFD_MC13XXX_I2C is not set
+# CONFIG_MFD_HI6421_PMIC is not set
+# CONFIG_MFD_HISI_FMC is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_HTC_I2CPLD is not set
+# CONFIG_INTEL_SOC_PMIC is not set
+# CONFIG_MFD_KEMPLD is not set
+# CONFIG_MFD_88PM800 is not set
+# CONFIG_MFD_88PM805 is not set
+# CONFIG_MFD_88PM860X is not set
+# CONFIG_MFD_MAX14577 is not set
+# CONFIG_MFD_MAX77620 is not set
+# CONFIG_MFD_MAX77686 is not set
+# CONFIG_MFD_MAX77693 is not set
+# CONFIG_MFD_MAX77843 is not set
+# CONFIG_MFD_MAX8907 is not set
+# CONFIG_MFD_MAX8925 is not set
+# CONFIG_MFD_MAX8997 is not set
+# CONFIG_MFD_MAX8998 is not set
+# CONFIG_MFD_MT6397 is not set
+# CONFIG_MFD_MENF21BMC is not set
+# CONFIG_EZX_PCAP is not set
+# CONFIG_MFD_VIPERBOARD is not set
+# CONFIG_MFD_RETU is not set
+# CONFIG_MFD_PCF50633 is not set
+# CONFIG_MFD_PM8921_CORE is not set
+# CONFIG_MFD_RT5033 is not set
+# CONFIG_MFD_RTSX_USB is not set
+# CONFIG_MFD_RC5T583 is not set
+# CONFIG_MFD_RK808 is not set
+# CONFIG_MFD_RN5T618 is not set
+# CONFIG_MFD_SEC_CORE is not set
+# CONFIG_MFD_SI476X_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_SKY81452 is not set
+# CONFIG_MFD_SMSC is not set
+# CONFIG_ABX500_CORE is not set
+# CONFIG_MFD_STMPE is not set
+# CONFIG_MFD_SYSCON is not set
+# CONFIG_MFD_TI_AM335X_TSCADC is not set
+# CONFIG_MFD_LP3943 is not set
+# CONFIG_MFD_LP8788 is not set
+# CONFIG_MFD_PALMAS is not set
+# CONFIG_TPS6105X is not set
+# CONFIG_TPS65010 is not set
+# CONFIG_TPS6507X is not set
+# CONFIG_MFD_TPS65086 is not set
+# CONFIG_MFD_TPS65090 is not set
+# CONFIG_MFD_TPS65217 is not set
+# CONFIG_MFD_TI_LP873X is not set
+# CONFIG_MFD_TPS65218 is not set
+# CONFIG_MFD_TPS6586X is not set
+# CONFIG_MFD_TPS65910 is not set
+# CONFIG_MFD_TPS65912_I2C is not set
+# CONFIG_MFD_TPS65912_SPI is not set
+# CONFIG_MFD_TPS80031 is not set
+# CONFIG_TWL4030_CORE is not set
+# CONFIG_TWL6040_CORE is not set
+# CONFIG_MFD_WL1273_CORE is not set
+# CONFIG_MFD_LM3533 is not set
+# CONFIG_MFD_TC3589X is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_MFD_ARIZONA_I2C is not set
+# CONFIG_MFD_ARIZONA_SPI is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM831X_I2C is not set
+# CONFIG_MFD_WM831X_SPI is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_WM8994 is not set
+CONFIG_REGULATOR=y
+# CONFIG_REGULATOR_DEBUG is not set
+# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
+# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
+# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
+# CONFIG_REGULATOR_ACT8865 is not set
+# CONFIG_REGULATOR_AD5398 is not set
+# CONFIG_REGULATOR_DA9210 is not set
+# CONFIG_REGULATOR_DA9211 is not set
+# CONFIG_REGULATOR_FAN53555 is not set
+# CONFIG_REGULATOR_GPIO is not set
+# CONFIG_REGULATOR_ISL9305 is not set
+# CONFIG_REGULATOR_ISL6271A is not set
+# CONFIG_REGULATOR_LP3971 is not set
+# CONFIG_REGULATOR_LP3972 is not set
+# CONFIG_REGULATOR_LP872X is not set
+# CONFIG_REGULATOR_LP8755 is not set
+# CONFIG_REGULATOR_LTC3589 is not set
+# CONFIG_REGULATOR_LTC3676 is not set
+# CONFIG_REGULATOR_MAX1586 is not set
+# CONFIG_REGULATOR_MAX8649 is not set
+# CONFIG_REGULATOR_MAX8660 is not set
+# CONFIG_REGULATOR_MAX8952 is not set
+# CONFIG_REGULATOR_MT6311 is not set
+# CONFIG_REGULATOR_PFUZE100 is not set
+# CONFIG_REGULATOR_PV88060 is not set
+# CONFIG_REGULATOR_PV88080 is not set
+# CONFIG_REGULATOR_PV88090 is not set
+# CONFIG_REGULATOR_TPS51632 is not set
+# CONFIG_REGULATOR_TPS62360 is not set
+# CONFIG_REGULATOR_TPS65023 is not set
+# CONFIG_REGULATOR_TPS6507X is not set
+# CONFIG_REGULATOR_TPS6524X is not set
+# CONFIG_MEDIA_SUPPORT is not set
+
+#
+# Graphics support
+#
+# CONFIG_IMX_IPUV3_CORE is not set
+# CONFIG_DRM is not set
+
+#
+# ACP (Audio CoProcessor) Configuration
+#
+
+#
+# Frame buffer Devices
+#
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+CONFIG_FB_CMDLINE=y
+CONFIG_FB_NOTIFY=y
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+# CONFIG_FB_CFB_FILLRECT is not set
+# CONFIG_FB_CFB_COPYAREA is not set
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_ARMCLCD is not set
+# CONFIG_FB_OPENCORES is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_SMSCUFX is not set
+# CONFIG_FB_UDL is not set
+# CONFIG_FB_IBM_GXT4500 is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_BROADSHEET is not set
+# CONFIG_FB_AUO_K190X is not set
+# CONFIG_FB_SIMPLE is not set
+# CONFIG_FB_SSD1307 is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+# CONFIG_VGASTATE is not set
+
+#
+# Console display driver support
+#
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE is not set
+# CONFIG_LOGO is not set
+# CONFIG_SOUND is not set
+
+#
+# HID support
+#
+CONFIG_HID=y
+# CONFIG_HID_BATTERY_STRENGTH is not set
+# CONFIG_HIDRAW is not set
+# CONFIG_UHID is not set
+CONFIG_HID_GENERIC=y
+
+#
+# Special HID drivers
+#
+# CONFIG_HID_A4TECH is not set
+# CONFIG_HID_ACRUX is not set
+# CONFIG_HID_APPLE is not set
+# CONFIG_HID_APPLEIR is not set
+# CONFIG_HID_AUREAL is not set
+# CONFIG_HID_BELKIN is not set
+# CONFIG_HID_BETOP_FF is not set
+# CONFIG_HID_CHERRY is not set
+# CONFIG_HID_CHICONY is not set
+# CONFIG_HID_CMEDIA is not set
+# CONFIG_HID_CP2112 is not set
+# CONFIG_HID_CYPRESS is not set
+# CONFIG_HID_DRAGONRISE is not set
+# CONFIG_HID_EMS_FF is not set
+# CONFIG_HID_ELECOM is not set
+# CONFIG_HID_ELO is not set
+# CONFIG_HID_EZKEY is not set
+# CONFIG_HID_GEMBIRD is not set
+# CONFIG_HID_GFRM is not set
+# CONFIG_HID_HOLTEK is not set
+# CONFIG_HID_KEYTOUCH is not set
+# CONFIG_HID_KYE is not set
+# CONFIG_HID_UCLOGIC is not set
+# CONFIG_HID_WALTOP is not set
+# CONFIG_HID_GYRATION is not set
+# CONFIG_HID_ICADE is not set
+# CONFIG_HID_TWINHAN is not set
+# CONFIG_HID_KENSINGTON is not set
+# CONFIG_HID_LCPOWER is not set
+# CONFIG_HID_LENOVO is not set
+# CONFIG_HID_LOGITECH is not set
+# CONFIG_HID_MAGICMOUSE is not set
+CONFIG_HID_MICROSOFT=y
+# CONFIG_HID_MONTEREY is not set
+# CONFIG_HID_MULTITOUCH is not set
+# CONFIG_HID_NTRIG is not set
+# CONFIG_HID_ORTEK is not set
+# CONFIG_HID_PANTHERLORD is not set
+# CONFIG_HID_PENMOUNT is not set
+# CONFIG_HID_PETALYNX is not set
+# CONFIG_HID_PICOLCD is not set
+# CONFIG_HID_PLANTRONICS is not set
+# CONFIG_HID_PRIMAX is not set
+# CONFIG_HID_ROCCAT is not set
+# CONFIG_HID_SAITEK is not set
+# CONFIG_HID_SAMSUNG is not set
+# CONFIG_HID_SPEEDLINK is not set
+# CONFIG_HID_STEELSERIES is not set
+# CONFIG_HID_SUNPLUS is not set
+# CONFIG_HID_RMI is not set
+# CONFIG_HID_GREENASIA is not set
+# CONFIG_HID_SMARTJOYPLUS is not set
+# CONFIG_HID_TIVO is not set
+# CONFIG_HID_TOPSEED is not set
+# CONFIG_HID_THRUSTMASTER is not set
+# CONFIG_HID_WACOM is not set
+# CONFIG_HID_XINMO is not set
+# CONFIG_HID_ZEROPLUS is not set
+# CONFIG_HID_ZYDACRON is not set
+# CONFIG_HID_SENSOR_HUB is not set
+# CONFIG_HID_ALPS is not set
+
+#
+# USB HID support
+#
+CONFIG_USB_HID=y
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# I2C HID support
+#
+# CONFIG_I2C_HID is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_COMMON=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB=y
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEFAULT_PERSIST=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_MON is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_XHCI_HCD is not set
+CONFIG_USB_EHCI_HCD=y
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+CONFIG_USB_EHCI_TT_NEWSCHED=y
+CONFIG_USB_EHCI_HCD_PLATFORM=y
+# CONFIG_USB_OXU210HP_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1362_HCD is not set
+# CONFIG_USB_FOTG210_HCD is not set
+# CONFIG_USB_MAX3421_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PLATFORM=y
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HCD_TEST_MODE is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+# CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
+#
+
+#
+# also be needed; see USB_STORAGE Help for more info
+#
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_REALTEK is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_STORAGE_ENE_UB6250 is not set
+# CONFIG_USB_UAS is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USBIP_CORE is not set
+# CONFIG_USB_MUSB_HDRC is not set
+# CONFIG_USB_DWC3 is not set
+# CONFIG_USB_DWC2 is not set
+# CONFIG_USB_CHIPIDEA is not set
+# CONFIG_USB_ISP1760 is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_SISUSBVGA is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_TEST is not set
+# CONFIG_USB_EHSET_TEST_FIXTURE is not set
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_YUREX is not set
+# CONFIG_USB_EZUSB_FX2 is not set
+# CONFIG_USB_HSIC_USB3503 is not set
+# CONFIG_USB_HSIC_USB4604 is not set
+# CONFIG_USB_LINK_LAYER_TEST is not set
+
+#
+# USB Physical Layer drivers
+#
+# CONFIG_USB_PHY is not set
+# CONFIG_NOP_USB_XCEIV is not set
+# CONFIG_USB_GPIO_VBUS is not set
+# CONFIG_USB_ISP1301 is not set
+# CONFIG_USB_ULPI is not set
+# CONFIG_USB_GADGET is not set
+# CONFIG_USB_ULPI_BUS is not set
+# CONFIG_UWB is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+CONFIG_PWRSEQ_EMMC=y
+CONFIG_PWRSEQ_SIMPLE=y
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_MINORS=8
+CONFIG_MMC_BLOCK_BOUNCE=y
+# CONFIG_SDIO_UART is not set
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+# CONFIG_MMC_ARMMMCI is not set
+# CONFIG_MMC_SDHCI is not set
+# CONFIG_MMC_SPI is not set
+# CONFIG_MMC_DW is not set
+# CONFIG_MMC_VUB300 is not set
+# CONFIG_MMC_USHC is not set
+# CONFIG_MMC_USDHI6ROL0 is not set
+# CONFIG_MMC_MTK is not set
+CONFIG_HIMCI=y
+CONFIG_SEND_AUTO_STOP=y
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
+CONFIG_EDAC_ATOMIC_SCRUB=y
+CONFIG_EDAC_SUPPORT=y
+# CONFIG_EDAC is not set
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+# CONFIG_DMADEVICES is not set
+
+#
+# DMABUF options
+#
+# CONFIG_SYNC_FILE is not set
+# CONFIG_AUXDISPLAY is not set
+# CONFIG_UIO is not set
+# CONFIG_VIRT_DRIVERS is not set
+
+#
+# Virtio drivers
+#
+# CONFIG_VIRTIO_MMIO is not set
+
+#
+# Microsoft Hyper-V guest support
+#
+# CONFIG_STAGING is not set
+# CONFIG_GOLDFISH is not set
+# CONFIG_CHROME_PLATFORMS is not set
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_HAVE_CLK_PREPARE=y
+CONFIG_COMMON_CLK=y
+
+#
+# Common Clock Framework
+#
+# CONFIG_COMMON_CLK_SI5351 is not set
+# CONFIG_COMMON_CLK_SI514 is not set
+# CONFIG_COMMON_CLK_SI570 is not set
+# CONFIG_COMMON_CLK_CDCE706 is not set
+# CONFIG_COMMON_CLK_CDCE925 is not set
+# CONFIG_COMMON_CLK_CS2000_CP is not set
+# CONFIG_CLK_QORIQ is not set
+# CONFIG_COMMON_CLK_NXP is not set
+# CONFIG_COMMON_CLK_PXA is not set
+# CONFIG_COMMON_CLK_PIC32 is not set
+CONFIG_COMMON_CLK_HI3516A=y
+CONFIG_RESET_HISI=y
+
+#
+# Hardware Spinlock drivers
+#
+
+#
+# Clock Source drivers
+#
+CONFIG_CLKSRC_OF=y
+CONFIG_CLKSRC_PROBE=y
+CONFIG_CLKSRC_MMIO=y
+CONFIG_ARM_ARCH_TIMER=y
+CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
+CONFIG_ARM_TIMER_SP804=y
+# CONFIG_ATMEL_PIT is not set
+# CONFIG_SH_TIMER_CMT is not set
+# CONFIG_SH_TIMER_MTU2 is not set
+# CONFIG_SH_TIMER_TMU is not set
+# CONFIG_EM_TIMER_STI is not set
+# CONFIG_MAILBOX is not set
+# CONFIG_IOMMU_SUPPORT is not set
+
+#
+# Remoteproc drivers
+#
+# CONFIG_STE_MODEM_RPROC is not set
+
+#
+# Rpmsg drivers
+#
+
+#
+# SOC (System On Chip) specific Drivers
+#
+
+#
+# Broadcom SoC drivers
+#
+# CONFIG_SOC_BRCMSTB is not set
+# CONFIG_SUNXI_SRAM is not set
+# CONFIG_SOC_TI is not set
+# CONFIG_PM_DEVFREQ is not set
+# CONFIG_EXTCON is not set
+# CONFIG_MEMORY is not set
+# CONFIG_IIO is not set
+# CONFIG_PWM is not set
+CONFIG_IRQCHIP=y
+CONFIG_ARM_GIC=y
+CONFIG_ARM_GIC_MAX_NR=1
+# CONFIG_IPACK_BUS is not set
+CONFIG_ARCH_HAS_RESET_CONTROLLER=y
+CONFIG_RESET_CONTROLLER=y
+# CONFIG_RESET_ATH79 is not set
+# CONFIG_RESET_BERLIN is not set
+# CONFIG_RESET_LPC18XX is not set
+# CONFIG_RESET_MESON is not set
+# CONFIG_RESET_PISTACHIO is not set
+# CONFIG_RESET_SOCFPGA is not set
+# CONFIG_RESET_STM32 is not set
+# CONFIG_RESET_SUNXI is not set
+# CONFIG_TI_SYSCON_RESET is not set
+# CONFIG_RESET_ZYNQ is not set
+# CONFIG_FMC is not set
+
+#
+# PHY Subsystem
+#
+CONFIG_GENERIC_PHY=y
+# CONFIG_PHY_PXA_28NM_HSIC is not set
+# CONFIG_PHY_PXA_28NM_USB2 is not set
+# CONFIG_BCM_KONA_USB2_PHY is not set
+CONFIG_PHY_HISI_USB2=y
+# CONFIG_POWERCAP is not set
+# CONFIG_MCB is not set
+
+#
+# Performance monitor support
+#
+# CONFIG_RAS is not set
+
+#
+# Android
+#
+# CONFIG_ANDROID is not set
+# CONFIG_NVMEM is not set
+# CONFIG_STM is not set
+# CONFIG_INTEL_TH is not set
+
+#
+# FPGA Configuration Support
+#
+# CONFIG_FPGA is not set
+# CONFIG_HI_DMAC is not set
+
+#
+# Firmware Drivers
+#
+# CONFIG_FIRMWARE_MEMMAP is not set
+# CONFIG_FW_CFG_SYSFS is not set
+CONFIG_HAVE_ARM_SMCCC=y
+
+#
+# File systems
+#
+CONFIG_DCACHE_WORD_ACCESS=y
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+CONFIG_EXT4_FS=y
+CONFIG_EXT4_USE_FOR_EXT2=y
+# CONFIG_EXT4_FS_POSIX_ACL is not set
+# CONFIG_EXT4_FS_SECURITY is not set
+# CONFIG_EXT4_ENCRYPTION is not set
+# CONFIG_EXT4_DEBUG is not set
+CONFIG_JBD2=y
+# CONFIG_JBD2_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+# CONFIG_NILFS2_FS is not set
+# CONFIG_F2FS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_EXPORTFS=y
+# CONFIG_EXPORTFS_BLOCK_OPS is not set
+CONFIG_FILE_LOCKING=y
+CONFIG_MANDATORY_FILE_LOCKING=y
+# CONFIG_FS_ENCRYPTION is not set
+CONFIG_FSNOTIFY=y
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_FANOTIFY is not set
+# CONFIG_QUOTA is not set
+# CONFIG_QUOTACTL is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+# CONFIG_OVERLAY_FS is not set
+
+#
+# Caches
+#
+# CONFIG_FSCACHE is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_FAT_DEFAULT_UTF8 is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+# CONFIG_PROC_CHILDREN is not set
+CONFIG_KERNFS=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_TMPFS_XATTR is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_CONFIGFS_FS=m
+CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ORANGEFS_FS is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_ECRYPT_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_YAFFS_FS=y
+CONFIG_YAFFS_YAFFS1=y
+# CONFIG_YAFFS_9BYTE_TAGS is not set
+# CONFIG_YAFFS_DOES_ECC is not set
+CONFIG_YAFFS_YAFFS2=y
+CONFIG_YAFFS_AUTO_YAFFS2=y
+# CONFIG_YAFFS_DISABLE_TAGS_ECC is not set
+# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
+# CONFIG_YAFFS_EMPTY_LOST_AND_FOUND is not set
+# CONFIG_YAFFS_DISABLE_BLOCK_REFRESHING is not set
+# CONFIG_YAFFS_DISABLE_BACKGROUND is not set
+# CONFIG_YAFFS_DISABLE_BAD_BLOCK_MARKING is not set
+CONFIG_YAFFS_XATTR=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+CONFIG_UBIFS_FS=y
+# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
+CONFIG_UBIFS_FS_LZO=y
+CONFIG_UBIFS_FS_ZLIB=y
+# CONFIG_UBIFS_ATIME_SUPPORT is not set
+# CONFIG_LOGFS is not set
+CONFIG_CRAMFS=y
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX6FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_PSTORE is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V2=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+# CONFIG_NFS_SWAP is not set
+# CONFIG_NFS_V4_1 is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFS_USE_LEGACY_DNS is not set
+CONFIG_NFS_USE_KERNEL_DNS=y
+# CONFIG_NFSD is not set
+CONFIG_GRACE_PERIOD=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_DEBUG is not set
+# CONFIG_CEPH_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_MAC_ROMAN is not set
+# CONFIG_NLS_MAC_CELTIC is not set
+# CONFIG_NLS_MAC_CENTEURO is not set
+# CONFIG_NLS_MAC_CROATIAN is not set
+# CONFIG_NLS_MAC_CYRILLIC is not set
+# CONFIG_NLS_MAC_GAELIC is not set
+# CONFIG_NLS_MAC_GREEK is not set
+# CONFIG_NLS_MAC_ICELAND is not set
+# CONFIG_NLS_MAC_INUIT is not set
+# CONFIG_NLS_MAC_ROMANIAN is not set
+# CONFIG_NLS_MAC_TURKISH is not set
+CONFIG_NLS_UTF8=y
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+
+#
+# printk and dmesg options
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4
+# CONFIG_BOOT_PRINTK_DELAY is not set
+
+#
+# Compile-time checks and compiler options
+#
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=1024
+# CONFIG_STRIP_ASM_SYMS is not set
+# CONFIG_READABLE_ASM is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_PAGE_OWNER is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_SECTION_MISMATCH is not set
+CONFIG_SECTION_MISMATCH_WARN_ONLY=y
+CONFIG_FRAME_POINTER=y
+# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
+# CONFIG_MAGIC_SYSRQ is not set
+CONFIG_DEBUG_KERNEL=y
+
+#
+# Memory Debugging
+#
+# CONFIG_PAGE_EXTENSION is not set
+# CONFIG_PAGE_POISONING is not set
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS is not set
+CONFIG_HAVE_DEBUG_KMEMLEAK=y
+# CONFIG_DEBUG_KMEMLEAK is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_VM is not set
+CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_DEBUG_SHIRQ is not set
+
+#
+# Debug Lockups and Hangs
+#
+# CONFIG_LOCKUP_DETECTOR is not set
+# CONFIG_DETECT_HUNG_TASK is not set
+# CONFIG_WQ_WATCHDOG is not set
+# CONFIG_PANIC_ON_OOPS is not set
+CONFIG_PANIC_ON_OOPS_VALUE=0
+CONFIG_PANIC_TIMEOUT=0
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_SCHED_INFO is not set
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_SCHED_STACK_END_CHECK is not set
+# CONFIG_DEBUG_TIMEKEEPING is not set
+# CONFIG_TIMER_STATS is not set
+
+#
+# Lock Debugging (spinlocks, mutexes, etc...)
+#
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_ATOMIC_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_LOCK_TORTURE_TEST is not set
+CONFIG_STACKTRACE=y
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_PI_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_DEBUG_CREDENTIALS is not set
+
+#
+# RCU Debugging
+#
+# CONFIG_PROVE_RCU is not set
+# CONFIG_SPARSE_RCU_POINTER is not set
+# CONFIG_TORTURE_TEST is not set
+# CONFIG_RCU_PERF_TEST is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_TRACE is not set
+# CONFIG_RCU_EQS_DEBUG is not set
+# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_NOTIFIER_ERROR_INJECTION is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_TRACING_SUPPORT=y
+# CONFIG_FTRACE is not set
+
+#
+# Runtime Testing
+#
+# CONFIG_TEST_LIST_SORT is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_RBTREE_TEST is not set
+# CONFIG_INTERVAL_TREE_TEST is not set
+# CONFIG_PERCPU_TEST is not set
+# CONFIG_ATOMIC64_SELFTEST is not set
+# CONFIG_TEST_HEXDUMP is not set
+# CONFIG_TEST_STRING_HELPERS is not set
+# CONFIG_TEST_KSTRTOX is not set
+# CONFIG_TEST_PRINTF is not set
+# CONFIG_TEST_BITMAP is not set
+# CONFIG_TEST_UUID is not set
+# CONFIG_TEST_RHASHTABLE is not set
+# CONFIG_TEST_HASH is not set
+# CONFIG_DMA_API_DEBUG is not set
+# CONFIG_TEST_LKM is not set
+# CONFIG_TEST_USER_COPY is not set
+# CONFIG_TEST_BPF is not set
+# CONFIG_TEST_FIRMWARE is not set
+# CONFIG_TEST_UDELAY is not set
+# CONFIG_MEMTEST is not set
+# CONFIG_TEST_STATIC_KEYS is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+# CONFIG_ARCH_WANTS_UBSAN_NO_NULL is not set
+# CONFIG_UBSAN is not set
+CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y
+CONFIG_STRICT_DEVMEM=y
+# CONFIG_IO_STRICT_DEVMEM is not set
+# CONFIG_ARM_PTDUMP is not set
+# CONFIG_ARM_UNWIND is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_LL is not set
+CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
+# CONFIG_DEBUG_UART_8250 is not set
+CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
+# CONFIG_PID_IN_CONTEXTIDR is not set
+# CONFIG_DEBUG_SET_MODULE_RONX is not set
+# CONFIG_CORESIGHT is not set
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_PERSISTENT_KEYRINGS is not set
+# CONFIG_ENCRYPTED_KEYS is not set
+# CONFIG_KEY_DH_OPERATIONS is not set
+# CONFIG_SECURITY_DMESG_RESTRICT is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y
+CONFIG_HAVE_ARCH_HARDENED_USERCOPY=y
+# CONFIG_HARDENED_USERCOPY is not set
+CONFIG_DEFAULT_SECURITY_DAC=y
+CONFIG_DEFAULT_SECURITY=""
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG=m
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_RNG_DEFAULT=m
+CONFIG_CRYPTO_AKCIPHER2=y
+CONFIG_CRYPTO_KPP2=y
+# CONFIG_CRYPTO_RSA is not set
+# CONFIG_CRYPTO_DH is not set
+# CONFIG_CRYPTO_ECDH is not set
+CONFIG_CRYPTO_MANAGER=m
+CONFIG_CRYPTO_MANAGER2=y
+# CONFIG_CRYPTO_USER is not set
+CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_NULL2=y
+CONFIG_CRYPTO_WORKQUEUE=y
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_MCRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+CONFIG_CRYPTO_CCM=m
+CONFIG_CRYPTO_GCM=m
+# CONFIG_CRYPTO_CHACHA20POLY1305 is not set
+CONFIG_CRYPTO_SEQIV=m
+CONFIG_CRYPTO_ECHAINIV=m
+
+#
+# Block modes
+#
+# CONFIG_CRYPTO_CBC is not set
+CONFIG_CRYPTO_CTR=m
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+# CONFIG_CRYPTO_KEYWRAP is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_CMAC is not set
+CONFIG_CRYPTO_HMAC=m
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_VMAC is not set
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+# CONFIG_CRYPTO_CRC32 is not set
+CONFIG_CRYPTO_CRCT10DIF=y
+CONFIG_CRYPTO_GHASH=m
+# CONFIG_CRYPTO_POLY1305 is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+CONFIG_CRYPTO_SHA1=y
+CONFIG_CRYPTO_SHA256=y
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_SHA3 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=y
+# CONFIG_CRYPTO_ANUBIS is not set
+CONFIG_CRYPTO_ARC4=y
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_CHACHA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_LZO=y
+# CONFIG_CRYPTO_842 is not set
+# CONFIG_CRYPTO_LZ4 is not set
+# CONFIG_CRYPTO_LZ4HC is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_DRBG_MENU=m
+CONFIG_CRYPTO_DRBG_HMAC=y
+# CONFIG_CRYPTO_DRBG_HASH is not set
+# CONFIG_CRYPTO_DRBG_CTR is not set
+CONFIG_CRYPTO_DRBG=m
+CONFIG_CRYPTO_JITTERENTROPY=m
+# CONFIG_CRYPTO_USER_API_HASH is not set
+# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
+# CONFIG_CRYPTO_USER_API_RNG is not set
+# CONFIG_CRYPTO_USER_API_AEAD is not set
+# CONFIG_CRYPTO_HW is not set
+# CONFIG_ASYMMETRIC_KEY_TYPE is not set
+
+#
+# Certificates for signature checking
+#
+# CONFIG_ARM_CRYPTO is not set
+# CONFIG_BINARY_PRINTF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_HAVE_ARCH_BITREVERSE=y
+CONFIG_RATIONAL=y
+CONFIG_GENERIC_STRNCPY_FROM_USER=y
+CONFIG_GENERIC_STRNLEN_USER=y
+CONFIG_GENERIC_NET_UTILS=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_IO=y
+CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
+CONFIG_CRC_CCITT=y
+CONFIG_CRC16=y
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC32=y
+# CONFIG_CRC32_SELFTEST is not set
+CONFIG_CRC32_SLICEBY8=y
+# CONFIG_CRC32_SLICEBY4 is not set
+# CONFIG_CRC32_SARWATE is not set
+# CONFIG_CRC32_BIT is not set
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=y
+# CONFIG_CRC8 is not set
+# CONFIG_AUDIT_ARCH_COMPAT_GENERIC is not set
+# CONFIG_RANDOM32_SELFTEST is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_LZ4_DECOMPRESS=y
+CONFIG_XZ_DEC=y
+CONFIG_XZ_DEC_X86=y
+CONFIG_XZ_DEC_POWERPC=y
+CONFIG_XZ_DEC_IA64=y
+CONFIG_XZ_DEC_ARM=y
+CONFIG_XZ_DEC_ARMTHUMB=y
+CONFIG_XZ_DEC_SPARC=y
+CONFIG_XZ_DEC_BCJ=y
+# CONFIG_XZ_DEC_TEST is not set
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_DECOMPRESS_LZ4=y
+CONFIG_GENERIC_ALLOCATOR=y
+CONFIG_ASSOCIATIVE_ARRAY=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT_MAP=y
+CONFIG_HAS_DMA=y
+CONFIG_DQL=y
+CONFIG_NLATTR=y
+# CONFIG_CORDIC is not set
+# CONFIG_DDR is not set
+# CONFIG_IRQ_POLL is not set
+CONFIG_LIBFDT=y
+CONFIG_OID_REGISTRY=y
+# CONFIG_SG_SPLIT is not set
+CONFIG_SG_POOL=y
+CONFIG_ARCH_HAS_SG_CHAIN=y
+CONFIG_SBITMAP=y
+# CONFIG_VIRTUALIZATION is not set
diff --git a/arch/arm/configs/hi3516a_mini_defconfig b/arch/arm/configs/hi3516a_mini_defconfig
new file mode 100644
index 0000000..53a8949
--- /dev/null
+++ b/arch/arm/configs/hi3516a_mini_defconfig
@@ -0,0 +1,2322 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Linux/arm 4.9.37 Kernel Configuration
+#
+CONFIG_ARM=y
+CONFIG_ARM_HAS_SG_CHAIN=y
+CONFIG_MIGHT_HAVE_PCI=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_HAVE_PROC_CPU=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_FIX_EARLYCON_MEM=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_ARCH_SUPPORTS_UPROBES=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_ARM_PATCH_PHYS_VIRT=y
+CONFIG_GENERIC_BUG=y
+CONFIG_PGTABLE_LEVELS=2
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_IRQ_WORK=y
+CONFIG_BUILDTIME_EXTABLE_SORT=y
+
+#
+# General setup
+#
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_CROSS_COMPILE=""
+# CONFIG_COMPILE_TEST is not set
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_HAVE_KERNEL_GZIP=y
+CONFIG_HAVE_KERNEL_LZMA=y
+CONFIG_HAVE_KERNEL_XZ=y
+CONFIG_HAVE_KERNEL_LZO=y
+CONFIG_HAVE_KERNEL_LZ4=y
+CONFIG_KERNEL_GZIP=y
+# CONFIG_KERNEL_LZMA is not set
+# CONFIG_KERNEL_XZ is not set
+# CONFIG_KERNEL_LZO is not set
+# CONFIG_KERNEL_LZ4 is not set
+CONFIG_DEFAULT_HOSTNAME="(none)"
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+CONFIG_CROSS_MEMORY_ATTACH=y
+CONFIG_FHANDLE=y
+CONFIG_USELIB=y
+# CONFIG_AUDIT is not set
+CONFIG_HAVE_ARCH_AUDITSYSCALL=y
+
+#
+# IRQ subsystem
+#
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_IRQ_DOMAIN=y
+CONFIG_IRQ_DOMAIN_HIERARCHY=y
+CONFIG_HANDLE_DOMAIN_IRQ=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_SPARSE_IRQ=y
+CONFIG_ARCH_CLOCKSOURCE_DATA=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+
+#
+# Timers subsystem
+#
+CONFIG_HZ_PERIODIC=y
+# CONFIG_NO_HZ_IDLE is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+
+#
+# CPU/Task time and stats accounting
+#
+CONFIG_TICK_CPU_ACCOUNTING=y
+# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set
+CONFIG_IRQ_TIME_ACCOUNTING=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_TINY_RCU=y
+# CONFIG_RCU_EXPERT is not set
+CONFIG_SRCU=y
+# CONFIG_TASKS_RCU is not set
+# CONFIG_RCU_STALL_COMMON is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_RCU_EXPEDITE_BOOT is not set
+# CONFIG_BUILD_BIN2C is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=17
+CONFIG_NMI_LOG_BUF_SHIFT=13
+CONFIG_GENERIC_SCHED_CLOCK=y
+CONFIG_CGROUPS=y
+# CONFIG_MEMCG is not set
+# CONFIG_BLK_CGROUP is not set
+# CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUP_PIDS is not set
+CONFIG_CGROUP_FREEZER=y
+# CONFIG_CPUSETS is not set
+# CONFIG_CGROUP_DEVICE is not set
+# CONFIG_CGROUP_CPUACCT is not set
+# CONFIG_CGROUP_DEBUG is not set
+# CONFIG_CHECKPOINT_RESTORE is not set
+CONFIG_NAMESPACES=y
+CONFIG_UTS_NS=y
+CONFIG_IPC_NS=y
+# CONFIG_USER_NS is not set
+CONFIG_PID_NS=y
+CONFIG_NET_NS=y
+# CONFIG_SCHED_AUTOGROUP is not set
+# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
+# CONFIG_RD_XZ is not set
+# CONFIG_RD_LZO is not set
+CONFIG_RD_LZ4=y
+CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_HAVE_UID16=y
+CONFIG_BPF=y
+# CONFIG_EXPERT is not set
+CONFIG_UID16=y
+CONFIG_MULTIUSER=y
+# CONFIG_SGETMASK_SYSCALL is not set
+CONFIG_SYSFS_SYSCALL=y
+# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_ABSOLUTE_PERCPU is not set
+CONFIG_KALLSYMS_BASE_RELATIVE=y
+CONFIG_PRINTK=y
+CONFIG_PRINTK_NMI=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+# CONFIG_BPF_SYSCALL is not set
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_ADVISE_SYSCALLS=y
+# CONFIG_USERFAULTFD is not set
+CONFIG_MEMBARRIER=y
+# CONFIG_EMBEDDED is not set
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_PERF_USE_VMALLOC=y
+
+#
+# Kernel Performance Events And Counters
+#
+# CONFIG_PERF_EVENTS is not set
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+CONFIG_COMPAT_BRK=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLAB_FREELIST_RANDOM is not set
+# CONFIG_SYSTEM_DATA_VERIFICATION is not set
+# CONFIG_PROFILING is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+# CONFIG_JUMP_LABEL is not set
+# CONFIG_UPROBES is not set
+# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_ARCH_USE_BUILTIN_BSWAP=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_OPTPROBES=y
+CONFIG_HAVE_NMI=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+CONFIG_HAVE_DMA_CONTIGUOUS=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GENERIC_IDLE_POLL_SETUP=y
+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_PERF_REGS=y
+CONFIG_HAVE_PERF_USER_STACK_DUMP=y
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
+CONFIG_HAVE_GCC_PLUGINS=y
+# CONFIG_GCC_PLUGINS is not set
+CONFIG_HAVE_CC_STACKPROTECTOR=y
+# CONFIG_CC_STACKPROTECTOR is not set
+CONFIG_CC_STACKPROTECTOR_NONE=y
+# CONFIG_CC_STACKPROTECTOR_REGULAR is not set
+# CONFIG_CC_STACKPROTECTOR_STRONG is not set
+CONFIG_HAVE_CONTEXT_TRACKING=y
+CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
+CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
+CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
+CONFIG_MODULES_USE_ELF_REL=y
+CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
+CONFIG_HAVE_ARCH_MMAP_RND_BITS=y
+CONFIG_HAVE_EXIT_THREAD=y
+CONFIG_ARCH_MMAP_RND_BITS_MIN=8
+CONFIG_ARCH_MMAP_RND_BITS_MAX=16
+CONFIG_ARCH_MMAP_RND_BITS=8
+# CONFIG_HAVE_ARCH_HASH is not set
+# CONFIG_ISA_BUS_API is not set
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_OLD_SIGSUSPEND3=y
+CONFIG_OLD_SIGACTION=y
+# CONFIG_CPU_NO_EFFICIENT_FFS is not set
+# CONFIG_HAVE_ARCH_VMAP_STACK is not set
+
+#
+# GCOV-based kernel profiling
+#
+CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+# CONFIG_MODULE_SIG is not set
+# CONFIG_MODULE_COMPRESS is not set
+# CONFIG_TRIM_UNUSED_KSYMS is not set
+CONFIG_BLOCK=y
+CONFIG_LBDAF=y
+CONFIG_BLK_DEV_BSG=y
+# CONFIG_BLK_DEV_BSGLIB is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+CONFIG_BLK_CMDLINE_PARSER=y
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_AIX_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+CONFIG_EFI_PARTITION=y
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_CMDLINE_PARTITION=y
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_DEADLINE=y
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="deadline"
+CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
+CONFIG_INLINE_READ_UNLOCK=y
+CONFIG_INLINE_READ_UNLOCK_IRQ=y
+CONFIG_INLINE_WRITE_UNLOCK=y
+CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
+CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
+CONFIG_FREEZER=y
+
+#
+# System Type
+#
+CONFIG_MMU=y
+CONFIG_ARCH_MULTIPLATFORM=y
+# CONFIG_ARCH_GEMINI is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_DOVE is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_W90X900 is not set
+# CONFIG_ARCH_LPC32XX is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C24XX is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP1 is not set
+
+#
+# Multiple platform selection
+#
+
+#
+# CPU Core family selection
+#
+# CONFIG_ARCH_MULTI_V6 is not set
+CONFIG_ARCH_MULTI_V7=y
+CONFIG_ARCH_MULTI_V6_V7=y
+# CONFIG_ARCH_MULTI_CPU_AUTO is not set
+# CONFIG_ARCH_VIRT is not set
+# CONFIG_ARCH_MVEBU is not set
+# CONFIG_ARCH_ALPINE is not set
+# CONFIG_ARCH_ARTPEC is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_BCM is not set
+# CONFIG_ARCH_BERLIN is not set
+# CONFIG_ARCH_DIGICOLOR is not set
+# CONFIG_ARCH_HIGHBANK is not set
+# CONFIG_ARCH_HISI is not set
+CONFIG_ARCH_HISI_BVT=y
+
+#
+# Hisilicon BVT platform type
+#
+CONFIG_HI_ZRELADDR=0x80008000
+CONFIG_HI_PARAMS_PHYS=0x00000100
+CONFIG_HI_INITRD_PHYS=0x00800000
+CONFIG_ARCH_HI3516A=y
+# CONFIG_ARCH_HI3536DV100 is not set
+# CONFIG_ARCH_KEYSTONE is not set
+# CONFIG_ARCH_MESON is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_MEDIATEK is not set
+
+#
+# TI OMAP/AM/DM/DRA Family
+#
+# CONFIG_ARCH_OMAP3 is not set
+# CONFIG_ARCH_OMAP4 is not set
+# CONFIG_SOC_OMAP5 is not set
+# CONFIG_SOC_AM33XX is not set
+# CONFIG_SOC_AM43XX is not set
+# CONFIG_SOC_DRA7XX is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_QCOM is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_ROCKCHIP is not set
+# CONFIG_ARCH_SOCFPGA is not set
+# CONFIG_PLAT_SPEAR is not set
+# CONFIG_ARCH_STI is not set
+# CONFIG_ARCH_S5PV210 is not set
+# CONFIG_ARCH_EXYNOS is not set
+# CONFIG_ARCH_RENESAS is not set
+# CONFIG_ARCH_SUNXI is not set
+# CONFIG_ARCH_SIRF is not set
+# CONFIG_ARCH_TANGO is not set
+# CONFIG_ARCH_TEGRA is not set
+# CONFIG_ARCH_UNIPHIER is not set
+# CONFIG_ARCH_U8500 is not set
+# CONFIG_ARCH_VEXPRESS is not set
+# CONFIG_ARCH_WM8850 is not set
+# CONFIG_ARCH_ZX is not set
+# CONFIG_ARCH_ZYNQ is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_V7=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_PABRT_V7=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+# CONFIG_ARM_LPAE is not set
+# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
+CONFIG_ARM_THUMB=y
+# CONFIG_ARM_THUMBEE is not set
+CONFIG_ARM_VIRT_EXT=y
+# CONFIG_SWP_EMULATE is not set
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_KUSER_HELPERS=y
+CONFIG_VDSO=y
+CONFIG_MIGHT_HAVE_CACHE_L2X0=y
+# CONFIG_CACHE_L2X0 is not set
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
+CONFIG_ARM_L1_CACHE_SHIFT=6
+CONFIG_ARM_DMA_MEM_BUFFERABLE=y
+# CONFIG_DEBUG_RODATA is not set
+CONFIG_MULTI_IRQ_HANDLER=y
+# CONFIG_ARM_ERRATA_430973 is not set
+# CONFIG_ARM_ERRATA_720789 is not set
+# CONFIG_ARM_ERRATA_754322 is not set
+# CONFIG_ARM_ERRATA_775420 is not set
+# CONFIG_ARM_ERRATA_773022 is not set
+# CONFIG_ARM_ERRATA_818325_852422 is not set
+# CONFIG_ARM_ERRATA_821420 is not set
+# CONFIG_ARM_ERRATA_825619 is not set
+# CONFIG_ARM_ERRATA_852421 is not set
+# CONFIG_ARM_ERRATA_852423 is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI is not set
+# CONFIG_PCI_DOMAINS_GENERIC is not set
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_HAVE_SMP=y
+# CONFIG_SMP is not set
+CONFIG_HAVE_ARM_ARCH_TIMER=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_3G_OPT is not set
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_ARM_PSCI is not set
+CONFIG_ARCH_NR_GPIO=0
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_HZ_FIXED=0
+CONFIG_HZ_100=y
+# CONFIG_HZ_200 is not set
+# CONFIG_HZ_250 is not set
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_500 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=100
+# CONFIG_SCHED_HRTICK is not set
+# CONFIG_THUMB2_KERNEL is not set
+CONFIG_ARM_PATCH_IDIV=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+CONFIG_HAVE_ARCH_PFN_VALID=y
+# CONFIG_HIGHMEM is not set
+# CONFIG_CPU_SW_DOMAIN_PAN is not set
+CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
+# CONFIG_ARM_MODULE_PLTS is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_NO_BOOTMEM=y
+# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_COMPACTION=y
+CONFIG_MIGRATION=y
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+# CONFIG_KSM is not set
+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
+CONFIG_NEED_PER_CPU_KM=y
+# CONFIG_CLEANCACHE is not set
+# CONFIG_FRONTSWAP is not set
+# CONFIG_CMA is not set
+# CONFIG_ZPOOL is not set
+# CONFIG_ZBUD is not set
+# CONFIG_ZSMALLOC is not set
+CONFIG_GENERIC_EARLY_IOREMAP=y
+# CONFIG_IDLE_PAGE_TRACKING is not set
+CONFIG_FORCE_MAX_ZONEORDER=11
+CONFIG_ALIGNMENT_TRAP=y
+# CONFIG_UACCESS_WITH_MEMCPY is not set
+# CONFIG_SECCOMP is not set
+CONFIG_SWIOTLB=y
+CONFIG_IOMMU_HELPER=y
+# CONFIG_PARAVIRT is not set
+# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
+# CONFIG_XEN is not set
+
+#
+# Boot options
+#
+CONFIG_USE_OF=y
+CONFIG_ATAGS=y
+# CONFIG_DEPRECATED_PARAM_STRUCT is not set
+CONFIG_ZBOOT_ROM_TEXT=0
+CONFIG_ZBOOT_ROM_BSS=0
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_ARM_ATAG_DTB_COMPAT=y
+CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y
+# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set
+CONFIG_CMDLINE=""
+# CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
+CONFIG_AUTO_ZRELADDR=y
+# CONFIG_EFI is not set
+
+#
+# CPU Power Management
+#
+
+#
+# CPU Frequency scaling
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_GOV_ATTR_SET=y
+CONFIG_CPU_FREQ_GOV_COMMON=y
+CONFIG_CPU_FREQ_STAT=y
+# CONFIG_CPU_FREQ_STAT_DETAILS is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+
+#
+# CPU frequency scaling drivers
+#
+CONFIG_CPUFREQ_DT=y
+CONFIG_CPUFREQ_DT_PLATDEV=y
+# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set
+# CONFIG_QORIQ_CPUFREQ is not set
+
+#
+# CPU Idle
+#
+# CONFIG_CPU_IDLE is not set
+# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+# CONFIG_KERNEL_MODE_NEON is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_ELFCORE=y
+CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
+CONFIG_BINFMT_SCRIPT=y
+# CONFIG_BINFMT_FLAT is not set
+# CONFIG_HAVE_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+CONFIG_COREDUMP=y
+
+#
+# Power management options
+#
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+CONFIG_HIBERNATE_CALLBACKS=y
+CONFIG_HIBERNATION=y
+CONFIG_PM_STD_PARTITION=""
+CONFIG_PM_SLEEP=y
+# CONFIG_PM_AUTOSLEEP is not set
+# CONFIG_PM_WAKELOCKS is not set
+CONFIG_PM=y
+CONFIG_PM_DEBUG=y
+# CONFIG_PM_ADVANCED_DEBUG is not set
+CONFIG_PM_SLEEP_DEBUG=y
+# CONFIG_APM_EMULATION is not set
+CONFIG_PM_OPP=y
+CONFIG_PM_CLK=y
+# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
+CONFIG_CPU_PM=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARM_CPU_SUSPEND=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_DIAG is not set
+CONFIG_UNIX=y
+# CONFIG_UNIX_DIAG is not set
+CONFIG_XFRM=y
+CONFIG_XFRM_ALGO=y
+CONFIG_XFRM_USER=y
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+CONFIG_NET_KEY=y
+# CONFIG_NET_KEY_MIGRATE is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+# CONFIG_IP_FIB_TRIE_STATS is not set
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_VERBOSE=y
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE_DEMUX is not set
+# CONFIG_NET_IP_TUNNEL is not set
+CONFIG_IP_MROUTE=y
+# CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+CONFIG_SYN_COOKIES=y
+# CONFIG_NET_UDP_TUNNEL is not set
+# CONFIG_NET_FOU is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_INET_UDP_DIAG is not set
+# CONFIG_INET_DIAG_DESTROY is not set
+CONFIG_TCP_CONG_ADVANCED=y
+CONFIG_TCP_CONG_BIC=m
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+# CONFIG_TCP_CONG_HSTCP is not set
+# CONFIG_TCP_CONG_HYBLA is not set
+# CONFIG_TCP_CONG_VEGAS is not set
+# CONFIG_TCP_CONG_NV is not set
+# CONFIG_TCP_CONG_SCALABLE is not set
+# CONFIG_TCP_CONG_LP is not set
+# CONFIG_TCP_CONG_VENO is not set
+# CONFIG_TCP_CONG_YEAH is not set
+# CONFIG_TCP_CONG_ILLINOIS is not set
+# CONFIG_TCP_CONG_DCTCP is not set
+# CONFIG_TCP_CONG_CDG is not set
+# CONFIG_TCP_CONG_BBR is not set
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
+CONFIG_TCP_MD5SIG=y
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NET_PTP_CLASSIFY is not set
+# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_RDS is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_L2TP is not set
+# CONFIG_BRIDGE is not set
+CONFIG_HAVE_NET_DSA=y
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_PHONET is not set
+# CONFIG_IEEE802154 is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+CONFIG_DNS_RESOLVER=y
+# CONFIG_BATMAN_ADV is not set
+# CONFIG_OPENVSWITCH is not set
+# CONFIG_VSOCKETS is not set
+# CONFIG_NETLINK_DIAG is not set
+# CONFIG_MPLS is not set
+# CONFIG_HSR is not set
+# CONFIG_NET_SWITCHDEV is not set
+# CONFIG_NET_L3_MASTER_DEV is not set
+# CONFIG_NET_NCSI is not set
+# CONFIG_SOCK_CGROUP_DATA is not set
+# CONFIG_CGROUP_NET_PRIO is not set
+# CONFIG_CGROUP_NET_CLASSID is not set
+CONFIG_NET_RX_BUSY_POLL=y
+CONFIG_BQL=y
+# CONFIG_BPF_JIT is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_AF_KCM is not set
+# CONFIG_STREAM_PARSER is not set
+CONFIG_FIB_RULES=y
+# CONFIG_WIRELESS is not set
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_RFKILL_REGULATOR is not set
+# CONFIG_NET_9P is not set
+# CONFIG_CAIF is not set
+# CONFIG_CEPH_LIB is not set
+# CONFIG_NFC is not set
+# CONFIG_LWTUNNEL is not set
+# CONFIG_DST_CACHE is not set
+# CONFIG_NET_DEVLINK is not set
+CONFIG_MAY_USE_DEVLINK=y
+CONFIG_HAVE_CBPF_JIT=y
+
+#
+# Device Drivers
+#
+CONFIG_ARM_AMBA=y
+
+#
+# Generic Driver Options
+#
+# CONFIG_UEVENT_HELPER is not set
+CONFIG_DEVTMPFS=y
+# CONFIG_DEVTMPFS_MOUNT is not set
+CONFIG_STANDALONE=y
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
+CONFIG_ALLOW_DEV_COREDUMP=y
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_GENERIC_CPU_DEVICES is not set
+# CONFIG_DMA_SHARED_BUFFER is not set
+
+#
+# Bus devices
+#
+# CONFIG_BRCMSTB_GISB_ARB is not set
+# CONFIG_VEXPRESS_CONFIG is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_TESTS is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+CONFIG_MTD_OF_PARTS=y
+# CONFIG_MTD_AR7_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_SM_FTL is not set
+# CONFIG_MTD_OOPS is not set
+# CONFIG_MTD_SWAP is not set
+# CONFIG_MTD_PARTITIONED_MASTER is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 is not set
+# CONFIG_MTD_SST25L is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOCG3 is not set
+CONFIG_MTD_NAND_ECC=y
+# CONFIG_MTD_NAND_ECC_SMC is not set
+CONFIG_MTD_NAND=y
+# CONFIG_MTD_NAND_ECC_BCH is not set
+# CONFIG_MTD_SM_COMMON is not set
+# CONFIG_MTD_NAND_DENALI_DT is not set
+# CONFIG_MTD_NAND_OMAP_BCH_BUILD is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_DOCG4 is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_BRCMNAND is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_NAND_HISI504 is not set
+# CONFIG_MTD_NAND_MTK is not set
+# CONFIG_MTD_SPI_NAND_HISI_BVT is not set
+CONFIG_MTD_NAND_HINFC610=y
+CONFIG_HINFC610_MAX_CHIP=1
+CONFIG_HINFC610_DBG_NAND_DEBUG=y
+CONFIG_HINFC610_DBG_NAND_DUMP=y
+CONFIG_HINFC610_DBG_NAND_ERASE_COUNT=y
+CONFIG_HINFC610_DBG_NAND_ECC_COUNT=y
+CONFIG_HINFC610_DBG_NAND_READ_RETRY=y
+CONFIG_HINFC610_AUTO_PAGESIZE_ECC=y
+# CONFIG_HINFC610_PAGESIZE_AUTO_ECC_NONE is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR & LPDDR2 PCM memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+# CONFIG_MTD_LPDDR2_NVM is not set
+CONFIG_MTD_SPI_NOR=y
+# CONFIG_MTD_MT81xx_NOR is not set
+# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
+# CONFIG_SPI_CADENCE_QUADSPI is not set
+# CONFIG_SPI_HISI_SFC is not set
+CONFIG_MTD_SPI_IDS=y
+CONFIG_CLOSE_SPI_8PIN_4IO=y
+CONFIG_MTD_HISFC350=y
+CONFIG_HISFC350_SYSCTRL_ADDRESS=0x20030000
+CONFIG_HISFC350_CHIP_NUM=2
+# CONFIG_HISFC350_SHOW_CYCLE_TIMING is not set
+# CONFIG_HISFC350_ENABLE_CHIPSELECT_0 is not set
+CONFIG_HISFC350_ENABLE_CHIPSELECT_1=y
+# CONFIG_HISFC350_ENABLE_INTR_DMA is not set
+CONFIG_CMD_SPI_BLOCK_PROTECTION=y
+# CONFIG_MTD_UBI is not set
+CONFIG_DTC=y
+CONFIG_OF=y
+# CONFIG_OF_UNITTEST is not set
+CONFIG_OF_FLATTREE=y
+CONFIG_OF_EARLY_FLATTREE=y
+CONFIG_OF_ADDRESS=y
+CONFIG_OF_IRQ=y
+CONFIG_OF_NET=y
+CONFIG_OF_MDIO=y
+CONFIG_OF_RESERVED_MEM=y
+# CONFIG_OF_OVERLAY is not set
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_NULL_BLK is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_DRBD is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=65536
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_RBD is not set
+# CONFIG_NVME_TARGET is not set
+
+#
+# Misc devices
+#
+# CONFIG_SENSORS_LIS3LV02D is not set
+# CONFIG_AD525X_DPOT is not set
+# CONFIG_DUMMY_IRQ is not set
+# CONFIG_ICS932S401 is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_APDS9802ALS is not set
+# CONFIG_ISL29003 is not set
+# CONFIG_ISL29020 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_SENSORS_BH1770 is not set
+# CONFIG_SENSORS_APDS990X is not set
+# CONFIG_HMC6352 is not set
+# CONFIG_DS1682 is not set
+# CONFIG_TI_DAC7512 is not set
+# CONFIG_USB_SWITCH_FSA9480 is not set
+# CONFIG_LATTICE_ECP3_CONFIG is not set
+# CONFIG_SRAM is not set
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_AT25 is not set
+# CONFIG_EEPROM_LEGACY is not set
+# CONFIG_EEPROM_MAX6875 is not set
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_EEPROM_93XX46 is not set
+
+#
+# Texas Instruments shared transport line discipline
+#
+# CONFIG_SENSORS_LIS3_SPI is not set
+# CONFIG_SENSORS_LIS3_I2C is not set
+
+#
+# Altera FPGA firmware download module
+#
+# CONFIG_ALTERA_STAPL is not set
+
+#
+# Intel MIC Bus Driver
+#
+
+#
+# SCIF Bus Driver
+#
+
+#
+# VOP Bus Driver
+#
+
+#
+# Intel MIC Host Driver
+#
+
+#
+# Intel MIC Card Driver
+#
+
+#
+# SCIF Driver
+#
+
+#
+# Intel MIC Coprocessor State Management (COSM) Drivers
+#
+
+#
+# VOP Driver
+#
+# CONFIG_ECHO is not set
+# CONFIG_CXL_BASE is not set
+# CONFIG_CXL_AFU_DRIVER_OPS is not set
+
+#
+# SCSI device support
+#
+CONFIG_SCSI_MOD=y
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+CONFIG_NET_CORE=y
+# CONFIG_BONDING is not set
+# CONFIG_DUMMY is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_NET_TEAM is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_VXLAN is not set
+# CONFIG_MACSEC is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_TUN is not set
+# CONFIG_TUN_VNET_CROSS_LE is not set
+# CONFIG_VETH is not set
+# CONFIG_NLMON is not set
+
+#
+# CAIF transport drivers
+#
+
+#
+# Distributed Switch Architecture drivers
+#
+CONFIG_ETHERNET=y
+# CONFIG_ALTERA_TSE is not set
+# CONFIG_NET_VENDOR_AMAZON is not set
+# CONFIG_NET_VENDOR_ARC is not set
+# CONFIG_NET_VENDOR_AURORA is not set
+# CONFIG_NET_CADENCE is not set
+# CONFIG_NET_VENDOR_BROADCOM is not set
+# CONFIG_NET_VENDOR_CIRRUS is not set
+# CONFIG_DM9000 is not set
+# CONFIG_DNET is not set
+# CONFIG_NET_VENDOR_EZCHIP is not set
+# CONFIG_NET_VENDOR_FARADAY is not set
+CONFIG_NET_VENDOR_HISILICON=y
+# CONFIG_HIX5HD2_GMAC is not set
+# CONFIG_HISI_FEMAC is not set
+# CONFIG_HIP04_ETH is not set
+# CONFIG_HNS is not set
+# CONFIG_HNS_DSAF is not set
+# CONFIG_HNS_ENET is not set
+CONFIG_HIETH_GMAC=y
+# CONFIG_HIGMAC_DESC_4WORD is not set
+# CONFIG_HIGMAC_RXCSUM is not set
+CONFIG_RX_FLOW_CTRL_SUPPORT=y
+CONFIG_TX_FLOW_CTRL_SUPPORT=y
+CONFIG_TX_FLOW_CTRL_PAUSE_TIME=0xFFFF
+CONFIG_TX_FLOW_CTRL_PAUSE_INTERVAL=0xFFFF
+CONFIG_TX_FLOW_CTRL_ACTIVE_THRESHOLD=16
+CONFIG_TX_FLOW_CTRL_DEACTIVE_THRESHOLD=32
+# CONFIG_NET_VENDOR_INTEL is not set
+# CONFIG_NET_VENDOR_MARVELL is not set
+# CONFIG_NET_VENDOR_MICREL is not set
+# CONFIG_NET_VENDOR_MICROCHIP is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+# CONFIG_NET_VENDOR_NETRONOME is not set
+# CONFIG_ETHOC is not set
+# CONFIG_NET_VENDOR_QUALCOMM is not set
+# CONFIG_NET_VENDOR_RENESAS is not set
+# CONFIG_NET_VENDOR_ROCKER is not set
+# CONFIG_NET_VENDOR_SAMSUNG is not set
+# CONFIG_NET_VENDOR_SEEQ is not set
+# CONFIG_NET_VENDOR_SMSC is not set
+# CONFIG_NET_VENDOR_STMICRO is not set
+# CONFIG_NET_VENDOR_SYNOPSYS is not set
+# CONFIG_NET_VENDOR_VIA is not set
+# CONFIG_NET_VENDOR_WIZNET is not set
+CONFIG_PHYLIB=y
+CONFIG_SWPHY=y
+
+#
+# MDIO bus device drivers
+#
+# CONFIG_MDIO_BCM_UNIMAC is not set
+# CONFIG_MDIO_BITBANG is not set
+# CONFIG_MDIO_BUS_MUX_MMIOREG is not set
+# CONFIG_MDIO_HISI_FEMAC is not set
+CONFIG_MDIO_HISI_GEMAC=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_AMD_PHY is not set
+# CONFIG_AQUANTIA_PHY is not set
+# CONFIG_AT803X_PHY is not set
+# CONFIG_BCM7XXX_PHY is not set
+# CONFIG_BCM87XX_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_DP83848_PHY is not set
+# CONFIG_DP83867_PHY is not set
+CONFIG_FIXED_PHY=y
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_INTEL_XWAY_PHY is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_MICREL_PHY is not set
+# CONFIG_MICROCHIP_PHY is not set
+# CONFIG_MICROSEMI_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_TERANETICS_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_XILINX_GMII2RGMII is not set
+# CONFIG_MICREL_KS8995MA is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+
+#
+# Host-side USB support is needed for USB Network Adapter support
+#
+# CONFIG_WLAN is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+# CONFIG_WAN is not set
+# CONFIG_ISDN is not set
+# CONFIG_NVM is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+# CONFIG_INPUT_SPARSEKMAP is not set
+# CONFIG_INPUT_MATRIXKMAP is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ADP5588 is not set
+# CONFIG_KEYBOARD_ADP5589 is not set
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_QT1070 is not set
+# CONFIG_KEYBOARD_QT2160 is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_TCA6416 is not set
+# CONFIG_KEYBOARD_TCA8418 is not set
+# CONFIG_KEYBOARD_LM8333 is not set
+# CONFIG_KEYBOARD_MAX7359 is not set
+# CONFIG_KEYBOARD_MCS is not set
+# CONFIG_KEYBOARD_MPR121 is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_OPENCORES is not set
+# CONFIG_KEYBOARD_SAMSUNG is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_OMAP4 is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_CAP11XX is not set
+# CONFIG_KEYBOARD_BCM is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_BYD=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_CYPRESS=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_SENTELIC is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+CONFIG_MOUSE_PS2_FOCALTECH=y
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_CYAPA is not set
+# CONFIG_MOUSE_ELAN_I2C is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_MOUSE_SYNAPTICS_I2C is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_AD714X is not set
+# CONFIG_INPUT_ATMEL_CAPTOUCH is not set
+# CONFIG_INPUT_BMA150 is not set
+# CONFIG_INPUT_E3X0_BUTTON is not set
+# CONFIG_INPUT_MMA8450 is not set
+# CONFIG_INPUT_MPU3050 is not set
+# CONFIG_INPUT_KXTJ9 is not set
+# CONFIG_INPUT_REGULATOR_HAPTIC is not set
+CONFIG_INPUT_UINPUT=y
+# CONFIG_INPUT_PCF8574 is not set
+# CONFIG_INPUT_ADXL34X is not set
+# CONFIG_INPUT_CMA3000 is not set
+# CONFIG_INPUT_DRV2665_HAPTICS is not set
+# CONFIG_INPUT_DRV2667_HAPTICS is not set
+# CONFIG_RMI4_CORE is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_AMBAKMI is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_SERIO_ALTERA_PS2 is not set
+# CONFIG_SERIO_PS2MULT is not set
+# CONFIG_SERIO_ARC_PS2 is not set
+# CONFIG_SERIO_APBPS2 is not set
+# CONFIG_USERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_TTY=y
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_VT_CONSOLE_SLEEP=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_N_GSM is not set
+# CONFIG_TRACE_SINK is not set
+CONFIG_DEVMEM=y
+# CONFIG_DEVKMEM is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_EARLYCON=y
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_AMBA_PL010 is not set
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+# CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST is not set
+# CONFIG_SERIAL_MAX3100 is not set
+# CONFIG_SERIAL_MAX310X is not set
+# CONFIG_SERIAL_UARTLITE is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_SCCNXP is not set
+# CONFIG_SERIAL_SC16IS7XX is not set
+# CONFIG_SERIAL_BCM63XX is not set
+# CONFIG_SERIAL_ALTERA_JTAGUART is not set
+# CONFIG_SERIAL_ALTERA_UART is not set
+# CONFIG_SERIAL_XILINX_PS_UART is not set
+# CONFIG_SERIAL_ARC is not set
+# CONFIG_SERIAL_FSL_LPUART is not set
+# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set
+# CONFIG_SERIAL_ST_ASC is not set
+# CONFIG_SERIAL_STM32 is not set
+# CONFIG_HVC_DCC is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_XILLYBUS is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_COMPAT=y
+CONFIG_I2C_CHARDEV=y
+# CONFIG_I2C_MUX is not set
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_DESIGNWARE_PLATFORM is not set
+# CONFIG_I2C_EMEV2 is not set
+# CONFIG_I2C_HIBVT is not set
+# CONFIG_I2C_NOMADIK is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_PXA_PCI is not set
+# CONFIG_I2C_RK3X is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_XILINX is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+CONFIG_I2C_HISI=y
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_SLAVE is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_ALTERA is not set
+# CONFIG_SPI_AXI_SPI_ENGINE is not set
+# CONFIG_SPI_BITBANG is not set
+# CONFIG_SPI_CADENCE is not set
+# CONFIG_SPI_DESIGNWARE is not set
+# CONFIG_SPI_FSL_SPI is not set
+CONFIG_SPI_PL022=y
+# CONFIG_SPI_PXA2XX_PCI is not set
+# CONFIG_SPI_ROCKCHIP is not set
+# CONFIG_SPI_SC18IS602 is not set
+# CONFIG_SPI_XCOMM is not set
+# CONFIG_SPI_XILINX is not set
+# CONFIG_SPI_ZYNQMP_GQSPI is not set
+
+#
+# SPI Protocol Masters
+#
+CONFIG_SPI_SPIDEV=y
+# CONFIG_SPI_LOOPBACK_TEST is not set
+# CONFIG_SPI_TLE62X0 is not set
+# CONFIG_SPMI is not set
+# CONFIG_HSI is not set
+
+#
+# PPS support
+#
+# CONFIG_PPS is not set
+
+#
+# PPS generators support
+#
+
+#
+# PTP clock support
+#
+# CONFIG_PTP_1588_CLOCK is not set
+
+#
+# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
+#
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+# CONFIG_GPIOLIB is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_AVS is not set
+CONFIG_POWER_RESET=y
+# CONFIG_POWER_RESET_BRCMKONA is not set
+CONFIG_POWER_RESET_HISI=y
+# CONFIG_POWER_RESET_RESTART is not set
+# CONFIG_POWER_RESET_SYSCON is not set
+# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set
+CONFIG_POWER_SUPPLY=y
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+# CONFIG_TEST_POWER is not set
+# CONFIG_BATTERY_DS2780 is not set
+# CONFIG_BATTERY_DS2781 is not set
+# CONFIG_BATTERY_DS2782 is not set
+# CONFIG_BATTERY_SBS is not set
+# CONFIG_BATTERY_BQ27XXX is not set
+# CONFIG_BATTERY_MAX17040 is not set
+# CONFIG_BATTERY_MAX17042 is not set
+# CONFIG_CHARGER_MAX8903 is not set
+# CONFIG_CHARGER_LP8727 is not set
+# CONFIG_CHARGER_MANAGER is not set
+# CONFIG_CHARGER_BQ2415X is not set
+# CONFIG_CHARGER_SMB347 is not set
+# CONFIG_BATTERY_GAUGE_LTC2941 is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+CONFIG_BCMA_POSSIBLE=y
+
+#
+# Broadcom specific AMBA
+#
+# CONFIG_BCMA is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_ACT8945A is not set
+# CONFIG_MFD_AS3711 is not set
+# CONFIG_MFD_AS3722 is not set
+# CONFIG_PMIC_ADP5520 is not set
+# CONFIG_MFD_ATMEL_FLEXCOM is not set
+# CONFIG_MFD_ATMEL_HLCDC is not set
+# CONFIG_MFD_BCM590XX is not set
+# CONFIG_MFD_AXP20X_I2C is not set
+# CONFIG_MFD_CROS_EC is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_DA9052_SPI is not set
+# CONFIG_MFD_DA9052_I2C is not set
+# CONFIG_MFD_DA9055 is not set
+# CONFIG_MFD_DA9062 is not set
+# CONFIG_MFD_DA9063 is not set
+# CONFIG_MFD_DA9150 is not set
+# CONFIG_MFD_EXYNOS_LPASS is not set
+# CONFIG_MFD_MC13XXX_SPI is not set
+# CONFIG_MFD_MC13XXX_I2C is not set
+# CONFIG_MFD_HI6421_PMIC is not set
+# CONFIG_MFD_HISI_FMC is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_KEMPLD is not set
+# CONFIG_MFD_88PM800 is not set
+# CONFIG_MFD_88PM805 is not set
+# CONFIG_MFD_88PM860X is not set
+# CONFIG_MFD_MAX14577 is not set
+# CONFIG_MFD_MAX77620 is not set
+# CONFIG_MFD_MAX77686 is not set
+# CONFIG_MFD_MAX77693 is not set
+# CONFIG_MFD_MAX77843 is not set
+# CONFIG_MFD_MAX8907 is not set
+# CONFIG_MFD_MAX8925 is not set
+# CONFIG_MFD_MAX8997 is not set
+# CONFIG_MFD_MAX8998 is not set
+# CONFIG_MFD_MT6397 is not set
+# CONFIG_MFD_MENF21BMC is not set
+# CONFIG_EZX_PCAP is not set
+# CONFIG_MFD_RETU is not set
+# CONFIG_MFD_PCF50633 is not set
+# CONFIG_MFD_PM8921_CORE is not set
+# CONFIG_MFD_RT5033 is not set
+# CONFIG_MFD_RC5T583 is not set
+# CONFIG_MFD_RK808 is not set
+# CONFIG_MFD_RN5T618 is not set
+# CONFIG_MFD_SEC_CORE is not set
+# CONFIG_MFD_SI476X_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_SKY81452 is not set
+# CONFIG_MFD_SMSC is not set
+# CONFIG_ABX500_CORE is not set
+# CONFIG_MFD_STMPE is not set
+# CONFIG_MFD_SYSCON is not set
+# CONFIG_MFD_TI_AM335X_TSCADC is not set
+# CONFIG_MFD_LP3943 is not set
+# CONFIG_MFD_LP8788 is not set
+# CONFIG_MFD_PALMAS is not set
+# CONFIG_TPS6105X is not set
+# CONFIG_TPS6507X is not set
+# CONFIG_MFD_TPS65086 is not set
+# CONFIG_MFD_TPS65090 is not set
+# CONFIG_MFD_TPS65217 is not set
+# CONFIG_MFD_TI_LP873X is not set
+# CONFIG_MFD_TPS65218 is not set
+# CONFIG_MFD_TPS6586X is not set
+# CONFIG_MFD_TPS65912_I2C is not set
+# CONFIG_MFD_TPS65912_SPI is not set
+# CONFIG_MFD_TPS80031 is not set
+# CONFIG_TWL4030_CORE is not set
+# CONFIG_TWL6040_CORE is not set
+# CONFIG_MFD_WL1273_CORE is not set
+# CONFIG_MFD_LM3533 is not set
+# CONFIG_MFD_TC3589X is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_MFD_ARIZONA_I2C is not set
+# CONFIG_MFD_ARIZONA_SPI is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM831X_I2C is not set
+# CONFIG_MFD_WM831X_SPI is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_WM8994 is not set
+CONFIG_REGULATOR=y
+# CONFIG_REGULATOR_DEBUG is not set
+# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
+# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
+# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
+# CONFIG_REGULATOR_ACT8865 is not set
+# CONFIG_REGULATOR_AD5398 is not set
+# CONFIG_REGULATOR_DA9210 is not set
+# CONFIG_REGULATOR_DA9211 is not set
+# CONFIG_REGULATOR_FAN53555 is not set
+# CONFIG_REGULATOR_ISL9305 is not set
+# CONFIG_REGULATOR_ISL6271A is not set
+# CONFIG_REGULATOR_LP3971 is not set
+# CONFIG_REGULATOR_LP3972 is not set
+# CONFIG_REGULATOR_LP872X is not set
+# CONFIG_REGULATOR_LP8755 is not set
+# CONFIG_REGULATOR_LTC3589 is not set
+# CONFIG_REGULATOR_LTC3676 is not set
+# CONFIG_REGULATOR_MAX1586 is not set
+# CONFIG_REGULATOR_MAX8649 is not set
+# CONFIG_REGULATOR_MAX8660 is not set
+# CONFIG_REGULATOR_MAX8952 is not set
+# CONFIG_REGULATOR_MT6311 is not set
+# CONFIG_REGULATOR_PFUZE100 is not set
+# CONFIG_REGULATOR_PV88060 is not set
+# CONFIG_REGULATOR_PV88080 is not set
+# CONFIG_REGULATOR_PV88090 is not set
+# CONFIG_REGULATOR_TPS51632 is not set
+# CONFIG_REGULATOR_TPS62360 is not set
+# CONFIG_REGULATOR_TPS65023 is not set
+# CONFIG_REGULATOR_TPS6507X is not set
+# CONFIG_REGULATOR_TPS6524X is not set
+# CONFIG_MEDIA_SUPPORT is not set
+
+#
+# Graphics support
+#
+# CONFIG_IMX_IPUV3_CORE is not set
+# CONFIG_DRM is not set
+
+#
+# ACP (Audio CoProcessor) Configuration
+#
+
+#
+# Frame buffer Devices
+#
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+CONFIG_FB_CMDLINE=y
+CONFIG_FB_NOTIFY=y
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+# CONFIG_FB_CFB_FILLRECT is not set
+# CONFIG_FB_CFB_COPYAREA is not set
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_ARMCLCD is not set
+# CONFIG_FB_OPENCORES is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_IBM_GXT4500 is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_BROADSHEET is not set
+# CONFIG_FB_AUO_K190X is not set
+# CONFIG_FB_SIMPLE is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+# CONFIG_VGASTATE is not set
+
+#
+# Console display driver support
+#
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE is not set
+# CONFIG_LOGO is not set
+# CONFIG_SOUND is not set
+
+#
+# HID support
+#
+# CONFIG_HID is not set
+
+#
+# I2C HID support
+#
+# CONFIG_I2C_HID is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_UWB is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
+CONFIG_EDAC_ATOMIC_SCRUB=y
+CONFIG_EDAC_SUPPORT=y
+# CONFIG_EDAC is not set
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+# CONFIG_DMADEVICES is not set
+
+#
+# DMABUF options
+#
+# CONFIG_SYNC_FILE is not set
+# CONFIG_AUXDISPLAY is not set
+# CONFIG_UIO is not set
+# CONFIG_VIRT_DRIVERS is not set
+
+#
+# Virtio drivers
+#
+# CONFIG_VIRTIO_MMIO is not set
+
+#
+# Microsoft Hyper-V guest support
+#
+# CONFIG_STAGING is not set
+# CONFIG_GOLDFISH is not set
+# CONFIG_CHROME_PLATFORMS is not set
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_HAVE_CLK_PREPARE=y
+CONFIG_COMMON_CLK=y
+
+#
+# Common Clock Framework
+#
+# CONFIG_COMMON_CLK_SI5351 is not set
+# CONFIG_COMMON_CLK_SI514 is not set
+# CONFIG_COMMON_CLK_SI570 is not set
+# CONFIG_COMMON_CLK_CDCE706 is not set
+# CONFIG_COMMON_CLK_CDCE925 is not set
+# CONFIG_COMMON_CLK_CS2000_CP is not set
+# CONFIG_CLK_QORIQ is not set
+# CONFIG_COMMON_CLK_NXP is not set
+# CONFIG_COMMON_CLK_PXA is not set
+# CONFIG_COMMON_CLK_PIC32 is not set
+CONFIG_COMMON_CLK_HI3516A=y
+CONFIG_RESET_HISI=y
+
+#
+# Hardware Spinlock drivers
+#
+
+#
+# Clock Source drivers
+#
+CONFIG_CLKSRC_OF=y
+CONFIG_CLKSRC_PROBE=y
+CONFIG_CLKSRC_MMIO=y
+CONFIG_ARM_ARCH_TIMER=y
+CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
+CONFIG_ARM_TIMER_SP804=y
+# CONFIG_ATMEL_PIT is not set
+# CONFIG_SH_TIMER_CMT is not set
+# CONFIG_SH_TIMER_MTU2 is not set
+# CONFIG_SH_TIMER_TMU is not set
+# CONFIG_EM_TIMER_STI is not set
+# CONFIG_MAILBOX is not set
+# CONFIG_IOMMU_SUPPORT is not set
+
+#
+# Remoteproc drivers
+#
+# CONFIG_STE_MODEM_RPROC is not set
+
+#
+# Rpmsg drivers
+#
+
+#
+# SOC (System On Chip) specific Drivers
+#
+
+#
+# Broadcom SoC drivers
+#
+# CONFIG_SOC_BRCMSTB is not set
+# CONFIG_SUNXI_SRAM is not set
+# CONFIG_SOC_TI is not set
+# CONFIG_PM_DEVFREQ is not set
+# CONFIG_EXTCON is not set
+# CONFIG_MEMORY is not set
+# CONFIG_IIO is not set
+# CONFIG_PWM is not set
+CONFIG_IRQCHIP=y
+CONFIG_ARM_GIC=y
+CONFIG_ARM_GIC_MAX_NR=1
+# CONFIG_IPACK_BUS is not set
+CONFIG_ARCH_HAS_RESET_CONTROLLER=y
+CONFIG_RESET_CONTROLLER=y
+# CONFIG_RESET_ATH79 is not set
+# CONFIG_RESET_BERLIN is not set
+# CONFIG_RESET_LPC18XX is not set
+# CONFIG_RESET_MESON is not set
+# CONFIG_RESET_PISTACHIO is not set
+# CONFIG_RESET_SOCFPGA is not set
+# CONFIG_RESET_STM32 is not set
+# CONFIG_RESET_SUNXI is not set
+# CONFIG_TI_SYSCON_RESET is not set
+# CONFIG_RESET_ZYNQ is not set
+# CONFIG_FMC is not set
+
+#
+# PHY Subsystem
+#
+CONFIG_GENERIC_PHY=y
+# CONFIG_PHY_PXA_28NM_HSIC is not set
+# CONFIG_PHY_PXA_28NM_USB2 is not set
+# CONFIG_BCM_KONA_USB2_PHY is not set
+CONFIG_PHY_HISI_USB2=y
+# CONFIG_POWERCAP is not set
+# CONFIG_MCB is not set
+
+#
+# Performance monitor support
+#
+# CONFIG_RAS is not set
+
+#
+# Android
+#
+# CONFIG_ANDROID is not set
+# CONFIG_NVMEM is not set
+# CONFIG_STM is not set
+# CONFIG_INTEL_TH is not set
+
+#
+# FPGA Configuration Support
+#
+# CONFIG_FPGA is not set
+# CONFIG_HI_DMAC is not set
+
+#
+# Firmware Drivers
+#
+# CONFIG_FIRMWARE_MEMMAP is not set
+# CONFIG_FW_CFG_SYSFS is not set
+CONFIG_HAVE_ARM_SMCCC=y
+
+#
+# File systems
+#
+CONFIG_DCACHE_WORD_ACCESS=y
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+CONFIG_EXT4_FS=y
+CONFIG_EXT4_USE_FOR_EXT2=y
+# CONFIG_EXT4_FS_POSIX_ACL is not set
+# CONFIG_EXT4_FS_SECURITY is not set
+# CONFIG_EXT4_ENCRYPTION is not set
+# CONFIG_EXT4_DEBUG is not set
+CONFIG_JBD2=y
+# CONFIG_JBD2_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+# CONFIG_NILFS2_FS is not set
+# CONFIG_F2FS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_EXPORTFS=y
+# CONFIG_EXPORTFS_BLOCK_OPS is not set
+CONFIG_FILE_LOCKING=y
+CONFIG_MANDATORY_FILE_LOCKING=y
+# CONFIG_FS_ENCRYPTION is not set
+CONFIG_FSNOTIFY=y
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_FANOTIFY is not set
+# CONFIG_QUOTA is not set
+# CONFIG_QUOTACTL is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+# CONFIG_OVERLAY_FS is not set
+
+#
+# Caches
+#
+# CONFIG_FSCACHE is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_FAT_DEFAULT_UTF8 is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+# CONFIG_PROC_CHILDREN is not set
+CONFIG_KERNFS=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_TMPFS_XATTR is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_CONFIGFS_FS=m
+CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ORANGEFS_FS is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_ECRYPT_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_YAFFS_FS=y
+CONFIG_YAFFS_YAFFS1=y
+# CONFIG_YAFFS_9BYTE_TAGS is not set
+# CONFIG_YAFFS_DOES_ECC is not set
+CONFIG_YAFFS_YAFFS2=y
+CONFIG_YAFFS_AUTO_YAFFS2=y
+# CONFIG_YAFFS_DISABLE_TAGS_ECC is not set
+# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
+# CONFIG_YAFFS_EMPTY_LOST_AND_FOUND is not set
+# CONFIG_YAFFS_DISABLE_BLOCK_REFRESHING is not set
+# CONFIG_YAFFS_DISABLE_BACKGROUND is not set
+# CONFIG_YAFFS_DISABLE_BAD_BLOCK_MARKING is not set
+CONFIG_YAFFS_XATTR=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_LOGFS is not set
+CONFIG_CRAMFS=y
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX6FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_PSTORE is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V2=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+# CONFIG_NFS_SWAP is not set
+# CONFIG_NFS_V4_1 is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFS_USE_LEGACY_DNS is not set
+CONFIG_NFS_USE_KERNEL_DNS=y
+# CONFIG_NFSD is not set
+CONFIG_GRACE_PERIOD=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_DEBUG is not set
+# CONFIG_CEPH_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_MAC_ROMAN is not set
+# CONFIG_NLS_MAC_CELTIC is not set
+# CONFIG_NLS_MAC_CENTEURO is not set
+# CONFIG_NLS_MAC_CROATIAN is not set
+# CONFIG_NLS_MAC_CYRILLIC is not set
+# CONFIG_NLS_MAC_GAELIC is not set
+# CONFIG_NLS_MAC_GREEK is not set
+# CONFIG_NLS_MAC_ICELAND is not set
+# CONFIG_NLS_MAC_INUIT is not set
+# CONFIG_NLS_MAC_ROMANIAN is not set
+# CONFIG_NLS_MAC_TURKISH is not set
+CONFIG_NLS_UTF8=y
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+
+#
+# printk and dmesg options
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4
+# CONFIG_BOOT_PRINTK_DELAY is not set
+
+#
+# Compile-time checks and compiler options
+#
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=1024
+# CONFIG_STRIP_ASM_SYMS is not set
+# CONFIG_READABLE_ASM is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_PAGE_OWNER is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_SECTION_MISMATCH is not set
+CONFIG_SECTION_MISMATCH_WARN_ONLY=y
+CONFIG_FRAME_POINTER=y
+# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
+# CONFIG_MAGIC_SYSRQ is not set
+CONFIG_DEBUG_KERNEL=y
+
+#
+# Memory Debugging
+#
+# CONFIG_PAGE_EXTENSION is not set
+# CONFIG_PAGE_POISONING is not set
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS is not set
+CONFIG_HAVE_DEBUG_KMEMLEAK=y
+# CONFIG_DEBUG_KMEMLEAK is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_VM is not set
+CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_DEBUG_SHIRQ is not set
+
+#
+# Debug Lockups and Hangs
+#
+# CONFIG_LOCKUP_DETECTOR is not set
+# CONFIG_DETECT_HUNG_TASK is not set
+# CONFIG_WQ_WATCHDOG is not set
+# CONFIG_PANIC_ON_OOPS is not set
+CONFIG_PANIC_ON_OOPS_VALUE=0
+CONFIG_PANIC_TIMEOUT=0
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_SCHED_INFO is not set
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_SCHED_STACK_END_CHECK is not set
+# CONFIG_DEBUG_TIMEKEEPING is not set
+# CONFIG_TIMER_STATS is not set
+
+#
+# Lock Debugging (spinlocks, mutexes, etc...)
+#
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_ATOMIC_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_LOCK_TORTURE_TEST is not set
+CONFIG_STACKTRACE=y
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_PI_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_DEBUG_CREDENTIALS is not set
+
+#
+# RCU Debugging
+#
+# CONFIG_PROVE_RCU is not set
+# CONFIG_SPARSE_RCU_POINTER is not set
+# CONFIG_TORTURE_TEST is not set
+# CONFIG_RCU_PERF_TEST is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_TRACE is not set
+# CONFIG_RCU_EQS_DEBUG is not set
+# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_NOTIFIER_ERROR_INJECTION is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_TRACING_SUPPORT=y
+# CONFIG_FTRACE is not set
+
+#
+# Runtime Testing
+#
+# CONFIG_TEST_LIST_SORT is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_RBTREE_TEST is not set
+# CONFIG_INTERVAL_TREE_TEST is not set
+# CONFIG_PERCPU_TEST is not set
+# CONFIG_ATOMIC64_SELFTEST is not set
+# CONFIG_TEST_HEXDUMP is not set
+# CONFIG_TEST_STRING_HELPERS is not set
+# CONFIG_TEST_KSTRTOX is not set
+# CONFIG_TEST_PRINTF is not set
+# CONFIG_TEST_BITMAP is not set
+# CONFIG_TEST_UUID is not set
+# CONFIG_TEST_RHASHTABLE is not set
+# CONFIG_TEST_HASH is not set
+# CONFIG_DMA_API_DEBUG is not set
+# CONFIG_TEST_LKM is not set
+# CONFIG_TEST_USER_COPY is not set
+# CONFIG_TEST_BPF is not set
+# CONFIG_TEST_FIRMWARE is not set
+# CONFIG_TEST_UDELAY is not set
+# CONFIG_MEMTEST is not set
+# CONFIG_TEST_STATIC_KEYS is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+# CONFIG_ARCH_WANTS_UBSAN_NO_NULL is not set
+# CONFIG_UBSAN is not set
+CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y
+CONFIG_STRICT_DEVMEM=y
+# CONFIG_IO_STRICT_DEVMEM is not set
+# CONFIG_ARM_PTDUMP is not set
+# CONFIG_ARM_UNWIND is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_LL is not set
+CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
+# CONFIG_DEBUG_UART_8250 is not set
+CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
+# CONFIG_PID_IN_CONTEXTIDR is not set
+# CONFIG_DEBUG_SET_MODULE_RONX is not set
+# CONFIG_CORESIGHT is not set
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_PERSISTENT_KEYRINGS is not set
+# CONFIG_ENCRYPTED_KEYS is not set
+# CONFIG_KEY_DH_OPERATIONS is not set
+# CONFIG_SECURITY_DMESG_RESTRICT is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y
+CONFIG_HAVE_ARCH_HARDENED_USERCOPY=y
+# CONFIG_HARDENED_USERCOPY is not set
+CONFIG_DEFAULT_SECURITY_DAC=y
+CONFIG_DEFAULT_SECURITY=""
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG=m
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_RNG_DEFAULT=m
+CONFIG_CRYPTO_AKCIPHER2=y
+CONFIG_CRYPTO_KPP2=y
+# CONFIG_CRYPTO_RSA is not set
+# CONFIG_CRYPTO_DH is not set
+# CONFIG_CRYPTO_ECDH is not set
+CONFIG_CRYPTO_MANAGER=m
+CONFIG_CRYPTO_MANAGER2=y
+# CONFIG_CRYPTO_USER is not set
+CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_NULL2=y
+CONFIG_CRYPTO_WORKQUEUE=y
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_MCRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+CONFIG_CRYPTO_CCM=m
+CONFIG_CRYPTO_GCM=m
+# CONFIG_CRYPTO_CHACHA20POLY1305 is not set
+CONFIG_CRYPTO_SEQIV=m
+CONFIG_CRYPTO_ECHAINIV=m
+
+#
+# Block modes
+#
+# CONFIG_CRYPTO_CBC is not set
+CONFIG_CRYPTO_CTR=m
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+# CONFIG_CRYPTO_KEYWRAP is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_CMAC is not set
+CONFIG_CRYPTO_HMAC=m
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_VMAC is not set
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+# CONFIG_CRYPTO_CRC32 is not set
+CONFIG_CRYPTO_CRCT10DIF=y
+CONFIG_CRYPTO_GHASH=m
+# CONFIG_CRYPTO_POLY1305 is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+CONFIG_CRYPTO_SHA1=y
+CONFIG_CRYPTO_SHA256=y
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_SHA3 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=y
+# CONFIG_CRYPTO_ANUBIS is not set
+CONFIG_CRYPTO_ARC4=y
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_CHACHA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_LZO=y
+# CONFIG_CRYPTO_842 is not set
+# CONFIG_CRYPTO_LZ4 is not set
+# CONFIG_CRYPTO_LZ4HC is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_DRBG_MENU=m
+CONFIG_CRYPTO_DRBG_HMAC=y
+# CONFIG_CRYPTO_DRBG_HASH is not set
+# CONFIG_CRYPTO_DRBG_CTR is not set
+CONFIG_CRYPTO_DRBG=m
+CONFIG_CRYPTO_JITTERENTROPY=m
+# CONFIG_CRYPTO_USER_API_HASH is not set
+# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
+# CONFIG_CRYPTO_USER_API_RNG is not set
+# CONFIG_CRYPTO_USER_API_AEAD is not set
+# CONFIG_CRYPTO_HW is not set
+# CONFIG_ASYMMETRIC_KEY_TYPE is not set
+
+#
+# Certificates for signature checking
+#
+# CONFIG_ARM_CRYPTO is not set
+# CONFIG_BINARY_PRINTF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_HAVE_ARCH_BITREVERSE=y
+CONFIG_RATIONAL=y
+CONFIG_GENERIC_STRNCPY_FROM_USER=y
+CONFIG_GENERIC_STRNLEN_USER=y
+CONFIG_GENERIC_NET_UTILS=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_IO=y
+CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
+CONFIG_CRC_CCITT=y
+CONFIG_CRC16=y
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC32=y
+# CONFIG_CRC32_SELFTEST is not set
+CONFIG_CRC32_SLICEBY8=y
+# CONFIG_CRC32_SLICEBY4 is not set
+# CONFIG_CRC32_SARWATE is not set
+# CONFIG_CRC32_BIT is not set
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=y
+# CONFIG_CRC8 is not set
+# CONFIG_AUDIT_ARCH_COMPAT_GENERIC is not set
+# CONFIG_RANDOM32_SELFTEST is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_LZ4_DECOMPRESS=y
+CONFIG_XZ_DEC=y
+CONFIG_XZ_DEC_X86=y
+CONFIG_XZ_DEC_POWERPC=y
+CONFIG_XZ_DEC_IA64=y
+CONFIG_XZ_DEC_ARM=y
+CONFIG_XZ_DEC_ARMTHUMB=y
+CONFIG_XZ_DEC_SPARC=y
+CONFIG_XZ_DEC_BCJ=y
+# CONFIG_XZ_DEC_TEST is not set
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_DECOMPRESS_LZ4=y
+CONFIG_GENERIC_ALLOCATOR=y
+CONFIG_ASSOCIATIVE_ARRAY=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT_MAP=y
+CONFIG_HAS_DMA=y
+CONFIG_DQL=y
+CONFIG_NLATTR=y
+# CONFIG_CORDIC is not set
+# CONFIG_DDR is not set
+# CONFIG_IRQ_POLL is not set
+CONFIG_LIBFDT=y
+CONFIG_OID_REGISTRY=y
+# CONFIG_SG_SPLIT is not set
+# CONFIG_SG_POOL is not set
+CONFIG_ARCH_HAS_SG_CHAIN=y
+CONFIG_SBITMAP=y
+# CONFIG_VIRTUALIZATION is not set
diff --git a/arch/arm/configs/hi3516a_spinand_defconfig b/arch/arm/configs/hi3516a_spinand_defconfig
new file mode 100644
index 0000000..e825897
--- /dev/null
+++ b/arch/arm/configs/hi3516a_spinand_defconfig
@@ -0,0 +1,2718 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Linux/arm 4.9.37 Kernel Configuration
+#
+CONFIG_ARM=y
+CONFIG_ARM_HAS_SG_CHAIN=y
+CONFIG_MIGHT_HAVE_PCI=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_HAVE_PROC_CPU=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_FIX_EARLYCON_MEM=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_ARCH_SUPPORTS_UPROBES=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_ARM_PATCH_PHYS_VIRT=y
+CONFIG_GENERIC_BUG=y
+CONFIG_PGTABLE_LEVELS=2
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_IRQ_WORK=y
+CONFIG_BUILDTIME_EXTABLE_SORT=y
+
+#
+# General setup
+#
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_CROSS_COMPILE=""
+# CONFIG_COMPILE_TEST is not set
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_HAVE_KERNEL_GZIP=y
+CONFIG_HAVE_KERNEL_LZMA=y
+CONFIG_HAVE_KERNEL_XZ=y
+CONFIG_HAVE_KERNEL_LZO=y
+CONFIG_HAVE_KERNEL_LZ4=y
+CONFIG_KERNEL_GZIP=y
+# CONFIG_KERNEL_LZMA is not set
+# CONFIG_KERNEL_XZ is not set
+# CONFIG_KERNEL_LZO is not set
+# CONFIG_KERNEL_LZ4 is not set
+CONFIG_DEFAULT_HOSTNAME="(none)"
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+CONFIG_CROSS_MEMORY_ATTACH=y
+CONFIG_FHANDLE=y
+CONFIG_USELIB=y
+# CONFIG_AUDIT is not set
+CONFIG_HAVE_ARCH_AUDITSYSCALL=y
+
+#
+# IRQ subsystem
+#
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_IRQ_DOMAIN=y
+CONFIG_IRQ_DOMAIN_HIERARCHY=y
+CONFIG_HANDLE_DOMAIN_IRQ=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_SPARSE_IRQ=y
+CONFIG_ARCH_CLOCKSOURCE_DATA=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+
+#
+# Timers subsystem
+#
+CONFIG_HZ_PERIODIC=y
+# CONFIG_NO_HZ_IDLE is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+
+#
+# CPU/Task time and stats accounting
+#
+CONFIG_TICK_CPU_ACCOUNTING=y
+# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set
+CONFIG_IRQ_TIME_ACCOUNTING=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_TINY_RCU=y
+# CONFIG_RCU_EXPERT is not set
+CONFIG_SRCU=y
+# CONFIG_TASKS_RCU is not set
+# CONFIG_RCU_STALL_COMMON is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_RCU_EXPEDITE_BOOT is not set
+# CONFIG_BUILD_BIN2C is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=17
+CONFIG_NMI_LOG_BUF_SHIFT=13
+CONFIG_GENERIC_SCHED_CLOCK=y
+CONFIG_CGROUPS=y
+# CONFIG_MEMCG is not set
+# CONFIG_BLK_CGROUP is not set
+# CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUP_PIDS is not set
+CONFIG_CGROUP_FREEZER=y
+# CONFIG_CPUSETS is not set
+# CONFIG_CGROUP_DEVICE is not set
+# CONFIG_CGROUP_CPUACCT is not set
+# CONFIG_CGROUP_DEBUG is not set
+# CONFIG_CHECKPOINT_RESTORE is not set
+CONFIG_NAMESPACES=y
+CONFIG_UTS_NS=y
+CONFIG_IPC_NS=y
+# CONFIG_USER_NS is not set
+CONFIG_PID_NS=y
+CONFIG_NET_NS=y
+# CONFIG_SCHED_AUTOGROUP is not set
+# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
+# CONFIG_RD_XZ is not set
+# CONFIG_RD_LZO is not set
+CONFIG_RD_LZ4=y
+CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_HAVE_UID16=y
+CONFIG_BPF=y
+# CONFIG_EXPERT is not set
+CONFIG_UID16=y
+CONFIG_MULTIUSER=y
+# CONFIG_SGETMASK_SYSCALL is not set
+CONFIG_SYSFS_SYSCALL=y
+# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_ABSOLUTE_PERCPU is not set
+CONFIG_KALLSYMS_BASE_RELATIVE=y
+CONFIG_PRINTK=y
+CONFIG_PRINTK_NMI=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+# CONFIG_BPF_SYSCALL is not set
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_ADVISE_SYSCALLS=y
+# CONFIG_USERFAULTFD is not set
+CONFIG_MEMBARRIER=y
+# CONFIG_EMBEDDED is not set
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_PERF_USE_VMALLOC=y
+
+#
+# Kernel Performance Events And Counters
+#
+# CONFIG_PERF_EVENTS is not set
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+CONFIG_COMPAT_BRK=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLAB_FREELIST_RANDOM is not set
+# CONFIG_SYSTEM_DATA_VERIFICATION is not set
+# CONFIG_PROFILING is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+# CONFIG_JUMP_LABEL is not set
+# CONFIG_UPROBES is not set
+# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_ARCH_USE_BUILTIN_BSWAP=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_OPTPROBES=y
+CONFIG_HAVE_NMI=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+CONFIG_HAVE_DMA_CONTIGUOUS=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GENERIC_IDLE_POLL_SETUP=y
+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_PERF_REGS=y
+CONFIG_HAVE_PERF_USER_STACK_DUMP=y
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
+CONFIG_HAVE_GCC_PLUGINS=y
+# CONFIG_GCC_PLUGINS is not set
+CONFIG_HAVE_CC_STACKPROTECTOR=y
+# CONFIG_CC_STACKPROTECTOR is not set
+CONFIG_CC_STACKPROTECTOR_NONE=y
+# CONFIG_CC_STACKPROTECTOR_REGULAR is not set
+# CONFIG_CC_STACKPROTECTOR_STRONG is not set
+CONFIG_HAVE_CONTEXT_TRACKING=y
+CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
+CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
+CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
+CONFIG_MODULES_USE_ELF_REL=y
+CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
+CONFIG_HAVE_ARCH_MMAP_RND_BITS=y
+CONFIG_HAVE_EXIT_THREAD=y
+CONFIG_ARCH_MMAP_RND_BITS_MIN=8
+CONFIG_ARCH_MMAP_RND_BITS_MAX=16
+CONFIG_ARCH_MMAP_RND_BITS=8
+# CONFIG_HAVE_ARCH_HASH is not set
+# CONFIG_ISA_BUS_API is not set
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_OLD_SIGSUSPEND3=y
+CONFIG_OLD_SIGACTION=y
+# CONFIG_CPU_NO_EFFICIENT_FFS is not set
+# CONFIG_HAVE_ARCH_VMAP_STACK is not set
+
+#
+# GCOV-based kernel profiling
+#
+CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+# CONFIG_MODULE_SIG is not set
+# CONFIG_MODULE_COMPRESS is not set
+# CONFIG_TRIM_UNUSED_KSYMS is not set
+CONFIG_BLOCK=y
+CONFIG_LBDAF=y
+CONFIG_BLK_DEV_BSG=y
+# CONFIG_BLK_DEV_BSGLIB is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+CONFIG_BLK_CMDLINE_PARSER=y
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_AIX_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+CONFIG_EFI_PARTITION=y
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_CMDLINE_PARTITION=y
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_DEADLINE=y
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="deadline"
+CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
+CONFIG_INLINE_READ_UNLOCK=y
+CONFIG_INLINE_READ_UNLOCK_IRQ=y
+CONFIG_INLINE_WRITE_UNLOCK=y
+CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
+CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
+CONFIG_FREEZER=y
+
+#
+# System Type
+#
+CONFIG_MMU=y
+CONFIG_ARCH_MULTIPLATFORM=y
+# CONFIG_ARCH_GEMINI is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_DOVE is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_W90X900 is not set
+# CONFIG_ARCH_LPC32XX is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C24XX is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP1 is not set
+
+#
+# Multiple platform selection
+#
+
+#
+# CPU Core family selection
+#
+# CONFIG_ARCH_MULTI_V6 is not set
+CONFIG_ARCH_MULTI_V7=y
+CONFIG_ARCH_MULTI_V6_V7=y
+# CONFIG_ARCH_MULTI_CPU_AUTO is not set
+# CONFIG_ARCH_VIRT is not set
+# CONFIG_ARCH_MVEBU is not set
+# CONFIG_ARCH_ALPINE is not set
+# CONFIG_ARCH_ARTPEC is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_BCM is not set
+# CONFIG_ARCH_BERLIN is not set
+# CONFIG_ARCH_DIGICOLOR is not set
+# CONFIG_ARCH_HIGHBANK is not set
+# CONFIG_ARCH_HISI is not set
+CONFIG_ARCH_HISI_BVT=y
+
+#
+# Hisilicon BVT platform type
+#
+CONFIG_HI_ZRELADDR=0x80008000
+CONFIG_HI_PARAMS_PHYS=0x00000100
+CONFIG_HI_INITRD_PHYS=0x00800000
+CONFIG_ARCH_HI3516A=y
+# CONFIG_ARCH_HI3536DV100 is not set
+# CONFIG_ARCH_KEYSTONE is not set
+# CONFIG_ARCH_MESON is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_MEDIATEK is not set
+
+#
+# TI OMAP/AM/DM/DRA Family
+#
+# CONFIG_ARCH_OMAP3 is not set
+# CONFIG_ARCH_OMAP4 is not set
+# CONFIG_SOC_OMAP5 is not set
+# CONFIG_SOC_AM33XX is not set
+# CONFIG_SOC_AM43XX is not set
+# CONFIG_SOC_DRA7XX is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_QCOM is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_ROCKCHIP is not set
+# CONFIG_ARCH_SOCFPGA is not set
+# CONFIG_PLAT_SPEAR is not set
+# CONFIG_ARCH_STI is not set
+# CONFIG_ARCH_S5PV210 is not set
+# CONFIG_ARCH_EXYNOS is not set
+# CONFIG_ARCH_RENESAS is not set
+# CONFIG_ARCH_SUNXI is not set
+# CONFIG_ARCH_SIRF is not set
+# CONFIG_ARCH_TANGO is not set
+# CONFIG_ARCH_TEGRA is not set
+# CONFIG_ARCH_UNIPHIER is not set
+# CONFIG_ARCH_U8500 is not set
+# CONFIG_ARCH_VEXPRESS is not set
+# CONFIG_ARCH_WM8850 is not set
+# CONFIG_ARCH_ZX is not set
+# CONFIG_ARCH_ZYNQ is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_V7=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_PABRT_V7=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+# CONFIG_ARM_LPAE is not set
+# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
+CONFIG_ARM_THUMB=y
+# CONFIG_ARM_THUMBEE is not set
+CONFIG_ARM_VIRT_EXT=y
+# CONFIG_SWP_EMULATE is not set
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_KUSER_HELPERS=y
+CONFIG_VDSO=y
+CONFIG_MIGHT_HAVE_CACHE_L2X0=y
+# CONFIG_CACHE_L2X0 is not set
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
+CONFIG_ARM_L1_CACHE_SHIFT=6
+CONFIG_ARM_DMA_MEM_BUFFERABLE=y
+# CONFIG_DEBUG_RODATA is not set
+CONFIG_MULTI_IRQ_HANDLER=y
+# CONFIG_ARM_ERRATA_430973 is not set
+# CONFIG_ARM_ERRATA_720789 is not set
+# CONFIG_ARM_ERRATA_754322 is not set
+# CONFIG_ARM_ERRATA_775420 is not set
+# CONFIG_ARM_ERRATA_773022 is not set
+# CONFIG_ARM_ERRATA_818325_852422 is not set
+# CONFIG_ARM_ERRATA_821420 is not set
+# CONFIG_ARM_ERRATA_825619 is not set
+# CONFIG_ARM_ERRATA_852421 is not set
+# CONFIG_ARM_ERRATA_852423 is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI is not set
+# CONFIG_PCI_DOMAINS_GENERIC is not set
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_HAVE_SMP=y
+# CONFIG_SMP is not set
+CONFIG_HAVE_ARM_ARCH_TIMER=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_3G_OPT is not set
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_ARM_PSCI is not set
+CONFIG_ARCH_NR_GPIO=0
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_HZ_FIXED=0
+CONFIG_HZ_100=y
+# CONFIG_HZ_200 is not set
+# CONFIG_HZ_250 is not set
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_500 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=100
+# CONFIG_SCHED_HRTICK is not set
+# CONFIG_THUMB2_KERNEL is not set
+CONFIG_ARM_PATCH_IDIV=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+CONFIG_HAVE_ARCH_PFN_VALID=y
+# CONFIG_HIGHMEM is not set
+# CONFIG_CPU_SW_DOMAIN_PAN is not set
+CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
+# CONFIG_ARM_MODULE_PLTS is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_NO_BOOTMEM=y
+# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_COMPACTION=y
+CONFIG_MIGRATION=y
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+# CONFIG_KSM is not set
+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
+CONFIG_NEED_PER_CPU_KM=y
+# CONFIG_CLEANCACHE is not set
+# CONFIG_FRONTSWAP is not set
+# CONFIG_CMA is not set
+# CONFIG_ZPOOL is not set
+# CONFIG_ZBUD is not set
+# CONFIG_ZSMALLOC is not set
+CONFIG_GENERIC_EARLY_IOREMAP=y
+# CONFIG_IDLE_PAGE_TRACKING is not set
+CONFIG_FORCE_MAX_ZONEORDER=11
+CONFIG_ALIGNMENT_TRAP=y
+# CONFIG_UACCESS_WITH_MEMCPY is not set
+# CONFIG_SECCOMP is not set
+CONFIG_SWIOTLB=y
+CONFIG_IOMMU_HELPER=y
+# CONFIG_PARAVIRT is not set
+# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
+# CONFIG_XEN is not set
+
+#
+# Boot options
+#
+CONFIG_USE_OF=y
+CONFIG_ATAGS=y
+# CONFIG_DEPRECATED_PARAM_STRUCT is not set
+CONFIG_ZBOOT_ROM_TEXT=0
+CONFIG_ZBOOT_ROM_BSS=0
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_ARM_ATAG_DTB_COMPAT=y
+CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y
+# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set
+CONFIG_CMDLINE=""
+# CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
+CONFIG_AUTO_ZRELADDR=y
+# CONFIG_EFI is not set
+
+#
+# CPU Power Management
+#
+
+#
+# CPU Frequency scaling
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_GOV_ATTR_SET=y
+CONFIG_CPU_FREQ_GOV_COMMON=y
+CONFIG_CPU_FREQ_STAT=y
+# CONFIG_CPU_FREQ_STAT_DETAILS is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+
+#
+# CPU frequency scaling drivers
+#
+CONFIG_CPUFREQ_DT=y
+CONFIG_CPUFREQ_DT_PLATDEV=y
+# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set
+# CONFIG_QORIQ_CPUFREQ is not set
+
+#
+# CPU Idle
+#
+# CONFIG_CPU_IDLE is not set
+# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+# CONFIG_KERNEL_MODE_NEON is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_ELFCORE=y
+CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
+CONFIG_BINFMT_SCRIPT=y
+# CONFIG_BINFMT_FLAT is not set
+# CONFIG_HAVE_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+CONFIG_COREDUMP=y
+
+#
+# Power management options
+#
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+CONFIG_HIBERNATE_CALLBACKS=y
+CONFIG_HIBERNATION=y
+CONFIG_PM_STD_PARTITION=""
+CONFIG_PM_SLEEP=y
+# CONFIG_PM_AUTOSLEEP is not set
+# CONFIG_PM_WAKELOCKS is not set
+CONFIG_PM=y
+CONFIG_PM_DEBUG=y
+# CONFIG_PM_ADVANCED_DEBUG is not set
+CONFIG_PM_SLEEP_DEBUG=y
+# CONFIG_APM_EMULATION is not set
+CONFIG_PM_OPP=y
+CONFIG_PM_CLK=y
+# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
+CONFIG_CPU_PM=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARM_CPU_SUSPEND=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_DIAG is not set
+CONFIG_UNIX=y
+# CONFIG_UNIX_DIAG is not set
+CONFIG_XFRM=y
+CONFIG_XFRM_ALGO=y
+CONFIG_XFRM_USER=y
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+CONFIG_NET_KEY=y
+# CONFIG_NET_KEY_MIGRATE is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+# CONFIG_IP_FIB_TRIE_STATS is not set
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_VERBOSE=y
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE_DEMUX is not set
+# CONFIG_NET_IP_TUNNEL is not set
+CONFIG_IP_MROUTE=y
+# CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+CONFIG_SYN_COOKIES=y
+# CONFIG_NET_UDP_TUNNEL is not set
+# CONFIG_NET_FOU is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_INET_UDP_DIAG is not set
+# CONFIG_INET_DIAG_DESTROY is not set
+CONFIG_TCP_CONG_ADVANCED=y
+CONFIG_TCP_CONG_BIC=m
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+# CONFIG_TCP_CONG_HSTCP is not set
+# CONFIG_TCP_CONG_HYBLA is not set
+# CONFIG_TCP_CONG_VEGAS is not set
+# CONFIG_TCP_CONG_NV is not set
+# CONFIG_TCP_CONG_SCALABLE is not set
+# CONFIG_TCP_CONG_LP is not set
+# CONFIG_TCP_CONG_VENO is not set
+# CONFIG_TCP_CONG_YEAH is not set
+# CONFIG_TCP_CONG_ILLINOIS is not set
+# CONFIG_TCP_CONG_DCTCP is not set
+# CONFIG_TCP_CONG_CDG is not set
+# CONFIG_TCP_CONG_BBR is not set
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
+CONFIG_TCP_MD5SIG=y
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NET_PTP_CLASSIFY is not set
+# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_RDS is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_L2TP is not set
+# CONFIG_BRIDGE is not set
+CONFIG_HAVE_NET_DSA=y
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_PHONET is not set
+# CONFIG_IEEE802154 is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+CONFIG_DNS_RESOLVER=y
+# CONFIG_BATMAN_ADV is not set
+# CONFIG_OPENVSWITCH is not set
+# CONFIG_VSOCKETS is not set
+# CONFIG_NETLINK_DIAG is not set
+# CONFIG_MPLS is not set
+# CONFIG_HSR is not set
+# CONFIG_NET_SWITCHDEV is not set
+# CONFIG_NET_L3_MASTER_DEV is not set
+# CONFIG_NET_NCSI is not set
+# CONFIG_SOCK_CGROUP_DATA is not set
+# CONFIG_CGROUP_NET_PRIO is not set
+# CONFIG_CGROUP_NET_CLASSID is not set
+CONFIG_NET_RX_BUSY_POLL=y
+CONFIG_BQL=y
+# CONFIG_BPF_JIT is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_AF_KCM is not set
+# CONFIG_STREAM_PARSER is not set
+CONFIG_FIB_RULES=y
+CONFIG_WIRELESS=y
+CONFIG_WEXT_CORE=y
+CONFIG_WEXT_PROC=y
+CONFIG_CFG80211=m
+# CONFIG_NL80211_TESTMODE is not set
+# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
+CONFIG_CFG80211_DEFAULT_PS=y
+# CONFIG_CFG80211_INTERNAL_REGDB is not set
+CONFIG_CFG80211_CRDA_SUPPORT=y
+CONFIG_CFG80211_WEXT=y
+# CONFIG_LIB80211 is not set
+CONFIG_MAC80211=m
+CONFIG_MAC80211_HAS_RC=y
+CONFIG_MAC80211_RC_MINSTREL=y
+CONFIG_MAC80211_RC_MINSTREL_HT=y
+# CONFIG_MAC80211_RC_MINSTREL_VHT is not set
+CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
+CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
+CONFIG_MAC80211_MESH=y
+# CONFIG_MAC80211_MESSAGE_TRACING is not set
+# CONFIG_MAC80211_DEBUG_MENU is not set
+CONFIG_MAC80211_STA_HASH_MAX_SIZE=0
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_RFKILL_REGULATOR is not set
+# CONFIG_NET_9P is not set
+# CONFIG_CAIF is not set
+# CONFIG_CEPH_LIB is not set
+# CONFIG_NFC is not set
+# CONFIG_LWTUNNEL is not set
+# CONFIG_DST_CACHE is not set
+# CONFIG_NET_DEVLINK is not set
+CONFIG_MAY_USE_DEVLINK=y
+CONFIG_HAVE_CBPF_JIT=y
+
+#
+# Device Drivers
+#
+CONFIG_ARM_AMBA=y
+
+#
+# Generic Driver Options
+#
+# CONFIG_UEVENT_HELPER is not set
+CONFIG_DEVTMPFS=y
+# CONFIG_DEVTMPFS_MOUNT is not set
+CONFIG_STANDALONE=y
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
+CONFIG_ALLOW_DEV_COREDUMP=y
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_GENERIC_CPU_DEVICES is not set
+# CONFIG_DMA_SHARED_BUFFER is not set
+
+#
+# Bus devices
+#
+# CONFIG_BRCMSTB_GISB_ARB is not set
+# CONFIG_VEXPRESS_CONFIG is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_TESTS is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+CONFIG_MTD_OF_PARTS=y
+# CONFIG_MTD_AR7_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_SM_FTL is not set
+# CONFIG_MTD_OOPS is not set
+# CONFIG_MTD_SWAP is not set
+# CONFIG_MTD_PARTITIONED_MASTER is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 is not set
+# CONFIG_MTD_SST25L is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOCG3 is not set
+CONFIG_MTD_NAND_ECC=y
+# CONFIG_MTD_NAND_ECC_SMC is not set
+CONFIG_MTD_NAND=y
+# CONFIG_MTD_NAND_ECC_BCH is not set
+# CONFIG_MTD_SM_COMMON is not set
+# CONFIG_MTD_NAND_DENALI_DT is not set
+# CONFIG_MTD_NAND_GPIO is not set
+# CONFIG_MTD_NAND_OMAP_BCH_BUILD is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_DOCG4 is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_BRCMNAND is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_NAND_HISI504 is not set
+# CONFIG_MTD_NAND_MTK is not set
+CONFIG_MTD_SPI_NAND_HISI_BVT=y
+CONFIG_MTD_NAND_HISNFC100=y
+CONFIG_HISNFC100_MAX_CHIP=1
+CONFIG_HISNFC100_HARDWARE_PAGESIZE_ECC=y
+# CONFIG_HISNFC100_AUTO_PAGESIZE_ECC is not set
+# CONFIG_HISNFC100_PAGESIZE_AUTO_ECC_NONE is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR & LPDDR2 PCM memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+# CONFIG_MTD_LPDDR2_NVM is not set
+CONFIG_MTD_SPI_NOR=y
+# CONFIG_MTD_MT81xx_NOR is not set
+# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
+# CONFIG_SPI_CADENCE_QUADSPI is not set
+# CONFIG_SPI_HISI_SFC is not set
+CONFIG_MTD_SPI_IDS=y
+CONFIG_CLOSE_SPI_8PIN_4IO=y
+CONFIG_MTD_HISFC350=y
+CONFIG_HISFC350_SYSCTRL_ADDRESS=0x20030000
+CONFIG_HISFC350_CHIP_NUM=2
+# CONFIG_HISFC350_SHOW_CYCLE_TIMING is not set
+# CONFIG_HISFC350_ENABLE_CHIPSELECT_0 is not set
+CONFIG_HISFC350_ENABLE_CHIPSELECT_1=y
+# CONFIG_HISFC350_ENABLE_INTR_DMA is not set
+CONFIG_CMD_SPI_BLOCK_PROTECTION=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
+CONFIG_MTD_UBI_BEB_LIMIT=20
+# CONFIG_MTD_UBI_FASTMAP is not set
+# CONFIG_MTD_UBI_GLUEBI is not set
+# CONFIG_MTD_UBI_BLOCK is not set
+CONFIG_DTC=y
+CONFIG_OF=y
+# CONFIG_OF_UNITTEST is not set
+CONFIG_OF_FLATTREE=y
+CONFIG_OF_EARLY_FLATTREE=y
+CONFIG_OF_ADDRESS=y
+CONFIG_OF_IRQ=y
+CONFIG_OF_NET=y
+CONFIG_OF_MDIO=y
+CONFIG_OF_RESERVED_MEM=y
+# CONFIG_OF_OVERLAY is not set
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_NULL_BLK is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_DRBD is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=65536
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_MG_DISK is not set
+# CONFIG_BLK_DEV_RBD is not set
+# CONFIG_NVME_TARGET is not set
+
+#
+# Misc devices
+#
+# CONFIG_SENSORS_LIS3LV02D is not set
+# CONFIG_AD525X_DPOT is not set
+# CONFIG_DUMMY_IRQ is not set
+# CONFIG_ICS932S401 is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_APDS9802ALS is not set
+# CONFIG_ISL29003 is not set
+# CONFIG_ISL29020 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_SENSORS_BH1770 is not set
+# CONFIG_SENSORS_APDS990X is not set
+# CONFIG_HMC6352 is not set
+# CONFIG_DS1682 is not set
+# CONFIG_TI_DAC7512 is not set
+# CONFIG_USB_SWITCH_FSA9480 is not set
+# CONFIG_LATTICE_ECP3_CONFIG is not set
+# CONFIG_SRAM is not set
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_AT25 is not set
+# CONFIG_EEPROM_LEGACY is not set
+# CONFIG_EEPROM_MAX6875 is not set
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_EEPROM_93XX46 is not set
+
+#
+# Texas Instruments shared transport line discipline
+#
+# CONFIG_TI_ST is not set
+# CONFIG_SENSORS_LIS3_SPI is not set
+# CONFIG_SENSORS_LIS3_I2C is not set
+
+#
+# Altera FPGA firmware download module
+#
+# CONFIG_ALTERA_STAPL is not set
+
+#
+# Intel MIC Bus Driver
+#
+
+#
+# SCIF Bus Driver
+#
+
+#
+# VOP Bus Driver
+#
+
+#
+# Intel MIC Host Driver
+#
+
+#
+# Intel MIC Card Driver
+#
+
+#
+# SCIF Driver
+#
+
+#
+# Intel MIC Coprocessor State Management (COSM) Drivers
+#
+
+#
+# VOP Driver
+#
+# CONFIG_ECHO is not set
+# CONFIG_CXL_BASE is not set
+# CONFIG_CXL_AFU_DRIVER_OPS is not set
+
+#
+# SCSI device support
+#
+CONFIG_SCSI_MOD=y
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+CONFIG_SCSI_NETLINK=y
+# CONFIG_SCSI_MQ_DEFAULT is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+CONFIG_SCSI_FC_ATTRS=y
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_ISCSI_BOOT_SYSFS is not set
+# CONFIG_SCSI_UFSHCD is not set
+# CONFIG_LIBFC is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_SCSI_OSD_INITIATOR is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+# CONFIG_TARGET_CORE is not set
+CONFIG_NETDEVICES=y
+CONFIG_NET_CORE=y
+# CONFIG_BONDING is not set
+# CONFIG_DUMMY is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_NET_TEAM is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_VXLAN is not set
+# CONFIG_MACSEC is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_TUN is not set
+# CONFIG_TUN_VNET_CROSS_LE is not set
+# CONFIG_VETH is not set
+# CONFIG_NLMON is not set
+
+#
+# CAIF transport drivers
+#
+
+#
+# Distributed Switch Architecture drivers
+#
+CONFIG_ETHERNET=y
+# CONFIG_ALTERA_TSE is not set
+# CONFIG_NET_VENDOR_AMAZON is not set
+# CONFIG_NET_VENDOR_ARC is not set
+# CONFIG_NET_VENDOR_AURORA is not set
+# CONFIG_NET_CADENCE is not set
+# CONFIG_NET_VENDOR_BROADCOM is not set
+# CONFIG_NET_VENDOR_CIRRUS is not set
+# CONFIG_DM9000 is not set
+# CONFIG_DNET is not set
+# CONFIG_NET_VENDOR_EZCHIP is not set
+# CONFIG_NET_VENDOR_FARADAY is not set
+CONFIG_NET_VENDOR_HISILICON=y
+# CONFIG_HIX5HD2_GMAC is not set
+# CONFIG_HISI_FEMAC is not set
+# CONFIG_HIP04_ETH is not set
+# CONFIG_HNS is not set
+# CONFIG_HNS_DSAF is not set
+# CONFIG_HNS_ENET is not set
+CONFIG_HIETH_GMAC=y
+# CONFIG_HIGMAC_DESC_4WORD is not set
+# CONFIG_HIGMAC_RXCSUM is not set
+CONFIG_RX_FLOW_CTRL_SUPPORT=y
+CONFIG_TX_FLOW_CTRL_SUPPORT=y
+CONFIG_TX_FLOW_CTRL_PAUSE_TIME=0xFFFF
+CONFIG_TX_FLOW_CTRL_PAUSE_INTERVAL=0xFFFF
+CONFIG_TX_FLOW_CTRL_ACTIVE_THRESHOLD=16
+CONFIG_TX_FLOW_CTRL_DEACTIVE_THRESHOLD=32
+# CONFIG_NET_VENDOR_INTEL is not set
+# CONFIG_NET_VENDOR_MARVELL is not set
+# CONFIG_NET_VENDOR_MICREL is not set
+# CONFIG_NET_VENDOR_MICROCHIP is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+# CONFIG_NET_VENDOR_NETRONOME is not set
+# CONFIG_ETHOC is not set
+# CONFIG_NET_VENDOR_QUALCOMM is not set
+# CONFIG_NET_VENDOR_RENESAS is not set
+# CONFIG_NET_VENDOR_ROCKER is not set
+# CONFIG_NET_VENDOR_SAMSUNG is not set
+# CONFIG_NET_VENDOR_SEEQ is not set
+# CONFIG_NET_VENDOR_SMSC is not set
+# CONFIG_NET_VENDOR_STMICRO is not set
+# CONFIG_NET_VENDOR_SYNOPSYS is not set
+# CONFIG_NET_VENDOR_VIA is not set
+# CONFIG_NET_VENDOR_WIZNET is not set
+CONFIG_PHYLIB=y
+CONFIG_SWPHY=y
+
+#
+# MDIO bus device drivers
+#
+# CONFIG_MDIO_BCM_UNIMAC is not set
+# CONFIG_MDIO_BITBANG is not set
+# CONFIG_MDIO_BUS_MUX_GPIO is not set
+# CONFIG_MDIO_BUS_MUX_MMIOREG is not set
+# CONFIG_MDIO_HISI_FEMAC is not set
+CONFIG_MDIO_HISI_GEMAC=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_AMD_PHY is not set
+# CONFIG_AQUANTIA_PHY is not set
+# CONFIG_AT803X_PHY is not set
+# CONFIG_BCM7XXX_PHY is not set
+# CONFIG_BCM87XX_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_DP83848_PHY is not set
+# CONFIG_DP83867_PHY is not set
+CONFIG_FIXED_PHY=y
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_INTEL_XWAY_PHY is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_MICREL_PHY is not set
+# CONFIG_MICROCHIP_PHY is not set
+# CONFIG_MICROSEMI_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_TERANETICS_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_XILINX_GMII2RGMII is not set
+# CONFIG_MICREL_KS8995MA is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+CONFIG_USB_NET_DRIVERS=y
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_RTL8152 is not set
+# CONFIG_USB_LAN78XX is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_USB_IPHETH is not set
+# CONFIG_WLAN is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+# CONFIG_WAN is not set
+# CONFIG_ISDN is not set
+# CONFIG_NVM is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+# CONFIG_INPUT_SPARSEKMAP is not set
+# CONFIG_INPUT_MATRIXKMAP is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ADP5588 is not set
+# CONFIG_KEYBOARD_ADP5589 is not set
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_QT1070 is not set
+# CONFIG_KEYBOARD_QT2160 is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_GPIO is not set
+# CONFIG_KEYBOARD_GPIO_POLLED is not set
+# CONFIG_KEYBOARD_TCA6416 is not set
+# CONFIG_KEYBOARD_TCA8418 is not set
+# CONFIG_KEYBOARD_MATRIX is not set
+# CONFIG_KEYBOARD_LM8333 is not set
+# CONFIG_KEYBOARD_MAX7359 is not set
+# CONFIG_KEYBOARD_MCS is not set
+# CONFIG_KEYBOARD_MPR121 is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_OPENCORES is not set
+# CONFIG_KEYBOARD_SAMSUNG is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_OMAP4 is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_CAP11XX is not set
+# CONFIG_KEYBOARD_BCM is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_BYD=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_CYPRESS=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_SENTELIC is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+CONFIG_MOUSE_PS2_FOCALTECH=y
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 is not set
+# CONFIG_MOUSE_CYAPA is not set
+# CONFIG_MOUSE_ELAN_I2C is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_MOUSE_GPIO is not set
+# CONFIG_MOUSE_SYNAPTICS_I2C is not set
+# CONFIG_MOUSE_SYNAPTICS_USB is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_AD714X is not set
+# CONFIG_INPUT_ATMEL_CAPTOUCH is not set
+# CONFIG_INPUT_BMA150 is not set
+# CONFIG_INPUT_E3X0_BUTTON is not set
+# CONFIG_INPUT_MMA8450 is not set
+# CONFIG_INPUT_MPU3050 is not set
+# CONFIG_INPUT_GP2A is not set
+# CONFIG_INPUT_GPIO_BEEPER is not set
+# CONFIG_INPUT_GPIO_TILT_POLLED is not set
+# CONFIG_INPUT_GPIO_DECODER is not set
+# CONFIG_INPUT_ATI_REMOTE2 is not set
+# CONFIG_INPUT_KEYSPAN_REMOTE is not set
+# CONFIG_INPUT_KXTJ9 is not set
+# CONFIG_INPUT_POWERMATE is not set
+# CONFIG_INPUT_YEALINK is not set
+# CONFIG_INPUT_CM109 is not set
+# CONFIG_INPUT_REGULATOR_HAPTIC is not set
+CONFIG_INPUT_UINPUT=y
+# CONFIG_INPUT_PCF8574 is not set
+# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
+# CONFIG_INPUT_ADXL34X is not set
+# CONFIG_INPUT_CMA3000 is not set
+# CONFIG_INPUT_DRV260X_HAPTICS is not set
+# CONFIG_INPUT_DRV2665_HAPTICS is not set
+# CONFIG_INPUT_DRV2667_HAPTICS is not set
+# CONFIG_RMI4_CORE is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_AMBAKMI is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_SERIO_ALTERA_PS2 is not set
+# CONFIG_SERIO_PS2MULT is not set
+# CONFIG_SERIO_ARC_PS2 is not set
+# CONFIG_SERIO_APBPS2 is not set
+# CONFIG_USERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_TTY=y
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_VT_CONSOLE_SLEEP=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_N_GSM is not set
+# CONFIG_TRACE_SINK is not set
+CONFIG_DEVMEM=y
+# CONFIG_DEVKMEM is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_EARLYCON=y
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_AMBA_PL010 is not set
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+# CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST is not set
+# CONFIG_SERIAL_MAX3100 is not set
+# CONFIG_SERIAL_MAX310X is not set
+# CONFIG_SERIAL_UARTLITE is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_SCCNXP is not set
+# CONFIG_SERIAL_SC16IS7XX is not set
+# CONFIG_SERIAL_BCM63XX is not set
+# CONFIG_SERIAL_ALTERA_JTAGUART is not set
+# CONFIG_SERIAL_ALTERA_UART is not set
+# CONFIG_SERIAL_IFX6X60 is not set
+# CONFIG_SERIAL_XILINX_PS_UART is not set
+# CONFIG_SERIAL_ARC is not set
+# CONFIG_SERIAL_FSL_LPUART is not set
+# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set
+# CONFIG_SERIAL_ST_ASC is not set
+# CONFIG_SERIAL_STM32 is not set
+# CONFIG_HVC_DCC is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_XILLYBUS is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_COMPAT=y
+CONFIG_I2C_CHARDEV=y
+# CONFIG_I2C_MUX is not set
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_CBUS_GPIO is not set
+# CONFIG_I2C_DESIGNWARE_PLATFORM is not set
+# CONFIG_I2C_EMEV2 is not set
+# CONFIG_I2C_GPIO is not set
+# CONFIG_I2C_HIBVT is not set
+# CONFIG_I2C_NOMADIK is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_PXA_PCI is not set
+# CONFIG_I2C_RK3X is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_XILINX is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_DIOLAN_U2C is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_ROBOTFUZZ_OSIF is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+CONFIG_I2C_HISI=y
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_SLAVE is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_ALTERA is not set
+# CONFIG_SPI_AXI_SPI_ENGINE is not set
+# CONFIG_SPI_BITBANG is not set
+# CONFIG_SPI_CADENCE is not set
+# CONFIG_SPI_DESIGNWARE is not set
+# CONFIG_SPI_GPIO is not set
+# CONFIG_SPI_FSL_SPI is not set
+# CONFIG_SPI_OC_TINY is not set
+CONFIG_SPI_PL022=y
+# CONFIG_SPI_PXA2XX_PCI is not set
+# CONFIG_SPI_ROCKCHIP is not set
+# CONFIG_SPI_SC18IS602 is not set
+# CONFIG_SPI_XCOMM is not set
+# CONFIG_SPI_XILINX is not set
+# CONFIG_SPI_ZYNQMP_GQSPI is not set
+
+#
+# SPI Protocol Masters
+#
+CONFIG_SPI_SPIDEV=y
+# CONFIG_SPI_LOOPBACK_TEST is not set
+# CONFIG_SPI_TLE62X0 is not set
+# CONFIG_SPMI is not set
+# CONFIG_HSI is not set
+
+#
+# PPS support
+#
+# CONFIG_PPS is not set
+
+#
+# PPS generators support
+#
+
+#
+# PTP clock support
+#
+# CONFIG_PTP_1588_CLOCK is not set
+
+#
+# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
+#
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+CONFIG_GPIOLIB=y
+CONFIG_OF_GPIO=y
+CONFIG_GPIOLIB_IRQCHIP=y
+# CONFIG_DEBUG_GPIO is not set
+CONFIG_GPIO_SYSFS=y
+
+#
+# Memory mapped GPIO drivers
+#
+# CONFIG_GPIO_74XX_MMIO is not set
+# CONFIG_GPIO_ALTERA is not set
+# CONFIG_GPIO_DWAPB is not set
+# CONFIG_GPIO_EM is not set
+# CONFIG_GPIO_GENERIC_PLATFORM is not set
+# CONFIG_GPIO_GRGPIO is not set
+# CONFIG_GPIO_MOCKUP is not set
+# CONFIG_GPIO_MPC8XXX is not set
+CONFIG_GPIO_PL061=y
+# CONFIG_GPIO_XILINX is not set
+# CONFIG_GPIO_ZEVIO is not set
+# CONFIG_GPIO_ZX is not set
+
+#
+# I2C GPIO expanders
+#
+# CONFIG_GPIO_ADP5588 is not set
+# CONFIG_GPIO_ADNP is not set
+# CONFIG_GPIO_MAX7300 is not set
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+# CONFIG_GPIO_SX150X is not set
+# CONFIG_GPIO_TPIC2810 is not set
+# CONFIG_GPIO_TS4900 is not set
+
+#
+# MFD GPIO expanders
+#
+# CONFIG_HTC_EGPIO is not set
+
+#
+# SPI GPIO expanders
+#
+# CONFIG_GPIO_74X164 is not set
+# CONFIG_GPIO_MAX7301 is not set
+# CONFIG_GPIO_MC33880 is not set
+# CONFIG_GPIO_PISOSR is not set
+
+#
+# SPI or I2C GPIO expanders
+#
+# CONFIG_GPIO_MCP23S08 is not set
+
+#
+# USB GPIO expanders
+#
+# CONFIG_W1 is not set
+# CONFIG_POWER_AVS is not set
+CONFIG_POWER_RESET=y
+# CONFIG_POWER_RESET_BRCMKONA is not set
+# CONFIG_POWER_RESET_GPIO is not set
+# CONFIG_POWER_RESET_GPIO_RESTART is not set
+CONFIG_POWER_RESET_HISI=y
+# CONFIG_POWER_RESET_LTC2952 is not set
+# CONFIG_POWER_RESET_RESTART is not set
+# CONFIG_POWER_RESET_SYSCON is not set
+# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set
+CONFIG_POWER_SUPPLY=y
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+# CONFIG_TEST_POWER is not set
+# CONFIG_BATTERY_DS2780 is not set
+# CONFIG_BATTERY_DS2781 is not set
+# CONFIG_BATTERY_DS2782 is not set
+# CONFIG_BATTERY_SBS is not set
+# CONFIG_BATTERY_BQ27XXX is not set
+# CONFIG_BATTERY_MAX17040 is not set
+# CONFIG_BATTERY_MAX17042 is not set
+# CONFIG_CHARGER_MAX8903 is not set
+# CONFIG_CHARGER_LP8727 is not set
+# CONFIG_CHARGER_GPIO is not set
+# CONFIG_CHARGER_MANAGER is not set
+# CONFIG_CHARGER_BQ2415X is not set
+# CONFIG_CHARGER_BQ24190 is not set
+# CONFIG_CHARGER_BQ24735 is not set
+# CONFIG_CHARGER_BQ25890 is not set
+# CONFIG_CHARGER_SMB347 is not set
+# CONFIG_BATTERY_GAUGE_LTC2941 is not set
+# CONFIG_CHARGER_RT9455 is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+CONFIG_BCMA_POSSIBLE=y
+
+#
+# Broadcom specific AMBA
+#
+# CONFIG_BCMA is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_ACT8945A is not set
+# CONFIG_MFD_AS3711 is not set
+# CONFIG_MFD_AS3722 is not set
+# CONFIG_PMIC_ADP5520 is not set
+# CONFIG_MFD_AAT2870_CORE is not set
+# CONFIG_MFD_ATMEL_FLEXCOM is not set
+# CONFIG_MFD_ATMEL_HLCDC is not set
+# CONFIG_MFD_BCM590XX is not set
+# CONFIG_MFD_AXP20X_I2C is not set
+# CONFIG_MFD_CROS_EC is not set
+# CONFIG_MFD_ASIC3 is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_DA9052_SPI is not set
+# CONFIG_MFD_DA9052_I2C is not set
+# CONFIG_MFD_DA9055 is not set
+# CONFIG_MFD_DA9062 is not set
+# CONFIG_MFD_DA9063 is not set
+# CONFIG_MFD_DA9150 is not set
+# CONFIG_MFD_DLN2 is not set
+# CONFIG_MFD_EXYNOS_LPASS is not set
+# CONFIG_MFD_MC13XXX_SPI is not set
+# CONFIG_MFD_MC13XXX_I2C is not set
+# CONFIG_MFD_HI6421_PMIC is not set
+# CONFIG_MFD_HISI_FMC is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_HTC_I2CPLD is not set
+# CONFIG_INTEL_SOC_PMIC is not set
+# CONFIG_MFD_KEMPLD is not set
+# CONFIG_MFD_88PM800 is not set
+# CONFIG_MFD_88PM805 is not set
+# CONFIG_MFD_88PM860X is not set
+# CONFIG_MFD_MAX14577 is not set
+# CONFIG_MFD_MAX77620 is not set
+# CONFIG_MFD_MAX77686 is not set
+# CONFIG_MFD_MAX77693 is not set
+# CONFIG_MFD_MAX77843 is not set
+# CONFIG_MFD_MAX8907 is not set
+# CONFIG_MFD_MAX8925 is not set
+# CONFIG_MFD_MAX8997 is not set
+# CONFIG_MFD_MAX8998 is not set
+# CONFIG_MFD_MT6397 is not set
+# CONFIG_MFD_MENF21BMC is not set
+# CONFIG_EZX_PCAP is not set
+# CONFIG_MFD_VIPERBOARD is not set
+# CONFIG_MFD_RETU is not set
+# CONFIG_MFD_PCF50633 is not set
+# CONFIG_MFD_PM8921_CORE is not set
+# CONFIG_MFD_RT5033 is not set
+# CONFIG_MFD_RTSX_USB is not set
+# CONFIG_MFD_RC5T583 is not set
+# CONFIG_MFD_RK808 is not set
+# CONFIG_MFD_RN5T618 is not set
+# CONFIG_MFD_SEC_CORE is not set
+# CONFIG_MFD_SI476X_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_SKY81452 is not set
+# CONFIG_MFD_SMSC is not set
+# CONFIG_ABX500_CORE is not set
+# CONFIG_MFD_STMPE is not set
+# CONFIG_MFD_SYSCON is not set
+# CONFIG_MFD_TI_AM335X_TSCADC is not set
+# CONFIG_MFD_LP3943 is not set
+# CONFIG_MFD_LP8788 is not set
+# CONFIG_MFD_PALMAS is not set
+# CONFIG_TPS6105X is not set
+# CONFIG_TPS65010 is not set
+# CONFIG_TPS6507X is not set
+# CONFIG_MFD_TPS65086 is not set
+# CONFIG_MFD_TPS65090 is not set
+# CONFIG_MFD_TPS65217 is not set
+# CONFIG_MFD_TI_LP873X is not set
+# CONFIG_MFD_TPS65218 is not set
+# CONFIG_MFD_TPS6586X is not set
+# CONFIG_MFD_TPS65910 is not set
+# CONFIG_MFD_TPS65912_I2C is not set
+# CONFIG_MFD_TPS65912_SPI is not set
+# CONFIG_MFD_TPS80031 is not set
+# CONFIG_TWL4030_CORE is not set
+# CONFIG_TWL6040_CORE is not set
+# CONFIG_MFD_WL1273_CORE is not set
+# CONFIG_MFD_LM3533 is not set
+# CONFIG_MFD_TC3589X is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_MFD_ARIZONA_I2C is not set
+# CONFIG_MFD_ARIZONA_SPI is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM831X_I2C is not set
+# CONFIG_MFD_WM831X_SPI is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_WM8994 is not set
+CONFIG_REGULATOR=y
+# CONFIG_REGULATOR_DEBUG is not set
+# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
+# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
+# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
+# CONFIG_REGULATOR_ACT8865 is not set
+# CONFIG_REGULATOR_AD5398 is not set
+# CONFIG_REGULATOR_DA9210 is not set
+# CONFIG_REGULATOR_DA9211 is not set
+# CONFIG_REGULATOR_FAN53555 is not set
+# CONFIG_REGULATOR_GPIO is not set
+# CONFIG_REGULATOR_ISL9305 is not set
+# CONFIG_REGULATOR_ISL6271A is not set
+# CONFIG_REGULATOR_LP3971 is not set
+# CONFIG_REGULATOR_LP3972 is not set
+# CONFIG_REGULATOR_LP872X is not set
+# CONFIG_REGULATOR_LP8755 is not set
+# CONFIG_REGULATOR_LTC3589 is not set
+# CONFIG_REGULATOR_LTC3676 is not set
+# CONFIG_REGULATOR_MAX1586 is not set
+# CONFIG_REGULATOR_MAX8649 is not set
+# CONFIG_REGULATOR_MAX8660 is not set
+# CONFIG_REGULATOR_MAX8952 is not set
+# CONFIG_REGULATOR_MT6311 is not set
+# CONFIG_REGULATOR_PFUZE100 is not set
+# CONFIG_REGULATOR_PV88060 is not set
+# CONFIG_REGULATOR_PV88080 is not set
+# CONFIG_REGULATOR_PV88090 is not set
+# CONFIG_REGULATOR_TPS51632 is not set
+# CONFIG_REGULATOR_TPS62360 is not set
+# CONFIG_REGULATOR_TPS65023 is not set
+# CONFIG_REGULATOR_TPS6507X is not set
+# CONFIG_REGULATOR_TPS6524X is not set
+# CONFIG_MEDIA_SUPPORT is not set
+
+#
+# Graphics support
+#
+# CONFIG_IMX_IPUV3_CORE is not set
+# CONFIG_DRM is not set
+
+#
+# ACP (Audio CoProcessor) Configuration
+#
+
+#
+# Frame buffer Devices
+#
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+CONFIG_FB_CMDLINE=y
+CONFIG_FB_NOTIFY=y
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+# CONFIG_FB_CFB_FILLRECT is not set
+# CONFIG_FB_CFB_COPYAREA is not set
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_ARMCLCD is not set
+# CONFIG_FB_OPENCORES is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_SMSCUFX is not set
+# CONFIG_FB_UDL is not set
+# CONFIG_FB_IBM_GXT4500 is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_BROADSHEET is not set
+# CONFIG_FB_AUO_K190X is not set
+# CONFIG_FB_SIMPLE is not set
+# CONFIG_FB_SSD1307 is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+# CONFIG_VGASTATE is not set
+
+#
+# Console display driver support
+#
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE is not set
+# CONFIG_LOGO is not set
+# CONFIG_SOUND is not set
+
+#
+# HID support
+#
+CONFIG_HID=y
+# CONFIG_HID_BATTERY_STRENGTH is not set
+# CONFIG_HIDRAW is not set
+# CONFIG_UHID is not set
+CONFIG_HID_GENERIC=y
+
+#
+# Special HID drivers
+#
+# CONFIG_HID_A4TECH is not set
+# CONFIG_HID_ACRUX is not set
+# CONFIG_HID_APPLE is not set
+# CONFIG_HID_APPLEIR is not set
+# CONFIG_HID_AUREAL is not set
+# CONFIG_HID_BELKIN is not set
+# CONFIG_HID_BETOP_FF is not set
+# CONFIG_HID_CHERRY is not set
+# CONFIG_HID_CHICONY is not set
+# CONFIG_HID_CMEDIA is not set
+# CONFIG_HID_CP2112 is not set
+# CONFIG_HID_CYPRESS is not set
+# CONFIG_HID_DRAGONRISE is not set
+# CONFIG_HID_EMS_FF is not set
+# CONFIG_HID_ELECOM is not set
+# CONFIG_HID_ELO is not set
+# CONFIG_HID_EZKEY is not set
+# CONFIG_HID_GEMBIRD is not set
+# CONFIG_HID_GFRM is not set
+# CONFIG_HID_HOLTEK is not set
+# CONFIG_HID_KEYTOUCH is not set
+# CONFIG_HID_KYE is not set
+# CONFIG_HID_UCLOGIC is not set
+# CONFIG_HID_WALTOP is not set
+# CONFIG_HID_GYRATION is not set
+# CONFIG_HID_ICADE is not set
+# CONFIG_HID_TWINHAN is not set
+# CONFIG_HID_KENSINGTON is not set
+# CONFIG_HID_LCPOWER is not set
+# CONFIG_HID_LENOVO is not set
+# CONFIG_HID_LOGITECH is not set
+# CONFIG_HID_MAGICMOUSE is not set
+CONFIG_HID_MICROSOFT=y
+# CONFIG_HID_MONTEREY is not set
+# CONFIG_HID_MULTITOUCH is not set
+# CONFIG_HID_NTRIG is not set
+# CONFIG_HID_ORTEK is not set
+# CONFIG_HID_PANTHERLORD is not set
+# CONFIG_HID_PENMOUNT is not set
+# CONFIG_HID_PETALYNX is not set
+# CONFIG_HID_PICOLCD is not set
+# CONFIG_HID_PLANTRONICS is not set
+# CONFIG_HID_PRIMAX is not set
+# CONFIG_HID_ROCCAT is not set
+# CONFIG_HID_SAITEK is not set
+# CONFIG_HID_SAMSUNG is not set
+# CONFIG_HID_SPEEDLINK is not set
+# CONFIG_HID_STEELSERIES is not set
+# CONFIG_HID_SUNPLUS is not set
+# CONFIG_HID_RMI is not set
+# CONFIG_HID_GREENASIA is not set
+# CONFIG_HID_SMARTJOYPLUS is not set
+# CONFIG_HID_TIVO is not set
+# CONFIG_HID_TOPSEED is not set
+# CONFIG_HID_THRUSTMASTER is not set
+# CONFIG_HID_WACOM is not set
+# CONFIG_HID_XINMO is not set
+# CONFIG_HID_ZEROPLUS is not set
+# CONFIG_HID_ZYDACRON is not set
+# CONFIG_HID_SENSOR_HUB is not set
+# CONFIG_HID_ALPS is not set
+
+#
+# USB HID support
+#
+CONFIG_USB_HID=y
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# I2C HID support
+#
+# CONFIG_I2C_HID is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_COMMON=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB=y
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEFAULT_PERSIST=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_MON is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_XHCI_HCD is not set
+CONFIG_USB_EHCI_HCD=y
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+CONFIG_USB_EHCI_TT_NEWSCHED=y
+CONFIG_USB_EHCI_HCD_PLATFORM=y
+# CONFIG_USB_OXU210HP_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1362_HCD is not set
+# CONFIG_USB_FOTG210_HCD is not set
+# CONFIG_USB_MAX3421_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PLATFORM=y
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HCD_TEST_MODE is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+# CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
+#
+
+#
+# also be needed; see USB_STORAGE Help for more info
+#
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_REALTEK is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_STORAGE_ENE_UB6250 is not set
+# CONFIG_USB_UAS is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USBIP_CORE is not set
+# CONFIG_USB_MUSB_HDRC is not set
+# CONFIG_USB_DWC3 is not set
+# CONFIG_USB_DWC2 is not set
+# CONFIG_USB_CHIPIDEA is not set
+# CONFIG_USB_ISP1760 is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_SISUSBVGA is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_TEST is not set
+# CONFIG_USB_EHSET_TEST_FIXTURE is not set
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_YUREX is not set
+# CONFIG_USB_EZUSB_FX2 is not set
+# CONFIG_USB_HSIC_USB3503 is not set
+# CONFIG_USB_HSIC_USB4604 is not set
+# CONFIG_USB_LINK_LAYER_TEST is not set
+
+#
+# USB Physical Layer drivers
+#
+# CONFIG_USB_PHY is not set
+# CONFIG_NOP_USB_XCEIV is not set
+# CONFIG_USB_GPIO_VBUS is not set
+# CONFIG_USB_ISP1301 is not set
+# CONFIG_USB_ULPI is not set
+# CONFIG_USB_GADGET is not set
+# CONFIG_USB_ULPI_BUS is not set
+# CONFIG_UWB is not set
+CONFIG_MMC=y
+# CONFIG_MMC_DEBUG is not set
+CONFIG_PWRSEQ_EMMC=y
+CONFIG_PWRSEQ_SIMPLE=y
+
+#
+# MMC/SD/SDIO Card Drivers
+#
+CONFIG_MMC_BLOCK=y
+CONFIG_MMC_BLOCK_MINORS=8
+CONFIG_MMC_BLOCK_BOUNCE=y
+# CONFIG_SDIO_UART is not set
+# CONFIG_MMC_TEST is not set
+
+#
+# MMC/SD/SDIO Host Controller Drivers
+#
+# CONFIG_MMC_ARMMMCI is not set
+# CONFIG_MMC_SDHCI is not set
+# CONFIG_MMC_SPI is not set
+# CONFIG_MMC_DW is not set
+# CONFIG_MMC_VUB300 is not set
+# CONFIG_MMC_USHC is not set
+# CONFIG_MMC_USDHI6ROL0 is not set
+# CONFIG_MMC_MTK is not set
+CONFIG_HIMCI=y
+CONFIG_SEND_AUTO_STOP=y
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
+CONFIG_EDAC_ATOMIC_SCRUB=y
+CONFIG_EDAC_SUPPORT=y
+# CONFIG_EDAC is not set
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+# CONFIG_DMADEVICES is not set
+
+#
+# DMABUF options
+#
+# CONFIG_SYNC_FILE is not set
+# CONFIG_AUXDISPLAY is not set
+# CONFIG_UIO is not set
+# CONFIG_VIRT_DRIVERS is not set
+
+#
+# Virtio drivers
+#
+# CONFIG_VIRTIO_MMIO is not set
+
+#
+# Microsoft Hyper-V guest support
+#
+# CONFIG_STAGING is not set
+# CONFIG_GOLDFISH is not set
+# CONFIG_CHROME_PLATFORMS is not set
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_HAVE_CLK_PREPARE=y
+CONFIG_COMMON_CLK=y
+
+#
+# Common Clock Framework
+#
+# CONFIG_COMMON_CLK_SI5351 is not set
+# CONFIG_COMMON_CLK_SI514 is not set
+# CONFIG_COMMON_CLK_SI570 is not set
+# CONFIG_COMMON_CLK_CDCE706 is not set
+# CONFIG_COMMON_CLK_CDCE925 is not set
+# CONFIG_COMMON_CLK_CS2000_CP is not set
+# CONFIG_CLK_QORIQ is not set
+# CONFIG_COMMON_CLK_NXP is not set
+# CONFIG_COMMON_CLK_PXA is not set
+# CONFIG_COMMON_CLK_PIC32 is not set
+CONFIG_COMMON_CLK_HI3516A=y
+CONFIG_RESET_HISI=y
+
+#
+# Hardware Spinlock drivers
+#
+
+#
+# Clock Source drivers
+#
+CONFIG_CLKSRC_OF=y
+CONFIG_CLKSRC_PROBE=y
+CONFIG_CLKSRC_MMIO=y
+CONFIG_ARM_ARCH_TIMER=y
+CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
+CONFIG_ARM_TIMER_SP804=y
+# CONFIG_ATMEL_PIT is not set
+# CONFIG_SH_TIMER_CMT is not set
+# CONFIG_SH_TIMER_MTU2 is not set
+# CONFIG_SH_TIMER_TMU is not set
+# CONFIG_EM_TIMER_STI is not set
+# CONFIG_MAILBOX is not set
+# CONFIG_IOMMU_SUPPORT is not set
+
+#
+# Remoteproc drivers
+#
+# CONFIG_STE_MODEM_RPROC is not set
+
+#
+# Rpmsg drivers
+#
+
+#
+# SOC (System On Chip) specific Drivers
+#
+
+#
+# Broadcom SoC drivers
+#
+# CONFIG_SOC_BRCMSTB is not set
+# CONFIG_SUNXI_SRAM is not set
+# CONFIG_SOC_TI is not set
+# CONFIG_PM_DEVFREQ is not set
+# CONFIG_EXTCON is not set
+# CONFIG_MEMORY is not set
+# CONFIG_IIO is not set
+# CONFIG_PWM is not set
+CONFIG_IRQCHIP=y
+CONFIG_ARM_GIC=y
+CONFIG_ARM_GIC_MAX_NR=1
+# CONFIG_IPACK_BUS is not set
+CONFIG_ARCH_HAS_RESET_CONTROLLER=y
+CONFIG_RESET_CONTROLLER=y
+# CONFIG_RESET_ATH79 is not set
+# CONFIG_RESET_BERLIN is not set
+# CONFIG_RESET_LPC18XX is not set
+# CONFIG_RESET_MESON is not set
+# CONFIG_RESET_PISTACHIO is not set
+# CONFIG_RESET_SOCFPGA is not set
+# CONFIG_RESET_STM32 is not set
+# CONFIG_RESET_SUNXI is not set
+# CONFIG_TI_SYSCON_RESET is not set
+# CONFIG_RESET_ZYNQ is not set
+# CONFIG_FMC is not set
+
+#
+# PHY Subsystem
+#
+CONFIG_GENERIC_PHY=y
+# CONFIG_PHY_PXA_28NM_HSIC is not set
+# CONFIG_PHY_PXA_28NM_USB2 is not set
+# CONFIG_BCM_KONA_USB2_PHY is not set
+CONFIG_PHY_HISI_USB2=y
+# CONFIG_POWERCAP is not set
+# CONFIG_MCB is not set
+
+#
+# Performance monitor support
+#
+# CONFIG_RAS is not set
+
+#
+# Android
+#
+# CONFIG_ANDROID is not set
+# CONFIG_NVMEM is not set
+# CONFIG_STM is not set
+# CONFIG_INTEL_TH is not set
+
+#
+# FPGA Configuration Support
+#
+# CONFIG_FPGA is not set
+# CONFIG_HI_DMAC is not set
+
+#
+# Firmware Drivers
+#
+# CONFIG_FIRMWARE_MEMMAP is not set
+# CONFIG_FW_CFG_SYSFS is not set
+CONFIG_HAVE_ARM_SMCCC=y
+
+#
+# File systems
+#
+CONFIG_DCACHE_WORD_ACCESS=y
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+CONFIG_EXT4_FS=y
+CONFIG_EXT4_USE_FOR_EXT2=y
+# CONFIG_EXT4_FS_POSIX_ACL is not set
+# CONFIG_EXT4_FS_SECURITY is not set
+# CONFIG_EXT4_ENCRYPTION is not set
+# CONFIG_EXT4_DEBUG is not set
+CONFIG_JBD2=y
+# CONFIG_JBD2_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+# CONFIG_NILFS2_FS is not set
+# CONFIG_F2FS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_EXPORTFS=y
+# CONFIG_EXPORTFS_BLOCK_OPS is not set
+CONFIG_FILE_LOCKING=y
+CONFIG_MANDATORY_FILE_LOCKING=y
+# CONFIG_FS_ENCRYPTION is not set
+CONFIG_FSNOTIFY=y
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_FANOTIFY is not set
+# CONFIG_QUOTA is not set
+# CONFIG_QUOTACTL is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+# CONFIG_OVERLAY_FS is not set
+
+#
+# Caches
+#
+# CONFIG_FSCACHE is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_FAT_DEFAULT_UTF8 is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+# CONFIG_PROC_CHILDREN is not set
+CONFIG_KERNFS=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_TMPFS_XATTR is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_CONFIGFS_FS=m
+CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ORANGEFS_FS is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_ECRYPT_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_YAFFS_FS=y
+CONFIG_YAFFS_YAFFS1=y
+# CONFIG_YAFFS_9BYTE_TAGS is not set
+# CONFIG_YAFFS_DOES_ECC is not set
+CONFIG_YAFFS_YAFFS2=y
+CONFIG_YAFFS_AUTO_YAFFS2=y
+# CONFIG_YAFFS_DISABLE_TAGS_ECC is not set
+# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
+# CONFIG_YAFFS_EMPTY_LOST_AND_FOUND is not set
+# CONFIG_YAFFS_DISABLE_BLOCK_REFRESHING is not set
+# CONFIG_YAFFS_DISABLE_BACKGROUND is not set
+# CONFIG_YAFFS_DISABLE_BAD_BLOCK_MARKING is not set
+CONFIG_YAFFS_XATTR=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+CONFIG_UBIFS_FS=y
+# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
+CONFIG_UBIFS_FS_LZO=y
+CONFIG_UBIFS_FS_ZLIB=y
+# CONFIG_UBIFS_ATIME_SUPPORT is not set
+# CONFIG_LOGFS is not set
+CONFIG_CRAMFS=y
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX6FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_PSTORE is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V2=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+# CONFIG_NFS_SWAP is not set
+# CONFIG_NFS_V4_1 is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFS_USE_LEGACY_DNS is not set
+CONFIG_NFS_USE_KERNEL_DNS=y
+# CONFIG_NFSD is not set
+CONFIG_GRACE_PERIOD=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_DEBUG is not set
+# CONFIG_CEPH_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_MAC_ROMAN is not set
+# CONFIG_NLS_MAC_CELTIC is not set
+# CONFIG_NLS_MAC_CENTEURO is not set
+# CONFIG_NLS_MAC_CROATIAN is not set
+# CONFIG_NLS_MAC_CYRILLIC is not set
+# CONFIG_NLS_MAC_GAELIC is not set
+# CONFIG_NLS_MAC_GREEK is not set
+# CONFIG_NLS_MAC_ICELAND is not set
+# CONFIG_NLS_MAC_INUIT is not set
+# CONFIG_NLS_MAC_ROMANIAN is not set
+# CONFIG_NLS_MAC_TURKISH is not set
+CONFIG_NLS_UTF8=y
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+
+#
+# printk and dmesg options
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4
+# CONFIG_BOOT_PRINTK_DELAY is not set
+
+#
+# Compile-time checks and compiler options
+#
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=1024
+# CONFIG_STRIP_ASM_SYMS is not set
+# CONFIG_READABLE_ASM is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_PAGE_OWNER is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_SECTION_MISMATCH is not set
+CONFIG_SECTION_MISMATCH_WARN_ONLY=y
+CONFIG_FRAME_POINTER=y
+# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
+# CONFIG_MAGIC_SYSRQ is not set
+CONFIG_DEBUG_KERNEL=y
+
+#
+# Memory Debugging
+#
+# CONFIG_PAGE_EXTENSION is not set
+# CONFIG_PAGE_POISONING is not set
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS is not set
+CONFIG_HAVE_DEBUG_KMEMLEAK=y
+# CONFIG_DEBUG_KMEMLEAK is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_VM is not set
+CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_DEBUG_SHIRQ is not set
+
+#
+# Debug Lockups and Hangs
+#
+# CONFIG_LOCKUP_DETECTOR is not set
+# CONFIG_DETECT_HUNG_TASK is not set
+# CONFIG_WQ_WATCHDOG is not set
+# CONFIG_PANIC_ON_OOPS is not set
+CONFIG_PANIC_ON_OOPS_VALUE=0
+CONFIG_PANIC_TIMEOUT=0
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_SCHED_INFO is not set
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_SCHED_STACK_END_CHECK is not set
+# CONFIG_DEBUG_TIMEKEEPING is not set
+# CONFIG_TIMER_STATS is not set
+
+#
+# Lock Debugging (spinlocks, mutexes, etc...)
+#
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_ATOMIC_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_LOCK_TORTURE_TEST is not set
+CONFIG_STACKTRACE=y
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_PI_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_DEBUG_CREDENTIALS is not set
+
+#
+# RCU Debugging
+#
+# CONFIG_PROVE_RCU is not set
+# CONFIG_SPARSE_RCU_POINTER is not set
+# CONFIG_TORTURE_TEST is not set
+# CONFIG_RCU_PERF_TEST is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_TRACE is not set
+# CONFIG_RCU_EQS_DEBUG is not set
+# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_NOTIFIER_ERROR_INJECTION is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_TRACING_SUPPORT=y
+# CONFIG_FTRACE is not set
+
+#
+# Runtime Testing
+#
+# CONFIG_TEST_LIST_SORT is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_RBTREE_TEST is not set
+# CONFIG_INTERVAL_TREE_TEST is not set
+# CONFIG_PERCPU_TEST is not set
+# CONFIG_ATOMIC64_SELFTEST is not set
+# CONFIG_TEST_HEXDUMP is not set
+# CONFIG_TEST_STRING_HELPERS is not set
+# CONFIG_TEST_KSTRTOX is not set
+# CONFIG_TEST_PRINTF is not set
+# CONFIG_TEST_BITMAP is not set
+# CONFIG_TEST_UUID is not set
+# CONFIG_TEST_RHASHTABLE is not set
+# CONFIG_TEST_HASH is not set
+# CONFIG_DMA_API_DEBUG is not set
+# CONFIG_TEST_LKM is not set
+# CONFIG_TEST_USER_COPY is not set
+# CONFIG_TEST_BPF is not set
+# CONFIG_TEST_FIRMWARE is not set
+# CONFIG_TEST_UDELAY is not set
+# CONFIG_MEMTEST is not set
+# CONFIG_TEST_STATIC_KEYS is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+# CONFIG_ARCH_WANTS_UBSAN_NO_NULL is not set
+# CONFIG_UBSAN is not set
+CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y
+CONFIG_STRICT_DEVMEM=y
+# CONFIG_IO_STRICT_DEVMEM is not set
+# CONFIG_ARM_PTDUMP is not set
+# CONFIG_ARM_UNWIND is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_LL is not set
+CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
+# CONFIG_DEBUG_UART_8250 is not set
+CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
+# CONFIG_PID_IN_CONTEXTIDR is not set
+# CONFIG_DEBUG_SET_MODULE_RONX is not set
+# CONFIG_CORESIGHT is not set
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_PERSISTENT_KEYRINGS is not set
+# CONFIG_ENCRYPTED_KEYS is not set
+# CONFIG_KEY_DH_OPERATIONS is not set
+# CONFIG_SECURITY_DMESG_RESTRICT is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y
+CONFIG_HAVE_ARCH_HARDENED_USERCOPY=y
+# CONFIG_HARDENED_USERCOPY is not set
+CONFIG_DEFAULT_SECURITY_DAC=y
+CONFIG_DEFAULT_SECURITY=""
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG=m
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_RNG_DEFAULT=m
+CONFIG_CRYPTO_AKCIPHER2=y
+CONFIG_CRYPTO_KPP2=y
+# CONFIG_CRYPTO_RSA is not set
+# CONFIG_CRYPTO_DH is not set
+# CONFIG_CRYPTO_ECDH is not set
+CONFIG_CRYPTO_MANAGER=m
+CONFIG_CRYPTO_MANAGER2=y
+# CONFIG_CRYPTO_USER is not set
+CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_NULL2=y
+CONFIG_CRYPTO_WORKQUEUE=y
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_MCRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+CONFIG_CRYPTO_CCM=m
+CONFIG_CRYPTO_GCM=m
+# CONFIG_CRYPTO_CHACHA20POLY1305 is not set
+CONFIG_CRYPTO_SEQIV=m
+CONFIG_CRYPTO_ECHAINIV=m
+
+#
+# Block modes
+#
+# CONFIG_CRYPTO_CBC is not set
+CONFIG_CRYPTO_CTR=m
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+# CONFIG_CRYPTO_KEYWRAP is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_CMAC is not set
+CONFIG_CRYPTO_HMAC=m
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_VMAC is not set
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+# CONFIG_CRYPTO_CRC32 is not set
+CONFIG_CRYPTO_CRCT10DIF=y
+CONFIG_CRYPTO_GHASH=m
+# CONFIG_CRYPTO_POLY1305 is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+CONFIG_CRYPTO_SHA1=y
+CONFIG_CRYPTO_SHA256=y
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_SHA3 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=y
+# CONFIG_CRYPTO_ANUBIS is not set
+CONFIG_CRYPTO_ARC4=y
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_CHACHA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_LZO=y
+# CONFIG_CRYPTO_842 is not set
+# CONFIG_CRYPTO_LZ4 is not set
+# CONFIG_CRYPTO_LZ4HC is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_DRBG_MENU=m
+CONFIG_CRYPTO_DRBG_HMAC=y
+# CONFIG_CRYPTO_DRBG_HASH is not set
+# CONFIG_CRYPTO_DRBG_CTR is not set
+CONFIG_CRYPTO_DRBG=m
+CONFIG_CRYPTO_JITTERENTROPY=m
+# CONFIG_CRYPTO_USER_API_HASH is not set
+# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
+# CONFIG_CRYPTO_USER_API_RNG is not set
+# CONFIG_CRYPTO_USER_API_AEAD is not set
+# CONFIG_CRYPTO_HW is not set
+# CONFIG_ASYMMETRIC_KEY_TYPE is not set
+
+#
+# Certificates for signature checking
+#
+# CONFIG_ARM_CRYPTO is not set
+# CONFIG_BINARY_PRINTF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_HAVE_ARCH_BITREVERSE=y
+CONFIG_RATIONAL=y
+CONFIG_GENERIC_STRNCPY_FROM_USER=y
+CONFIG_GENERIC_STRNLEN_USER=y
+CONFIG_GENERIC_NET_UTILS=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_IO=y
+CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
+CONFIG_CRC_CCITT=y
+CONFIG_CRC16=y
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC32=y
+# CONFIG_CRC32_SELFTEST is not set
+CONFIG_CRC32_SLICEBY8=y
+# CONFIG_CRC32_SLICEBY4 is not set
+# CONFIG_CRC32_SARWATE is not set
+# CONFIG_CRC32_BIT is not set
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=y
+# CONFIG_CRC8 is not set
+# CONFIG_AUDIT_ARCH_COMPAT_GENERIC is not set
+# CONFIG_RANDOM32_SELFTEST is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_LZ4_DECOMPRESS=y
+CONFIG_XZ_DEC=y
+CONFIG_XZ_DEC_X86=y
+CONFIG_XZ_DEC_POWERPC=y
+CONFIG_XZ_DEC_IA64=y
+CONFIG_XZ_DEC_ARM=y
+CONFIG_XZ_DEC_ARMTHUMB=y
+CONFIG_XZ_DEC_SPARC=y
+CONFIG_XZ_DEC_BCJ=y
+# CONFIG_XZ_DEC_TEST is not set
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_DECOMPRESS_LZ4=y
+CONFIG_GENERIC_ALLOCATOR=y
+CONFIG_ASSOCIATIVE_ARRAY=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT_MAP=y
+CONFIG_HAS_DMA=y
+CONFIG_DQL=y
+CONFIG_NLATTR=y
+# CONFIG_CORDIC is not set
+# CONFIG_DDR is not set
+# CONFIG_IRQ_POLL is not set
+CONFIG_LIBFDT=y
+CONFIG_OID_REGISTRY=y
+# CONFIG_SG_SPLIT is not set
+CONFIG_SG_POOL=y
+CONFIG_ARCH_HAS_SG_CHAIN=y
+CONFIG_SBITMAP=y
+# CONFIG_VIRTUALIZATION is not set
diff --git a/arch/arm/configs/hi3516a_spinand_mini_defconfig b/arch/arm/configs/hi3516a_spinand_mini_defconfig
new file mode 100644
index 0000000..6229259
--- /dev/null
+++ b/arch/arm/configs/hi3516a_spinand_mini_defconfig
@@ -0,0 +1,2318 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Linux/arm 4.9.37 Kernel Configuration
+#
+CONFIG_ARM=y
+CONFIG_ARM_HAS_SG_CHAIN=y
+CONFIG_MIGHT_HAVE_PCI=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_HAVE_PROC_CPU=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_FIX_EARLYCON_MEM=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_ARCH_SUPPORTS_UPROBES=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_ARM_PATCH_PHYS_VIRT=y
+CONFIG_GENERIC_BUG=y
+CONFIG_PGTABLE_LEVELS=2
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_IRQ_WORK=y
+CONFIG_BUILDTIME_EXTABLE_SORT=y
+
+#
+# General setup
+#
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_CROSS_COMPILE=""
+# CONFIG_COMPILE_TEST is not set
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_HAVE_KERNEL_GZIP=y
+CONFIG_HAVE_KERNEL_LZMA=y
+CONFIG_HAVE_KERNEL_XZ=y
+CONFIG_HAVE_KERNEL_LZO=y
+CONFIG_HAVE_KERNEL_LZ4=y
+CONFIG_KERNEL_GZIP=y
+# CONFIG_KERNEL_LZMA is not set
+# CONFIG_KERNEL_XZ is not set
+# CONFIG_KERNEL_LZO is not set
+# CONFIG_KERNEL_LZ4 is not set
+CONFIG_DEFAULT_HOSTNAME="(none)"
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+CONFIG_CROSS_MEMORY_ATTACH=y
+CONFIG_FHANDLE=y
+CONFIG_USELIB=y
+# CONFIG_AUDIT is not set
+CONFIG_HAVE_ARCH_AUDITSYSCALL=y
+
+#
+# IRQ subsystem
+#
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_IRQ_DOMAIN=y
+CONFIG_IRQ_DOMAIN_HIERARCHY=y
+CONFIG_HANDLE_DOMAIN_IRQ=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_SPARSE_IRQ=y
+CONFIG_ARCH_CLOCKSOURCE_DATA=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+
+#
+# Timers subsystem
+#
+CONFIG_HZ_PERIODIC=y
+# CONFIG_NO_HZ_IDLE is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+
+#
+# CPU/Task time and stats accounting
+#
+CONFIG_TICK_CPU_ACCOUNTING=y
+# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set
+CONFIG_IRQ_TIME_ACCOUNTING=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_TINY_RCU=y
+# CONFIG_RCU_EXPERT is not set
+CONFIG_SRCU=y
+# CONFIG_TASKS_RCU is not set
+# CONFIG_RCU_STALL_COMMON is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_RCU_EXPEDITE_BOOT is not set
+# CONFIG_BUILD_BIN2C is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=17
+CONFIG_NMI_LOG_BUF_SHIFT=13
+CONFIG_GENERIC_SCHED_CLOCK=y
+CONFIG_CGROUPS=y
+# CONFIG_MEMCG is not set
+# CONFIG_BLK_CGROUP is not set
+# CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUP_PIDS is not set
+CONFIG_CGROUP_FREEZER=y
+# CONFIG_CPUSETS is not set
+# CONFIG_CGROUP_DEVICE is not set
+# CONFIG_CGROUP_CPUACCT is not set
+# CONFIG_CGROUP_DEBUG is not set
+# CONFIG_CHECKPOINT_RESTORE is not set
+CONFIG_NAMESPACES=y
+CONFIG_UTS_NS=y
+CONFIG_IPC_NS=y
+# CONFIG_USER_NS is not set
+CONFIG_PID_NS=y
+CONFIG_NET_NS=y
+# CONFIG_SCHED_AUTOGROUP is not set
+# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
+# CONFIG_RD_XZ is not set
+# CONFIG_RD_LZO is not set
+CONFIG_RD_LZ4=y
+CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_HAVE_UID16=y
+CONFIG_BPF=y
+# CONFIG_EXPERT is not set
+CONFIG_UID16=y
+CONFIG_MULTIUSER=y
+# CONFIG_SGETMASK_SYSCALL is not set
+CONFIG_SYSFS_SYSCALL=y
+# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_ABSOLUTE_PERCPU is not set
+CONFIG_KALLSYMS_BASE_RELATIVE=y
+CONFIG_PRINTK=y
+CONFIG_PRINTK_NMI=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+# CONFIG_BPF_SYSCALL is not set
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_ADVISE_SYSCALLS=y
+# CONFIG_USERFAULTFD is not set
+CONFIG_MEMBARRIER=y
+# CONFIG_EMBEDDED is not set
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_PERF_USE_VMALLOC=y
+
+#
+# Kernel Performance Events And Counters
+#
+# CONFIG_PERF_EVENTS is not set
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+CONFIG_COMPAT_BRK=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLAB_FREELIST_RANDOM is not set
+# CONFIG_SYSTEM_DATA_VERIFICATION is not set
+# CONFIG_PROFILING is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+# CONFIG_JUMP_LABEL is not set
+# CONFIG_UPROBES is not set
+# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_ARCH_USE_BUILTIN_BSWAP=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_OPTPROBES=y
+CONFIG_HAVE_NMI=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+CONFIG_HAVE_DMA_CONTIGUOUS=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GENERIC_IDLE_POLL_SETUP=y
+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_PERF_REGS=y
+CONFIG_HAVE_PERF_USER_STACK_DUMP=y
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
+CONFIG_HAVE_GCC_PLUGINS=y
+# CONFIG_GCC_PLUGINS is not set
+CONFIG_HAVE_CC_STACKPROTECTOR=y
+# CONFIG_CC_STACKPROTECTOR is not set
+CONFIG_CC_STACKPROTECTOR_NONE=y
+# CONFIG_CC_STACKPROTECTOR_REGULAR is not set
+# CONFIG_CC_STACKPROTECTOR_STRONG is not set
+CONFIG_HAVE_CONTEXT_TRACKING=y
+CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
+CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
+CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
+CONFIG_MODULES_USE_ELF_REL=y
+CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
+CONFIG_HAVE_ARCH_MMAP_RND_BITS=y
+CONFIG_HAVE_EXIT_THREAD=y
+CONFIG_ARCH_MMAP_RND_BITS_MIN=8
+CONFIG_ARCH_MMAP_RND_BITS_MAX=16
+CONFIG_ARCH_MMAP_RND_BITS=8
+# CONFIG_HAVE_ARCH_HASH is not set
+# CONFIG_ISA_BUS_API is not set
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_OLD_SIGSUSPEND3=y
+CONFIG_OLD_SIGACTION=y
+# CONFIG_CPU_NO_EFFICIENT_FFS is not set
+# CONFIG_HAVE_ARCH_VMAP_STACK is not set
+
+#
+# GCOV-based kernel profiling
+#
+CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+# CONFIG_MODULE_SIG is not set
+# CONFIG_MODULE_COMPRESS is not set
+# CONFIG_TRIM_UNUSED_KSYMS is not set
+CONFIG_BLOCK=y
+CONFIG_LBDAF=y
+CONFIG_BLK_DEV_BSG=y
+# CONFIG_BLK_DEV_BSGLIB is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+CONFIG_BLK_CMDLINE_PARSER=y
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_AIX_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+CONFIG_EFI_PARTITION=y
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_CMDLINE_PARTITION=y
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_DEADLINE=y
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="deadline"
+CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
+CONFIG_INLINE_READ_UNLOCK=y
+CONFIG_INLINE_READ_UNLOCK_IRQ=y
+CONFIG_INLINE_WRITE_UNLOCK=y
+CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
+CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
+CONFIG_FREEZER=y
+
+#
+# System Type
+#
+CONFIG_MMU=y
+CONFIG_ARCH_MULTIPLATFORM=y
+# CONFIG_ARCH_GEMINI is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_DOVE is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_W90X900 is not set
+# CONFIG_ARCH_LPC32XX is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C24XX is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP1 is not set
+
+#
+# Multiple platform selection
+#
+
+#
+# CPU Core family selection
+#
+# CONFIG_ARCH_MULTI_V6 is not set
+CONFIG_ARCH_MULTI_V7=y
+CONFIG_ARCH_MULTI_V6_V7=y
+# CONFIG_ARCH_MULTI_CPU_AUTO is not set
+# CONFIG_ARCH_VIRT is not set
+# CONFIG_ARCH_MVEBU is not set
+# CONFIG_ARCH_ALPINE is not set
+# CONFIG_ARCH_ARTPEC is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_BCM is not set
+# CONFIG_ARCH_BERLIN is not set
+# CONFIG_ARCH_DIGICOLOR is not set
+# CONFIG_ARCH_HIGHBANK is not set
+# CONFIG_ARCH_HISI is not set
+CONFIG_ARCH_HISI_BVT=y
+
+#
+# Hisilicon BVT platform type
+#
+CONFIG_HI_ZRELADDR=0x80008000
+CONFIG_HI_PARAMS_PHYS=0x00000100
+CONFIG_HI_INITRD_PHYS=0x00800000
+CONFIG_ARCH_HI3516A=y
+# CONFIG_ARCH_HI3536DV100 is not set
+# CONFIG_ARCH_KEYSTONE is not set
+# CONFIG_ARCH_MESON is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_MEDIATEK is not set
+
+#
+# TI OMAP/AM/DM/DRA Family
+#
+# CONFIG_ARCH_OMAP3 is not set
+# CONFIG_ARCH_OMAP4 is not set
+# CONFIG_SOC_OMAP5 is not set
+# CONFIG_SOC_AM33XX is not set
+# CONFIG_SOC_AM43XX is not set
+# CONFIG_SOC_DRA7XX is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_QCOM is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_ROCKCHIP is not set
+# CONFIG_ARCH_SOCFPGA is not set
+# CONFIG_PLAT_SPEAR is not set
+# CONFIG_ARCH_STI is not set
+# CONFIG_ARCH_S5PV210 is not set
+# CONFIG_ARCH_EXYNOS is not set
+# CONFIG_ARCH_RENESAS is not set
+# CONFIG_ARCH_SUNXI is not set
+# CONFIG_ARCH_SIRF is not set
+# CONFIG_ARCH_TANGO is not set
+# CONFIG_ARCH_TEGRA is not set
+# CONFIG_ARCH_UNIPHIER is not set
+# CONFIG_ARCH_U8500 is not set
+# CONFIG_ARCH_VEXPRESS is not set
+# CONFIG_ARCH_WM8850 is not set
+# CONFIG_ARCH_ZX is not set
+# CONFIG_ARCH_ZYNQ is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_V7=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_PABRT_V7=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+# CONFIG_ARM_LPAE is not set
+# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
+CONFIG_ARM_THUMB=y
+# CONFIG_ARM_THUMBEE is not set
+CONFIG_ARM_VIRT_EXT=y
+# CONFIG_SWP_EMULATE is not set
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_KUSER_HELPERS=y
+CONFIG_VDSO=y
+CONFIG_MIGHT_HAVE_CACHE_L2X0=y
+# CONFIG_CACHE_L2X0 is not set
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
+CONFIG_ARM_L1_CACHE_SHIFT=6
+CONFIG_ARM_DMA_MEM_BUFFERABLE=y
+# CONFIG_DEBUG_RODATA is not set
+CONFIG_MULTI_IRQ_HANDLER=y
+# CONFIG_ARM_ERRATA_430973 is not set
+# CONFIG_ARM_ERRATA_720789 is not set
+# CONFIG_ARM_ERRATA_754322 is not set
+# CONFIG_ARM_ERRATA_775420 is not set
+# CONFIG_ARM_ERRATA_773022 is not set
+# CONFIG_ARM_ERRATA_818325_852422 is not set
+# CONFIG_ARM_ERRATA_821420 is not set
+# CONFIG_ARM_ERRATA_825619 is not set
+# CONFIG_ARM_ERRATA_852421 is not set
+# CONFIG_ARM_ERRATA_852423 is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI is not set
+# CONFIG_PCI_DOMAINS_GENERIC is not set
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_HAVE_SMP=y
+# CONFIG_SMP is not set
+CONFIG_HAVE_ARM_ARCH_TIMER=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_3G_OPT is not set
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_ARM_PSCI is not set
+CONFIG_ARCH_NR_GPIO=0
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_HZ_FIXED=0
+CONFIG_HZ_100=y
+# CONFIG_HZ_200 is not set
+# CONFIG_HZ_250 is not set
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_500 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=100
+# CONFIG_SCHED_HRTICK is not set
+# CONFIG_THUMB2_KERNEL is not set
+CONFIG_ARM_PATCH_IDIV=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+CONFIG_HAVE_ARCH_PFN_VALID=y
+# CONFIG_HIGHMEM is not set
+# CONFIG_CPU_SW_DOMAIN_PAN is not set
+CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
+# CONFIG_ARM_MODULE_PLTS is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_NO_BOOTMEM=y
+# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_COMPACTION=y
+CONFIG_MIGRATION=y
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+# CONFIG_KSM is not set
+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
+CONFIG_NEED_PER_CPU_KM=y
+# CONFIG_CLEANCACHE is not set
+# CONFIG_FRONTSWAP is not set
+# CONFIG_CMA is not set
+# CONFIG_ZPOOL is not set
+# CONFIG_ZBUD is not set
+# CONFIG_ZSMALLOC is not set
+CONFIG_GENERIC_EARLY_IOREMAP=y
+# CONFIG_IDLE_PAGE_TRACKING is not set
+CONFIG_FORCE_MAX_ZONEORDER=11
+CONFIG_ALIGNMENT_TRAP=y
+# CONFIG_UACCESS_WITH_MEMCPY is not set
+# CONFIG_SECCOMP is not set
+CONFIG_SWIOTLB=y
+CONFIG_IOMMU_HELPER=y
+# CONFIG_PARAVIRT is not set
+# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
+# CONFIG_XEN is not set
+
+#
+# Boot options
+#
+CONFIG_USE_OF=y
+CONFIG_ATAGS=y
+# CONFIG_DEPRECATED_PARAM_STRUCT is not set
+CONFIG_ZBOOT_ROM_TEXT=0
+CONFIG_ZBOOT_ROM_BSS=0
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_ARM_ATAG_DTB_COMPAT=y
+CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y
+# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set
+CONFIG_CMDLINE=""
+# CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
+CONFIG_AUTO_ZRELADDR=y
+# CONFIG_EFI is not set
+
+#
+# CPU Power Management
+#
+
+#
+# CPU Frequency scaling
+#
+CONFIG_CPU_FREQ=y
+CONFIG_CPU_FREQ_GOV_ATTR_SET=y
+CONFIG_CPU_FREQ_GOV_COMMON=y
+CONFIG_CPU_FREQ_STAT=y
+# CONFIG_CPU_FREQ_STAT_DETAILS is not set
+CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_DEFAULT_GOV_POWERSAVE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
+# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
+# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
+CONFIG_CPU_FREQ_GOV_USERSPACE=y
+CONFIG_CPU_FREQ_GOV_ONDEMAND=y
+# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+
+#
+# CPU frequency scaling drivers
+#
+CONFIG_CPUFREQ_DT=y
+CONFIG_CPUFREQ_DT_PLATDEV=y
+# CONFIG_ARM_KIRKWOOD_CPUFREQ is not set
+# CONFIG_QORIQ_CPUFREQ is not set
+
+#
+# CPU Idle
+#
+# CONFIG_CPU_IDLE is not set
+# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+# CONFIG_KERNEL_MODE_NEON is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_ELFCORE=y
+CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
+CONFIG_BINFMT_SCRIPT=y
+# CONFIG_BINFMT_FLAT is not set
+# CONFIG_HAVE_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+CONFIG_COREDUMP=y
+
+#
+# Power management options
+#
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+CONFIG_HIBERNATE_CALLBACKS=y
+CONFIG_HIBERNATION=y
+CONFIG_PM_STD_PARTITION=""
+CONFIG_PM_SLEEP=y
+# CONFIG_PM_AUTOSLEEP is not set
+# CONFIG_PM_WAKELOCKS is not set
+CONFIG_PM=y
+CONFIG_PM_DEBUG=y
+# CONFIG_PM_ADVANCED_DEBUG is not set
+CONFIG_PM_SLEEP_DEBUG=y
+# CONFIG_APM_EMULATION is not set
+CONFIG_PM_OPP=y
+CONFIG_PM_CLK=y
+# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
+CONFIG_CPU_PM=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARM_CPU_SUSPEND=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_DIAG is not set
+CONFIG_UNIX=y
+# CONFIG_UNIX_DIAG is not set
+CONFIG_XFRM=y
+CONFIG_XFRM_ALGO=y
+CONFIG_XFRM_USER=y
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+CONFIG_NET_KEY=y
+# CONFIG_NET_KEY_MIGRATE is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+# CONFIG_IP_FIB_TRIE_STATS is not set
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_VERBOSE=y
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE_DEMUX is not set
+# CONFIG_NET_IP_TUNNEL is not set
+CONFIG_IP_MROUTE=y
+# CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+CONFIG_SYN_COOKIES=y
+# CONFIG_NET_UDP_TUNNEL is not set
+# CONFIG_NET_FOU is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_INET_UDP_DIAG is not set
+# CONFIG_INET_DIAG_DESTROY is not set
+CONFIG_TCP_CONG_ADVANCED=y
+CONFIG_TCP_CONG_BIC=m
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+# CONFIG_TCP_CONG_HSTCP is not set
+# CONFIG_TCP_CONG_HYBLA is not set
+# CONFIG_TCP_CONG_VEGAS is not set
+# CONFIG_TCP_CONG_NV is not set
+# CONFIG_TCP_CONG_SCALABLE is not set
+# CONFIG_TCP_CONG_LP is not set
+# CONFIG_TCP_CONG_VENO is not set
+# CONFIG_TCP_CONG_YEAH is not set
+# CONFIG_TCP_CONG_ILLINOIS is not set
+# CONFIG_TCP_CONG_DCTCP is not set
+# CONFIG_TCP_CONG_CDG is not set
+# CONFIG_TCP_CONG_BBR is not set
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
+CONFIG_TCP_MD5SIG=y
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NET_PTP_CLASSIFY is not set
+# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_RDS is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_L2TP is not set
+# CONFIG_BRIDGE is not set
+CONFIG_HAVE_NET_DSA=y
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_PHONET is not set
+# CONFIG_IEEE802154 is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+CONFIG_DNS_RESOLVER=y
+# CONFIG_BATMAN_ADV is not set
+# CONFIG_OPENVSWITCH is not set
+# CONFIG_VSOCKETS is not set
+# CONFIG_NETLINK_DIAG is not set
+# CONFIG_MPLS is not set
+# CONFIG_HSR is not set
+# CONFIG_NET_SWITCHDEV is not set
+# CONFIG_NET_L3_MASTER_DEV is not set
+# CONFIG_NET_NCSI is not set
+# CONFIG_SOCK_CGROUP_DATA is not set
+# CONFIG_CGROUP_NET_PRIO is not set
+# CONFIG_CGROUP_NET_CLASSID is not set
+CONFIG_NET_RX_BUSY_POLL=y
+CONFIG_BQL=y
+# CONFIG_BPF_JIT is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_AF_KCM is not set
+# CONFIG_STREAM_PARSER is not set
+CONFIG_FIB_RULES=y
+# CONFIG_WIRELESS is not set
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_RFKILL_REGULATOR is not set
+# CONFIG_NET_9P is not set
+# CONFIG_CAIF is not set
+# CONFIG_CEPH_LIB is not set
+# CONFIG_NFC is not set
+# CONFIG_LWTUNNEL is not set
+# CONFIG_DST_CACHE is not set
+# CONFIG_NET_DEVLINK is not set
+CONFIG_MAY_USE_DEVLINK=y
+CONFIG_HAVE_CBPF_JIT=y
+
+#
+# Device Drivers
+#
+CONFIG_ARM_AMBA=y
+
+#
+# Generic Driver Options
+#
+# CONFIG_UEVENT_HELPER is not set
+CONFIG_DEVTMPFS=y
+# CONFIG_DEVTMPFS_MOUNT is not set
+CONFIG_STANDALONE=y
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
+CONFIG_ALLOW_DEV_COREDUMP=y
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_GENERIC_CPU_DEVICES is not set
+# CONFIG_DMA_SHARED_BUFFER is not set
+
+#
+# Bus devices
+#
+# CONFIG_BRCMSTB_GISB_ARB is not set
+# CONFIG_VEXPRESS_CONFIG is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_TESTS is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+CONFIG_MTD_OF_PARTS=y
+# CONFIG_MTD_AR7_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_SM_FTL is not set
+# CONFIG_MTD_OOPS is not set
+# CONFIG_MTD_SWAP is not set
+# CONFIG_MTD_PARTITIONED_MASTER is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_DATAFLASH is not set
+# CONFIG_MTD_M25P80 is not set
+# CONFIG_MTD_SST25L is not set
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOCG3 is not set
+CONFIG_MTD_NAND_ECC=y
+# CONFIG_MTD_NAND_ECC_SMC is not set
+CONFIG_MTD_NAND=y
+# CONFIG_MTD_NAND_ECC_BCH is not set
+# CONFIG_MTD_SM_COMMON is not set
+# CONFIG_MTD_NAND_DENALI_DT is not set
+# CONFIG_MTD_NAND_OMAP_BCH_BUILD is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_DOCG4 is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_BRCMNAND is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_NAND_HISI504 is not set
+# CONFIG_MTD_NAND_MTK is not set
+CONFIG_MTD_SPI_NAND_HISI_BVT=y
+CONFIG_MTD_NAND_HISNFC100=y
+CONFIG_HISNFC100_MAX_CHIP=1
+CONFIG_HISNFC100_HARDWARE_PAGESIZE_ECC=y
+# CONFIG_HISNFC100_AUTO_PAGESIZE_ECC is not set
+# CONFIG_HISNFC100_PAGESIZE_AUTO_ECC_NONE is not set
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR & LPDDR2 PCM memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+# CONFIG_MTD_LPDDR2_NVM is not set
+CONFIG_MTD_SPI_NOR=y
+# CONFIG_MTD_MT81xx_NOR is not set
+# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
+# CONFIG_SPI_CADENCE_QUADSPI is not set
+# CONFIG_SPI_HISI_SFC is not set
+CONFIG_MTD_SPI_IDS=y
+CONFIG_CLOSE_SPI_8PIN_4IO=y
+CONFIG_MTD_HISFC350=y
+CONFIG_HISFC350_SYSCTRL_ADDRESS=0x20030000
+CONFIG_HISFC350_CHIP_NUM=2
+# CONFIG_HISFC350_SHOW_CYCLE_TIMING is not set
+# CONFIG_HISFC350_ENABLE_CHIPSELECT_0 is not set
+CONFIG_HISFC350_ENABLE_CHIPSELECT_1=y
+# CONFIG_HISFC350_ENABLE_INTR_DMA is not set
+CONFIG_CMD_SPI_BLOCK_PROTECTION=y
+# CONFIG_MTD_UBI is not set
+CONFIG_DTC=y
+CONFIG_OF=y
+# CONFIG_OF_UNITTEST is not set
+CONFIG_OF_FLATTREE=y
+CONFIG_OF_EARLY_FLATTREE=y
+CONFIG_OF_ADDRESS=y
+CONFIG_OF_IRQ=y
+CONFIG_OF_NET=y
+CONFIG_OF_MDIO=y
+CONFIG_OF_RESERVED_MEM=y
+# CONFIG_OF_OVERLAY is not set
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_NULL_BLK is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_DRBD is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=65536
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_BLK_DEV_RBD is not set
+# CONFIG_NVME_TARGET is not set
+
+#
+# Misc devices
+#
+# CONFIG_SENSORS_LIS3LV02D is not set
+# CONFIG_AD525X_DPOT is not set
+# CONFIG_DUMMY_IRQ is not set
+# CONFIG_ICS932S401 is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_APDS9802ALS is not set
+# CONFIG_ISL29003 is not set
+# CONFIG_ISL29020 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_SENSORS_BH1770 is not set
+# CONFIG_SENSORS_APDS990X is not set
+# CONFIG_HMC6352 is not set
+# CONFIG_DS1682 is not set
+# CONFIG_TI_DAC7512 is not set
+# CONFIG_USB_SWITCH_FSA9480 is not set
+# CONFIG_LATTICE_ECP3_CONFIG is not set
+# CONFIG_SRAM is not set
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_AT25 is not set
+# CONFIG_EEPROM_LEGACY is not set
+# CONFIG_EEPROM_MAX6875 is not set
+# CONFIG_EEPROM_93CX6 is not set
+# CONFIG_EEPROM_93XX46 is not set
+
+#
+# Texas Instruments shared transport line discipline
+#
+# CONFIG_SENSORS_LIS3_SPI is not set
+# CONFIG_SENSORS_LIS3_I2C is not set
+
+#
+# Altera FPGA firmware download module
+#
+# CONFIG_ALTERA_STAPL is not set
+
+#
+# Intel MIC Bus Driver
+#
+
+#
+# SCIF Bus Driver
+#
+
+#
+# VOP Bus Driver
+#
+
+#
+# Intel MIC Host Driver
+#
+
+#
+# Intel MIC Card Driver
+#
+
+#
+# SCIF Driver
+#
+
+#
+# Intel MIC Coprocessor State Management (COSM) Drivers
+#
+
+#
+# VOP Driver
+#
+# CONFIG_ECHO is not set
+# CONFIG_CXL_BASE is not set
+# CONFIG_CXL_AFU_DRIVER_OPS is not set
+
+#
+# SCSI device support
+#
+CONFIG_SCSI_MOD=y
+# CONFIG_RAID_ATTRS is not set
+# CONFIG_SCSI is not set
+# CONFIG_SCSI_DMA is not set
+# CONFIG_SCSI_NETLINK is not set
+# CONFIG_ATA is not set
+# CONFIG_MD is not set
+CONFIG_NETDEVICES=y
+CONFIG_NET_CORE=y
+# CONFIG_BONDING is not set
+# CONFIG_DUMMY is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_NET_TEAM is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_VXLAN is not set
+# CONFIG_MACSEC is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_TUN is not set
+# CONFIG_TUN_VNET_CROSS_LE is not set
+# CONFIG_VETH is not set
+# CONFIG_NLMON is not set
+
+#
+# CAIF transport drivers
+#
+
+#
+# Distributed Switch Architecture drivers
+#
+CONFIG_ETHERNET=y
+# CONFIG_ALTERA_TSE is not set
+# CONFIG_NET_VENDOR_AMAZON is not set
+# CONFIG_NET_VENDOR_ARC is not set
+# CONFIG_NET_VENDOR_AURORA is not set
+# CONFIG_NET_CADENCE is not set
+# CONFIG_NET_VENDOR_BROADCOM is not set
+# CONFIG_NET_VENDOR_CIRRUS is not set
+# CONFIG_DM9000 is not set
+# CONFIG_DNET is not set
+# CONFIG_NET_VENDOR_EZCHIP is not set
+# CONFIG_NET_VENDOR_FARADAY is not set
+CONFIG_NET_VENDOR_HISILICON=y
+# CONFIG_HIX5HD2_GMAC is not set
+# CONFIG_HISI_FEMAC is not set
+# CONFIG_HIP04_ETH is not set
+# CONFIG_HNS is not set
+# CONFIG_HNS_DSAF is not set
+# CONFIG_HNS_ENET is not set
+CONFIG_HIETH_GMAC=y
+# CONFIG_HIGMAC_DESC_4WORD is not set
+# CONFIG_HIGMAC_RXCSUM is not set
+CONFIG_RX_FLOW_CTRL_SUPPORT=y
+CONFIG_TX_FLOW_CTRL_SUPPORT=y
+CONFIG_TX_FLOW_CTRL_PAUSE_TIME=0xFFFF
+CONFIG_TX_FLOW_CTRL_PAUSE_INTERVAL=0xFFFF
+CONFIG_TX_FLOW_CTRL_ACTIVE_THRESHOLD=16
+CONFIG_TX_FLOW_CTRL_DEACTIVE_THRESHOLD=32
+# CONFIG_NET_VENDOR_INTEL is not set
+# CONFIG_NET_VENDOR_MARVELL is not set
+# CONFIG_NET_VENDOR_MICREL is not set
+# CONFIG_NET_VENDOR_MICROCHIP is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+# CONFIG_NET_VENDOR_NETRONOME is not set
+# CONFIG_ETHOC is not set
+# CONFIG_NET_VENDOR_QUALCOMM is not set
+# CONFIG_NET_VENDOR_RENESAS is not set
+# CONFIG_NET_VENDOR_ROCKER is not set
+# CONFIG_NET_VENDOR_SAMSUNG is not set
+# CONFIG_NET_VENDOR_SEEQ is not set
+# CONFIG_NET_VENDOR_SMSC is not set
+# CONFIG_NET_VENDOR_STMICRO is not set
+# CONFIG_NET_VENDOR_SYNOPSYS is not set
+# CONFIG_NET_VENDOR_VIA is not set
+# CONFIG_NET_VENDOR_WIZNET is not set
+CONFIG_PHYLIB=y
+CONFIG_SWPHY=y
+
+#
+# MDIO bus device drivers
+#
+# CONFIG_MDIO_BCM_UNIMAC is not set
+# CONFIG_MDIO_BITBANG is not set
+# CONFIG_MDIO_BUS_MUX_MMIOREG is not set
+# CONFIG_MDIO_HISI_FEMAC is not set
+CONFIG_MDIO_HISI_GEMAC=y
+
+#
+# MII PHY device drivers
+#
+# CONFIG_AMD_PHY is not set
+# CONFIG_AQUANTIA_PHY is not set
+# CONFIG_AT803X_PHY is not set
+# CONFIG_BCM7XXX_PHY is not set
+# CONFIG_BCM87XX_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_DP83848_PHY is not set
+# CONFIG_DP83867_PHY is not set
+CONFIG_FIXED_PHY=y
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_INTEL_XWAY_PHY is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_MICREL_PHY is not set
+# CONFIG_MICROCHIP_PHY is not set
+# CONFIG_MICROSEMI_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_TERANETICS_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_XILINX_GMII2RGMII is not set
+# CONFIG_MICREL_KS8995MA is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+
+#
+# Host-side USB support is needed for USB Network Adapter support
+#
+# CONFIG_WLAN is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+# CONFIG_WAN is not set
+# CONFIG_ISDN is not set
+# CONFIG_NVM is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+# CONFIG_INPUT_SPARSEKMAP is not set
+# CONFIG_INPUT_MATRIXKMAP is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ADP5588 is not set
+# CONFIG_KEYBOARD_ADP5589 is not set
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_QT1070 is not set
+# CONFIG_KEYBOARD_QT2160 is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_TCA6416 is not set
+# CONFIG_KEYBOARD_TCA8418 is not set
+# CONFIG_KEYBOARD_LM8333 is not set
+# CONFIG_KEYBOARD_MAX7359 is not set
+# CONFIG_KEYBOARD_MCS is not set
+# CONFIG_KEYBOARD_MPR121 is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_OPENCORES is not set
+# CONFIG_KEYBOARD_SAMSUNG is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_OMAP4 is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_CAP11XX is not set
+# CONFIG_KEYBOARD_BCM is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_BYD=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_CYPRESS=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_SENTELIC is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+CONFIG_MOUSE_PS2_FOCALTECH=y
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_CYAPA is not set
+# CONFIG_MOUSE_ELAN_I2C is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_MOUSE_SYNAPTICS_I2C is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_AD714X is not set
+# CONFIG_INPUT_ATMEL_CAPTOUCH is not set
+# CONFIG_INPUT_BMA150 is not set
+# CONFIG_INPUT_E3X0_BUTTON is not set
+# CONFIG_INPUT_MMA8450 is not set
+# CONFIG_INPUT_MPU3050 is not set
+# CONFIG_INPUT_KXTJ9 is not set
+# CONFIG_INPUT_REGULATOR_HAPTIC is not set
+CONFIG_INPUT_UINPUT=y
+# CONFIG_INPUT_PCF8574 is not set
+# CONFIG_INPUT_ADXL34X is not set
+# CONFIG_INPUT_CMA3000 is not set
+# CONFIG_INPUT_DRV2665_HAPTICS is not set
+# CONFIG_INPUT_DRV2667_HAPTICS is not set
+# CONFIG_RMI4_CORE is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_AMBAKMI is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_SERIO_ALTERA_PS2 is not set
+# CONFIG_SERIO_PS2MULT is not set
+# CONFIG_SERIO_ARC_PS2 is not set
+# CONFIG_SERIO_APBPS2 is not set
+# CONFIG_USERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_TTY=y
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_VT_CONSOLE_SLEEP=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_N_GSM is not set
+# CONFIG_TRACE_SINK is not set
+CONFIG_DEVMEM=y
+# CONFIG_DEVKMEM is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_EARLYCON=y
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_AMBA_PL010 is not set
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+# CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST is not set
+# CONFIG_SERIAL_MAX3100 is not set
+# CONFIG_SERIAL_MAX310X is not set
+# CONFIG_SERIAL_UARTLITE is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_SCCNXP is not set
+# CONFIG_SERIAL_SC16IS7XX is not set
+# CONFIG_SERIAL_BCM63XX is not set
+# CONFIG_SERIAL_ALTERA_JTAGUART is not set
+# CONFIG_SERIAL_ALTERA_UART is not set
+# CONFIG_SERIAL_XILINX_PS_UART is not set
+# CONFIG_SERIAL_ARC is not set
+# CONFIG_SERIAL_FSL_LPUART is not set
+# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set
+# CONFIG_SERIAL_ST_ASC is not set
+# CONFIG_SERIAL_STM32 is not set
+# CONFIG_HVC_DCC is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_XILLYBUS is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+CONFIG_I2C_COMPAT=y
+CONFIG_I2C_CHARDEV=y
+# CONFIG_I2C_MUX is not set
+CONFIG_I2C_HELPER_AUTO=y
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_DESIGNWARE_PLATFORM is not set
+# CONFIG_I2C_EMEV2 is not set
+# CONFIG_I2C_HIBVT is not set
+# CONFIG_I2C_NOMADIK is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_PXA_PCI is not set
+# CONFIG_I2C_RK3X is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_XILINX is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_TAOS_EVM is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+CONFIG_I2C_HISI=y
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_SLAVE is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+CONFIG_SPI=y
+# CONFIG_SPI_DEBUG is not set
+CONFIG_SPI_MASTER=y
+
+#
+# SPI Master Controller Drivers
+#
+# CONFIG_SPI_ALTERA is not set
+# CONFIG_SPI_AXI_SPI_ENGINE is not set
+# CONFIG_SPI_BITBANG is not set
+# CONFIG_SPI_CADENCE is not set
+# CONFIG_SPI_DESIGNWARE is not set
+# CONFIG_SPI_FSL_SPI is not set
+CONFIG_SPI_PL022=y
+# CONFIG_SPI_PXA2XX_PCI is not set
+# CONFIG_SPI_ROCKCHIP is not set
+# CONFIG_SPI_SC18IS602 is not set
+# CONFIG_SPI_XCOMM is not set
+# CONFIG_SPI_XILINX is not set
+# CONFIG_SPI_ZYNQMP_GQSPI is not set
+
+#
+# SPI Protocol Masters
+#
+CONFIG_SPI_SPIDEV=y
+# CONFIG_SPI_LOOPBACK_TEST is not set
+# CONFIG_SPI_TLE62X0 is not set
+# CONFIG_SPMI is not set
+# CONFIG_HSI is not set
+
+#
+# PPS support
+#
+# CONFIG_PPS is not set
+
+#
+# PPS generators support
+#
+
+#
+# PTP clock support
+#
+# CONFIG_PTP_1588_CLOCK is not set
+
+#
+# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
+#
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+# CONFIG_GPIOLIB is not set
+# CONFIG_W1 is not set
+# CONFIG_POWER_AVS is not set
+CONFIG_POWER_RESET=y
+# CONFIG_POWER_RESET_BRCMKONA is not set
+CONFIG_POWER_RESET_HISI=y
+# CONFIG_POWER_RESET_RESTART is not set
+# CONFIG_POWER_RESET_SYSCON is not set
+# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set
+CONFIG_POWER_SUPPLY=y
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+# CONFIG_TEST_POWER is not set
+# CONFIG_BATTERY_DS2780 is not set
+# CONFIG_BATTERY_DS2781 is not set
+# CONFIG_BATTERY_DS2782 is not set
+# CONFIG_BATTERY_SBS is not set
+# CONFIG_BATTERY_BQ27XXX is not set
+# CONFIG_BATTERY_MAX17040 is not set
+# CONFIG_BATTERY_MAX17042 is not set
+# CONFIG_CHARGER_MAX8903 is not set
+# CONFIG_CHARGER_LP8727 is not set
+# CONFIG_CHARGER_MANAGER is not set
+# CONFIG_CHARGER_BQ2415X is not set
+# CONFIG_CHARGER_SMB347 is not set
+# CONFIG_BATTERY_GAUGE_LTC2941 is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+CONFIG_BCMA_POSSIBLE=y
+
+#
+# Broadcom specific AMBA
+#
+# CONFIG_BCMA is not set
+
+#
+# Multifunction device drivers
+#
+# CONFIG_MFD_CORE is not set
+# CONFIG_MFD_ACT8945A is not set
+# CONFIG_MFD_AS3711 is not set
+# CONFIG_MFD_AS3722 is not set
+# CONFIG_PMIC_ADP5520 is not set
+# CONFIG_MFD_ATMEL_FLEXCOM is not set
+# CONFIG_MFD_ATMEL_HLCDC is not set
+# CONFIG_MFD_BCM590XX is not set
+# CONFIG_MFD_AXP20X_I2C is not set
+# CONFIG_MFD_CROS_EC is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_DA9052_SPI is not set
+# CONFIG_MFD_DA9052_I2C is not set
+# CONFIG_MFD_DA9055 is not set
+# CONFIG_MFD_DA9062 is not set
+# CONFIG_MFD_DA9063 is not set
+# CONFIG_MFD_DA9150 is not set
+# CONFIG_MFD_EXYNOS_LPASS is not set
+# CONFIG_MFD_MC13XXX_SPI is not set
+# CONFIG_MFD_MC13XXX_I2C is not set
+# CONFIG_MFD_HI6421_PMIC is not set
+# CONFIG_MFD_HISI_FMC is not set
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_MFD_KEMPLD is not set
+# CONFIG_MFD_88PM800 is not set
+# CONFIG_MFD_88PM805 is not set
+# CONFIG_MFD_88PM860X is not set
+# CONFIG_MFD_MAX14577 is not set
+# CONFIG_MFD_MAX77620 is not set
+# CONFIG_MFD_MAX77686 is not set
+# CONFIG_MFD_MAX77693 is not set
+# CONFIG_MFD_MAX77843 is not set
+# CONFIG_MFD_MAX8907 is not set
+# CONFIG_MFD_MAX8925 is not set
+# CONFIG_MFD_MAX8997 is not set
+# CONFIG_MFD_MAX8998 is not set
+# CONFIG_MFD_MT6397 is not set
+# CONFIG_MFD_MENF21BMC is not set
+# CONFIG_EZX_PCAP is not set
+# CONFIG_MFD_RETU is not set
+# CONFIG_MFD_PCF50633 is not set
+# CONFIG_MFD_PM8921_CORE is not set
+# CONFIG_MFD_RT5033 is not set
+# CONFIG_MFD_RC5T583 is not set
+# CONFIG_MFD_RK808 is not set
+# CONFIG_MFD_RN5T618 is not set
+# CONFIG_MFD_SEC_CORE is not set
+# CONFIG_MFD_SI476X_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_SKY81452 is not set
+# CONFIG_MFD_SMSC is not set
+# CONFIG_ABX500_CORE is not set
+# CONFIG_MFD_STMPE is not set
+# CONFIG_MFD_SYSCON is not set
+# CONFIG_MFD_TI_AM335X_TSCADC is not set
+# CONFIG_MFD_LP3943 is not set
+# CONFIG_MFD_LP8788 is not set
+# CONFIG_MFD_PALMAS is not set
+# CONFIG_TPS6105X is not set
+# CONFIG_TPS6507X is not set
+# CONFIG_MFD_TPS65086 is not set
+# CONFIG_MFD_TPS65090 is not set
+# CONFIG_MFD_TPS65217 is not set
+# CONFIG_MFD_TI_LP873X is not set
+# CONFIG_MFD_TPS65218 is not set
+# CONFIG_MFD_TPS6586X is not set
+# CONFIG_MFD_TPS65912_I2C is not set
+# CONFIG_MFD_TPS65912_SPI is not set
+# CONFIG_MFD_TPS80031 is not set
+# CONFIG_TWL4030_CORE is not set
+# CONFIG_TWL6040_CORE is not set
+# CONFIG_MFD_WL1273_CORE is not set
+# CONFIG_MFD_LM3533 is not set
+# CONFIG_MFD_TC3589X is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_MFD_ARIZONA_I2C is not set
+# CONFIG_MFD_ARIZONA_SPI is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM831X_I2C is not set
+# CONFIG_MFD_WM831X_SPI is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_WM8994 is not set
+CONFIG_REGULATOR=y
+# CONFIG_REGULATOR_DEBUG is not set
+# CONFIG_REGULATOR_FIXED_VOLTAGE is not set
+# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
+# CONFIG_REGULATOR_USERSPACE_CONSUMER is not set
+# CONFIG_REGULATOR_ACT8865 is not set
+# CONFIG_REGULATOR_AD5398 is not set
+# CONFIG_REGULATOR_DA9210 is not set
+# CONFIG_REGULATOR_DA9211 is not set
+# CONFIG_REGULATOR_FAN53555 is not set
+# CONFIG_REGULATOR_ISL9305 is not set
+# CONFIG_REGULATOR_ISL6271A is not set
+# CONFIG_REGULATOR_LP3971 is not set
+# CONFIG_REGULATOR_LP3972 is not set
+# CONFIG_REGULATOR_LP872X is not set
+# CONFIG_REGULATOR_LP8755 is not set
+# CONFIG_REGULATOR_LTC3589 is not set
+# CONFIG_REGULATOR_LTC3676 is not set
+# CONFIG_REGULATOR_MAX1586 is not set
+# CONFIG_REGULATOR_MAX8649 is not set
+# CONFIG_REGULATOR_MAX8660 is not set
+# CONFIG_REGULATOR_MAX8952 is not set
+# CONFIG_REGULATOR_MT6311 is not set
+# CONFIG_REGULATOR_PFUZE100 is not set
+# CONFIG_REGULATOR_PV88060 is not set
+# CONFIG_REGULATOR_PV88080 is not set
+# CONFIG_REGULATOR_PV88090 is not set
+# CONFIG_REGULATOR_TPS51632 is not set
+# CONFIG_REGULATOR_TPS62360 is not set
+# CONFIG_REGULATOR_TPS65023 is not set
+# CONFIG_REGULATOR_TPS6507X is not set
+# CONFIG_REGULATOR_TPS6524X is not set
+# CONFIG_MEDIA_SUPPORT is not set
+
+#
+# Graphics support
+#
+# CONFIG_IMX_IPUV3_CORE is not set
+# CONFIG_DRM is not set
+
+#
+# ACP (Audio CoProcessor) Configuration
+#
+
+#
+# Frame buffer Devices
+#
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+CONFIG_FB_CMDLINE=y
+CONFIG_FB_NOTIFY=y
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+# CONFIG_FB_CFB_FILLRECT is not set
+# CONFIG_FB_CFB_COPYAREA is not set
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_ARMCLCD is not set
+# CONFIG_FB_OPENCORES is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_IBM_GXT4500 is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_BROADSHEET is not set
+# CONFIG_FB_AUO_K190X is not set
+# CONFIG_FB_SIMPLE is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+# CONFIG_VGASTATE is not set
+
+#
+# Console display driver support
+#
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE is not set
+# CONFIG_LOGO is not set
+# CONFIG_SOUND is not set
+
+#
+# HID support
+#
+# CONFIG_HID is not set
+
+#
+# I2C HID support
+#
+# CONFIG_I2C_HID is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+# CONFIG_USB_SUPPORT is not set
+# CONFIG_UWB is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
+CONFIG_EDAC_ATOMIC_SCRUB=y
+CONFIG_EDAC_SUPPORT=y
+# CONFIG_EDAC is not set
+CONFIG_RTC_LIB=y
+# CONFIG_RTC_CLASS is not set
+# CONFIG_DMADEVICES is not set
+
+#
+# DMABUF options
+#
+# CONFIG_SYNC_FILE is not set
+# CONFIG_AUXDISPLAY is not set
+# CONFIG_UIO is not set
+# CONFIG_VIRT_DRIVERS is not set
+
+#
+# Virtio drivers
+#
+# CONFIG_VIRTIO_MMIO is not set
+
+#
+# Microsoft Hyper-V guest support
+#
+# CONFIG_STAGING is not set
+# CONFIG_GOLDFISH is not set
+# CONFIG_CHROME_PLATFORMS is not set
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_HAVE_CLK_PREPARE=y
+CONFIG_COMMON_CLK=y
+
+#
+# Common Clock Framework
+#
+# CONFIG_COMMON_CLK_SI5351 is not set
+# CONFIG_COMMON_CLK_SI514 is not set
+# CONFIG_COMMON_CLK_SI570 is not set
+# CONFIG_COMMON_CLK_CDCE706 is not set
+# CONFIG_COMMON_CLK_CDCE925 is not set
+# CONFIG_COMMON_CLK_CS2000_CP is not set
+# CONFIG_CLK_QORIQ is not set
+# CONFIG_COMMON_CLK_NXP is not set
+# CONFIG_COMMON_CLK_PXA is not set
+# CONFIG_COMMON_CLK_PIC32 is not set
+CONFIG_COMMON_CLK_HI3516A=y
+CONFIG_RESET_HISI=y
+
+#
+# Hardware Spinlock drivers
+#
+
+#
+# Clock Source drivers
+#
+CONFIG_CLKSRC_OF=y
+CONFIG_CLKSRC_PROBE=y
+CONFIG_CLKSRC_MMIO=y
+CONFIG_ARM_ARCH_TIMER=y
+CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
+CONFIG_ARM_TIMER_SP804=y
+# CONFIG_ATMEL_PIT is not set
+# CONFIG_SH_TIMER_CMT is not set
+# CONFIG_SH_TIMER_MTU2 is not set
+# CONFIG_SH_TIMER_TMU is not set
+# CONFIG_EM_TIMER_STI is not set
+# CONFIG_MAILBOX is not set
+# CONFIG_IOMMU_SUPPORT is not set
+
+#
+# Remoteproc drivers
+#
+# CONFIG_STE_MODEM_RPROC is not set
+
+#
+# Rpmsg drivers
+#
+
+#
+# SOC (System On Chip) specific Drivers
+#
+
+#
+# Broadcom SoC drivers
+#
+# CONFIG_SOC_BRCMSTB is not set
+# CONFIG_SUNXI_SRAM is not set
+# CONFIG_SOC_TI is not set
+# CONFIG_PM_DEVFREQ is not set
+# CONFIG_EXTCON is not set
+# CONFIG_MEMORY is not set
+# CONFIG_IIO is not set
+# CONFIG_PWM is not set
+CONFIG_IRQCHIP=y
+CONFIG_ARM_GIC=y
+CONFIG_ARM_GIC_MAX_NR=1
+# CONFIG_IPACK_BUS is not set
+CONFIG_ARCH_HAS_RESET_CONTROLLER=y
+CONFIG_RESET_CONTROLLER=y
+# CONFIG_RESET_ATH79 is not set
+# CONFIG_RESET_BERLIN is not set
+# CONFIG_RESET_LPC18XX is not set
+# CONFIG_RESET_MESON is not set
+# CONFIG_RESET_PISTACHIO is not set
+# CONFIG_RESET_SOCFPGA is not set
+# CONFIG_RESET_STM32 is not set
+# CONFIG_RESET_SUNXI is not set
+# CONFIG_TI_SYSCON_RESET is not set
+# CONFIG_RESET_ZYNQ is not set
+# CONFIG_FMC is not set
+
+#
+# PHY Subsystem
+#
+CONFIG_GENERIC_PHY=y
+# CONFIG_PHY_PXA_28NM_HSIC is not set
+# CONFIG_PHY_PXA_28NM_USB2 is not set
+# CONFIG_BCM_KONA_USB2_PHY is not set
+CONFIG_PHY_HISI_USB2=y
+# CONFIG_POWERCAP is not set
+# CONFIG_MCB is not set
+
+#
+# Performance monitor support
+#
+# CONFIG_RAS is not set
+
+#
+# Android
+#
+# CONFIG_ANDROID is not set
+# CONFIG_NVMEM is not set
+# CONFIG_STM is not set
+# CONFIG_INTEL_TH is not set
+
+#
+# FPGA Configuration Support
+#
+# CONFIG_FPGA is not set
+# CONFIG_HI_DMAC is not set
+
+#
+# Firmware Drivers
+#
+# CONFIG_FIRMWARE_MEMMAP is not set
+# CONFIG_FW_CFG_SYSFS is not set
+CONFIG_HAVE_ARM_SMCCC=y
+
+#
+# File systems
+#
+CONFIG_DCACHE_WORD_ACCESS=y
+# CONFIG_EXT2_FS is not set
+# CONFIG_EXT3_FS is not set
+CONFIG_EXT4_FS=y
+CONFIG_EXT4_USE_FOR_EXT2=y
+# CONFIG_EXT4_FS_POSIX_ACL is not set
+# CONFIG_EXT4_FS_SECURITY is not set
+# CONFIG_EXT4_ENCRYPTION is not set
+# CONFIG_EXT4_DEBUG is not set
+CONFIG_JBD2=y
+# CONFIG_JBD2_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+# CONFIG_NILFS2_FS is not set
+# CONFIG_F2FS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_EXPORTFS=y
+# CONFIG_EXPORTFS_BLOCK_OPS is not set
+CONFIG_FILE_LOCKING=y
+CONFIG_MANDATORY_FILE_LOCKING=y
+# CONFIG_FS_ENCRYPTION is not set
+CONFIG_FSNOTIFY=y
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_FANOTIFY is not set
+# CONFIG_QUOTA is not set
+# CONFIG_QUOTACTL is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+# CONFIG_OVERLAY_FS is not set
+
+#
+# Caches
+#
+# CONFIG_FSCACHE is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+# CONFIG_ISO9660_FS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_FAT_DEFAULT_UTF8 is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+# CONFIG_PROC_CHILDREN is not set
+CONFIG_KERNFS=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+# CONFIG_TMPFS_POSIX_ACL is not set
+# CONFIG_TMPFS_XATTR is not set
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_CONFIGFS_FS=m
+CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ORANGEFS_FS is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_ECRYPT_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_YAFFS_FS=y
+CONFIG_YAFFS_YAFFS1=y
+# CONFIG_YAFFS_9BYTE_TAGS is not set
+# CONFIG_YAFFS_DOES_ECC is not set
+CONFIG_YAFFS_YAFFS2=y
+CONFIG_YAFFS_AUTO_YAFFS2=y
+# CONFIG_YAFFS_DISABLE_TAGS_ECC is not set
+# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
+# CONFIG_YAFFS_EMPTY_LOST_AND_FOUND is not set
+# CONFIG_YAFFS_DISABLE_BLOCK_REFRESHING is not set
+# CONFIG_YAFFS_DISABLE_BACKGROUND is not set
+# CONFIG_YAFFS_DISABLE_BAD_BLOCK_MARKING is not set
+CONFIG_YAFFS_XATTR=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+# CONFIG_LOGFS is not set
+CONFIG_CRAMFS=y
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX6FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_PSTORE is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V2=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+# CONFIG_NFS_SWAP is not set
+# CONFIG_NFS_V4_1 is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFS_USE_LEGACY_DNS is not set
+CONFIG_NFS_USE_KERNEL_DNS=y
+# CONFIG_NFSD is not set
+CONFIG_GRACE_PERIOD=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_DEBUG is not set
+# CONFIG_CEPH_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ASCII is not set
+CONFIG_NLS_ISO8859_1=y
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_MAC_ROMAN is not set
+# CONFIG_NLS_MAC_CELTIC is not set
+# CONFIG_NLS_MAC_CENTEURO is not set
+# CONFIG_NLS_MAC_CROATIAN is not set
+# CONFIG_NLS_MAC_CYRILLIC is not set
+# CONFIG_NLS_MAC_GAELIC is not set
+# CONFIG_NLS_MAC_GREEK is not set
+# CONFIG_NLS_MAC_ICELAND is not set
+# CONFIG_NLS_MAC_INUIT is not set
+# CONFIG_NLS_MAC_ROMANIAN is not set
+# CONFIG_NLS_MAC_TURKISH is not set
+CONFIG_NLS_UTF8=y
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+
+#
+# printk and dmesg options
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4
+# CONFIG_BOOT_PRINTK_DELAY is not set
+
+#
+# Compile-time checks and compiler options
+#
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=1024
+# CONFIG_STRIP_ASM_SYMS is not set
+# CONFIG_READABLE_ASM is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_PAGE_OWNER is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_SECTION_MISMATCH is not set
+CONFIG_SECTION_MISMATCH_WARN_ONLY=y
+CONFIG_FRAME_POINTER=y
+# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
+# CONFIG_MAGIC_SYSRQ is not set
+CONFIG_DEBUG_KERNEL=y
+
+#
+# Memory Debugging
+#
+# CONFIG_PAGE_EXTENSION is not set
+# CONFIG_PAGE_POISONING is not set
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS is not set
+CONFIG_HAVE_DEBUG_KMEMLEAK=y
+# CONFIG_DEBUG_KMEMLEAK is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_VM is not set
+CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_DEBUG_SHIRQ is not set
+
+#
+# Debug Lockups and Hangs
+#
+# CONFIG_LOCKUP_DETECTOR is not set
+# CONFIG_DETECT_HUNG_TASK is not set
+# CONFIG_WQ_WATCHDOG is not set
+# CONFIG_PANIC_ON_OOPS is not set
+CONFIG_PANIC_ON_OOPS_VALUE=0
+CONFIG_PANIC_TIMEOUT=0
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_SCHED_INFO is not set
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_SCHED_STACK_END_CHECK is not set
+# CONFIG_DEBUG_TIMEKEEPING is not set
+# CONFIG_TIMER_STATS is not set
+
+#
+# Lock Debugging (spinlocks, mutexes, etc...)
+#
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_ATOMIC_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_LOCK_TORTURE_TEST is not set
+CONFIG_STACKTRACE=y
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_PI_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_DEBUG_CREDENTIALS is not set
+
+#
+# RCU Debugging
+#
+# CONFIG_PROVE_RCU is not set
+# CONFIG_SPARSE_RCU_POINTER is not set
+# CONFIG_TORTURE_TEST is not set
+# CONFIG_RCU_PERF_TEST is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_TRACE is not set
+# CONFIG_RCU_EQS_DEBUG is not set
+# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_NOTIFIER_ERROR_INJECTION is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_TRACING_SUPPORT=y
+# CONFIG_FTRACE is not set
+
+#
+# Runtime Testing
+#
+# CONFIG_TEST_LIST_SORT is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_RBTREE_TEST is not set
+# CONFIG_INTERVAL_TREE_TEST is not set
+# CONFIG_PERCPU_TEST is not set
+# CONFIG_ATOMIC64_SELFTEST is not set
+# CONFIG_TEST_HEXDUMP is not set
+# CONFIG_TEST_STRING_HELPERS is not set
+# CONFIG_TEST_KSTRTOX is not set
+# CONFIG_TEST_PRINTF is not set
+# CONFIG_TEST_BITMAP is not set
+# CONFIG_TEST_UUID is not set
+# CONFIG_TEST_RHASHTABLE is not set
+# CONFIG_TEST_HASH is not set
+# CONFIG_DMA_API_DEBUG is not set
+# CONFIG_TEST_LKM is not set
+# CONFIG_TEST_USER_COPY is not set
+# CONFIG_TEST_BPF is not set
+# CONFIG_TEST_FIRMWARE is not set
+# CONFIG_TEST_UDELAY is not set
+# CONFIG_MEMTEST is not set
+# CONFIG_TEST_STATIC_KEYS is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+# CONFIG_ARCH_WANTS_UBSAN_NO_NULL is not set
+# CONFIG_UBSAN is not set
+CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y
+CONFIG_STRICT_DEVMEM=y
+# CONFIG_IO_STRICT_DEVMEM is not set
+# CONFIG_ARM_PTDUMP is not set
+# CONFIG_ARM_UNWIND is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_LL is not set
+CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
+# CONFIG_DEBUG_UART_8250 is not set
+CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
+# CONFIG_PID_IN_CONTEXTIDR is not set
+# CONFIG_DEBUG_SET_MODULE_RONX is not set
+# CONFIG_CORESIGHT is not set
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_PERSISTENT_KEYRINGS is not set
+# CONFIG_ENCRYPTED_KEYS is not set
+# CONFIG_KEY_DH_OPERATIONS is not set
+# CONFIG_SECURITY_DMESG_RESTRICT is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y
+CONFIG_HAVE_ARCH_HARDENED_USERCOPY=y
+# CONFIG_HARDENED_USERCOPY is not set
+CONFIG_DEFAULT_SECURITY_DAC=y
+CONFIG_DEFAULT_SECURITY=""
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG=m
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_RNG_DEFAULT=m
+CONFIG_CRYPTO_AKCIPHER2=y
+CONFIG_CRYPTO_KPP2=y
+# CONFIG_CRYPTO_RSA is not set
+# CONFIG_CRYPTO_DH is not set
+# CONFIG_CRYPTO_ECDH is not set
+CONFIG_CRYPTO_MANAGER=m
+CONFIG_CRYPTO_MANAGER2=y
+# CONFIG_CRYPTO_USER is not set
+CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_NULL2=y
+CONFIG_CRYPTO_WORKQUEUE=y
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_MCRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+CONFIG_CRYPTO_CCM=m
+CONFIG_CRYPTO_GCM=m
+# CONFIG_CRYPTO_CHACHA20POLY1305 is not set
+CONFIG_CRYPTO_SEQIV=m
+CONFIG_CRYPTO_ECHAINIV=m
+
+#
+# Block modes
+#
+# CONFIG_CRYPTO_CBC is not set
+CONFIG_CRYPTO_CTR=m
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+# CONFIG_CRYPTO_KEYWRAP is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_CMAC is not set
+CONFIG_CRYPTO_HMAC=m
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_VMAC is not set
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+# CONFIG_CRYPTO_CRC32 is not set
+CONFIG_CRYPTO_CRCT10DIF=y
+CONFIG_CRYPTO_GHASH=m
+# CONFIG_CRYPTO_POLY1305 is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+CONFIG_CRYPTO_SHA1=y
+CONFIG_CRYPTO_SHA256=y
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_SHA3 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=y
+# CONFIG_CRYPTO_ANUBIS is not set
+CONFIG_CRYPTO_ARC4=y
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_CHACHA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_LZO=y
+# CONFIG_CRYPTO_842 is not set
+# CONFIG_CRYPTO_LZ4 is not set
+# CONFIG_CRYPTO_LZ4HC is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_DRBG_MENU=m
+CONFIG_CRYPTO_DRBG_HMAC=y
+# CONFIG_CRYPTO_DRBG_HASH is not set
+# CONFIG_CRYPTO_DRBG_CTR is not set
+CONFIG_CRYPTO_DRBG=m
+CONFIG_CRYPTO_JITTERENTROPY=m
+# CONFIG_CRYPTO_USER_API_HASH is not set
+# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
+# CONFIG_CRYPTO_USER_API_RNG is not set
+# CONFIG_CRYPTO_USER_API_AEAD is not set
+# CONFIG_CRYPTO_HW is not set
+# CONFIG_ASYMMETRIC_KEY_TYPE is not set
+
+#
+# Certificates for signature checking
+#
+# CONFIG_ARM_CRYPTO is not set
+# CONFIG_BINARY_PRINTF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_HAVE_ARCH_BITREVERSE=y
+CONFIG_RATIONAL=y
+CONFIG_GENERIC_STRNCPY_FROM_USER=y
+CONFIG_GENERIC_STRNLEN_USER=y
+CONFIG_GENERIC_NET_UTILS=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_IO=y
+CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
+CONFIG_CRC_CCITT=y
+CONFIG_CRC16=y
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC32=y
+# CONFIG_CRC32_SELFTEST is not set
+CONFIG_CRC32_SLICEBY8=y
+# CONFIG_CRC32_SLICEBY4 is not set
+# CONFIG_CRC32_SARWATE is not set
+# CONFIG_CRC32_BIT is not set
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=y
+# CONFIG_CRC8 is not set
+# CONFIG_AUDIT_ARCH_COMPAT_GENERIC is not set
+# CONFIG_RANDOM32_SELFTEST is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_LZ4_DECOMPRESS=y
+CONFIG_XZ_DEC=y
+CONFIG_XZ_DEC_X86=y
+CONFIG_XZ_DEC_POWERPC=y
+CONFIG_XZ_DEC_IA64=y
+CONFIG_XZ_DEC_ARM=y
+CONFIG_XZ_DEC_ARMTHUMB=y
+CONFIG_XZ_DEC_SPARC=y
+CONFIG_XZ_DEC_BCJ=y
+# CONFIG_XZ_DEC_TEST is not set
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_DECOMPRESS_LZ4=y
+CONFIG_GENERIC_ALLOCATOR=y
+CONFIG_ASSOCIATIVE_ARRAY=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT_MAP=y
+CONFIG_HAS_DMA=y
+CONFIG_DQL=y
+CONFIG_NLATTR=y
+# CONFIG_CORDIC is not set
+# CONFIG_DDR is not set
+# CONFIG_IRQ_POLL is not set
+CONFIG_LIBFDT=y
+CONFIG_OID_REGISTRY=y
+# CONFIG_SG_SPLIT is not set
+# CONFIG_SG_POOL is not set
+CONFIG_ARCH_HAS_SG_CHAIN=y
+CONFIG_SBITMAP=y
+# CONFIG_VIRTUALIZATION is not set
diff --git a/arch/arm/configs/hi3536dv100_full_defconfig b/arch/arm/configs/hi3536dv100_full_defconfig
new file mode 100644
index 0000000..2bbed4f5
--- /dev/null
+++ b/arch/arm/configs/hi3536dv100_full_defconfig
@@ -0,0 +1,2718 @@
+#
+# Automatically generated file; DO NOT EDIT.
+# Linux/arm 4.9.37 Kernel Configuration
+#
+CONFIG_ARM=y
+CONFIG_ARM_HAS_SG_CHAIN=y
+CONFIG_MIGHT_HAVE_PCI=y
+CONFIG_SYS_SUPPORTS_APM_EMULATION=y
+CONFIG_HAVE_PROC_CPU=y
+CONFIG_STACKTRACE_SUPPORT=y
+CONFIG_LOCKDEP_SUPPORT=y
+CONFIG_TRACE_IRQFLAGS_SUPPORT=y
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_FIX_EARLYCON_MEM=y
+CONFIG_GENERIC_HWEIGHT=y
+CONFIG_GENERIC_CALIBRATE_DELAY=y
+CONFIG_NEED_DMA_MAP_STATE=y
+CONFIG_ARCH_SUPPORTS_UPROBES=y
+CONFIG_VECTORS_BASE=0xffff0000
+CONFIG_ARM_PATCH_PHYS_VIRT=y
+CONFIG_GENERIC_BUG=y
+CONFIG_PGTABLE_LEVELS=2
+CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
+CONFIG_IRQ_WORK=y
+CONFIG_BUILDTIME_EXTABLE_SORT=y
+
+#
+# General setup
+#
+CONFIG_BROKEN_ON_SMP=y
+CONFIG_INIT_ENV_ARG_LIMIT=32
+CONFIG_CROSS_COMPILE=""
+# CONFIG_COMPILE_TEST is not set
+CONFIG_LOCALVERSION=""
+# CONFIG_LOCALVERSION_AUTO is not set
+CONFIG_HAVE_KERNEL_GZIP=y
+CONFIG_HAVE_KERNEL_LZMA=y
+CONFIG_HAVE_KERNEL_XZ=y
+CONFIG_HAVE_KERNEL_LZO=y
+CONFIG_HAVE_KERNEL_LZ4=y
+CONFIG_KERNEL_GZIP=y
+# CONFIG_KERNEL_LZMA is not set
+# CONFIG_KERNEL_XZ is not set
+# CONFIG_KERNEL_LZO is not set
+# CONFIG_KERNEL_LZ4 is not set
+CONFIG_DEFAULT_HOSTNAME="(none)"
+CONFIG_SWAP=y
+CONFIG_SYSVIPC=y
+CONFIG_SYSVIPC_SYSCTL=y
+# CONFIG_POSIX_MQUEUE is not set
+CONFIG_CROSS_MEMORY_ATTACH=y
+CONFIG_FHANDLE=y
+CONFIG_USELIB=y
+# CONFIG_AUDIT is not set
+CONFIG_HAVE_ARCH_AUDITSYSCALL=y
+
+#
+# IRQ subsystem
+#
+CONFIG_GENERIC_IRQ_PROBE=y
+CONFIG_GENERIC_IRQ_SHOW=y
+CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
+CONFIG_HARDIRQS_SW_RESEND=y
+CONFIG_IRQ_DOMAIN=y
+CONFIG_IRQ_DOMAIN_HIERARCHY=y
+CONFIG_HANDLE_DOMAIN_IRQ=y
+CONFIG_IRQ_FORCED_THREADING=y
+CONFIG_SPARSE_IRQ=y
+CONFIG_ARCH_CLOCKSOURCE_DATA=y
+CONFIG_GENERIC_TIME_VSYSCALL=y
+CONFIG_GENERIC_CLOCKEVENTS=y
+
+#
+# Timers subsystem
+#
+CONFIG_HZ_PERIODIC=y
+# CONFIG_NO_HZ_IDLE is not set
+# CONFIG_NO_HZ is not set
+# CONFIG_HIGH_RES_TIMERS is not set
+
+#
+# CPU/Task time and stats accounting
+#
+CONFIG_TICK_CPU_ACCOUNTING=y
+# CONFIG_VIRT_CPU_ACCOUNTING_GEN is not set
+CONFIG_IRQ_TIME_ACCOUNTING=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+# CONFIG_TASKSTATS is not set
+
+#
+# RCU Subsystem
+#
+CONFIG_TINY_RCU=y
+# CONFIG_RCU_EXPERT is not set
+CONFIG_SRCU=y
+# CONFIG_TASKS_RCU is not set
+# CONFIG_RCU_STALL_COMMON is not set
+# CONFIG_TREE_RCU_TRACE is not set
+# CONFIG_RCU_EXPEDITE_BOOT is not set
+# CONFIG_BUILD_BIN2C is not set
+# CONFIG_IKCONFIG is not set
+CONFIG_LOG_BUF_SHIFT=17
+CONFIG_NMI_LOG_BUF_SHIFT=13
+CONFIG_GENERIC_SCHED_CLOCK=y
+CONFIG_CGROUPS=y
+# CONFIG_MEMCG is not set
+# CONFIG_BLK_CGROUP is not set
+# CONFIG_CGROUP_SCHED is not set
+# CONFIG_CGROUP_PIDS is not set
+CONFIG_CGROUP_FREEZER=y
+# CONFIG_CPUSETS is not set
+# CONFIG_CGROUP_DEVICE is not set
+# CONFIG_CGROUP_CPUACCT is not set
+# CONFIG_CGROUP_DEBUG is not set
+# CONFIG_CHECKPOINT_RESTORE is not set
+CONFIG_NAMESPACES=y
+CONFIG_UTS_NS=y
+CONFIG_IPC_NS=y
+# CONFIG_USER_NS is not set
+CONFIG_PID_NS=y
+CONFIG_NET_NS=y
+# CONFIG_SCHED_AUTOGROUP is not set
+# CONFIG_SYSFS_DEPRECATED is not set
+# CONFIG_RELAY is not set
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_INITRAMFS_SOURCE=""
+CONFIG_RD_GZIP=y
+# CONFIG_RD_BZIP2 is not set
+# CONFIG_RD_LZMA is not set
+# CONFIG_RD_XZ is not set
+# CONFIG_RD_LZO is not set
+CONFIG_RD_LZ4=y
+CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE=y
+# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
+CONFIG_SYSCTL=y
+CONFIG_ANON_INODES=y
+CONFIG_HAVE_UID16=y
+CONFIG_BPF=y
+# CONFIG_EXPERT is not set
+CONFIG_UID16=y
+CONFIG_MULTIUSER=y
+# CONFIG_SGETMASK_SYSCALL is not set
+CONFIG_SYSFS_SYSCALL=y
+# CONFIG_SYSCTL_SYSCALL is not set
+CONFIG_KALLSYMS=y
+# CONFIG_KALLSYMS_ALL is not set
+# CONFIG_KALLSYMS_ABSOLUTE_PERCPU is not set
+CONFIG_KALLSYMS_BASE_RELATIVE=y
+CONFIG_PRINTK=y
+CONFIG_PRINTK_NMI=y
+CONFIG_BUG=y
+CONFIG_ELF_CORE=y
+CONFIG_BASE_FULL=y
+CONFIG_FUTEX=y
+CONFIG_EPOLL=y
+CONFIG_SIGNALFD=y
+CONFIG_TIMERFD=y
+CONFIG_EVENTFD=y
+# CONFIG_BPF_SYSCALL is not set
+CONFIG_SHMEM=y
+CONFIG_AIO=y
+CONFIG_ADVISE_SYSCALLS=y
+# CONFIG_USERFAULTFD is not set
+CONFIG_MEMBARRIER=y
+# CONFIG_EMBEDDED is not set
+CONFIG_HAVE_PERF_EVENTS=y
+CONFIG_PERF_USE_VMALLOC=y
+
+#
+# Kernel Performance Events And Counters
+#
+# CONFIG_PERF_EVENTS is not set
+CONFIG_VM_EVENT_COUNTERS=y
+CONFIG_SLUB_DEBUG=y
+CONFIG_COMPAT_BRK=y
+# CONFIG_SLAB is not set
+CONFIG_SLUB=y
+# CONFIG_SLAB_FREELIST_RANDOM is not set
+# CONFIG_SYSTEM_DATA_VERIFICATION is not set
+# CONFIG_PROFILING is not set
+CONFIG_HAVE_OPROFILE=y
+# CONFIG_KPROBES is not set
+# CONFIG_JUMP_LABEL is not set
+# CONFIG_UPROBES is not set
+# CONFIG_HAVE_64BIT_ALIGNED_ACCESS is not set
+CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y
+CONFIG_ARCH_USE_BUILTIN_BSWAP=y
+CONFIG_HAVE_KPROBES=y
+CONFIG_HAVE_KRETPROBES=y
+CONFIG_HAVE_OPTPROBES=y
+CONFIG_HAVE_NMI=y
+CONFIG_HAVE_ARCH_TRACEHOOK=y
+CONFIG_HAVE_DMA_CONTIGUOUS=y
+CONFIG_GENERIC_SMP_IDLE_THREAD=y
+CONFIG_GENERIC_IDLE_POLL_SETUP=y
+CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
+CONFIG_HAVE_CLK=y
+CONFIG_HAVE_DMA_API_DEBUG=y
+CONFIG_HAVE_PERF_REGS=y
+CONFIG_HAVE_PERF_USER_STACK_DUMP=y
+CONFIG_HAVE_ARCH_JUMP_LABEL=y
+CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
+CONFIG_HAVE_ARCH_SECCOMP_FILTER=y
+CONFIG_HAVE_GCC_PLUGINS=y
+# CONFIG_GCC_PLUGINS is not set
+CONFIG_HAVE_CC_STACKPROTECTOR=y
+# CONFIG_CC_STACKPROTECTOR is not set
+CONFIG_CC_STACKPROTECTOR_NONE=y
+# CONFIG_CC_STACKPROTECTOR_REGULAR is not set
+# CONFIG_CC_STACKPROTECTOR_STRONG is not set
+CONFIG_HAVE_CONTEXT_TRACKING=y
+CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
+CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
+CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
+CONFIG_MODULES_USE_ELF_REL=y
+CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
+CONFIG_HAVE_ARCH_MMAP_RND_BITS=y
+CONFIG_HAVE_EXIT_THREAD=y
+CONFIG_ARCH_MMAP_RND_BITS_MIN=8
+CONFIG_ARCH_MMAP_RND_BITS_MAX=16
+CONFIG_ARCH_MMAP_RND_BITS=8
+# CONFIG_HAVE_ARCH_HASH is not set
+# CONFIG_ISA_BUS_API is not set
+CONFIG_CLONE_BACKWARDS=y
+CONFIG_OLD_SIGSUSPEND3=y
+CONFIG_OLD_SIGACTION=y
+# CONFIG_CPU_NO_EFFICIENT_FFS is not set
+# CONFIG_HAVE_ARCH_VMAP_STACK is not set
+
+#
+# GCOV-based kernel profiling
+#
+CONFIG_ARCH_HAS_GCOV_PROFILE_ALL=y
+CONFIG_HAVE_GENERIC_DMA_COHERENT=y
+CONFIG_SLABINFO=y
+CONFIG_RT_MUTEXES=y
+CONFIG_BASE_SMALL=0
+CONFIG_MODULES=y
+# CONFIG_MODULE_FORCE_LOAD is not set
+CONFIG_MODULE_UNLOAD=y
+# CONFIG_MODULE_FORCE_UNLOAD is not set
+# CONFIG_MODVERSIONS is not set
+# CONFIG_MODULE_SRCVERSION_ALL is not set
+# CONFIG_MODULE_SIG is not set
+# CONFIG_MODULE_COMPRESS is not set
+# CONFIG_TRIM_UNUSED_KSYMS is not set
+CONFIG_BLOCK=y
+CONFIG_LBDAF=y
+CONFIG_BLK_DEV_BSG=y
+# CONFIG_BLK_DEV_BSGLIB is not set
+# CONFIG_BLK_DEV_INTEGRITY is not set
+CONFIG_BLK_CMDLINE_PARSER=y
+
+#
+# Partition Types
+#
+CONFIG_PARTITION_ADVANCED=y
+# CONFIG_ACORN_PARTITION is not set
+# CONFIG_AIX_PARTITION is not set
+# CONFIG_OSF_PARTITION is not set
+# CONFIG_AMIGA_PARTITION is not set
+# CONFIG_ATARI_PARTITION is not set
+# CONFIG_MAC_PARTITION is not set
+CONFIG_MSDOS_PARTITION=y
+# CONFIG_BSD_DISKLABEL is not set
+# CONFIG_MINIX_SUBPARTITION is not set
+# CONFIG_SOLARIS_X86_PARTITION is not set
+# CONFIG_UNIXWARE_DISKLABEL is not set
+# CONFIG_LDM_PARTITION is not set
+# CONFIG_SGI_PARTITION is not set
+# CONFIG_ULTRIX_PARTITION is not set
+# CONFIG_SUN_PARTITION is not set
+# CONFIG_KARMA_PARTITION is not set
+CONFIG_EFI_PARTITION=y
+# CONFIG_SYSV68_PARTITION is not set
+CONFIG_CMDLINE_PARTITION=y
+
+#
+# IO Schedulers
+#
+CONFIG_IOSCHED_NOOP=y
+CONFIG_IOSCHED_DEADLINE=y
+CONFIG_IOSCHED_CFQ=y
+CONFIG_DEFAULT_DEADLINE=y
+# CONFIG_DEFAULT_CFQ is not set
+# CONFIG_DEFAULT_NOOP is not set
+CONFIG_DEFAULT_IOSCHED="deadline"
+CONFIG_INLINE_SPIN_UNLOCK_IRQ=y
+CONFIG_INLINE_READ_UNLOCK=y
+CONFIG_INLINE_READ_UNLOCK_IRQ=y
+CONFIG_INLINE_WRITE_UNLOCK=y
+CONFIG_INLINE_WRITE_UNLOCK_IRQ=y
+CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y
+CONFIG_FREEZER=y
+
+#
+# System Type
+#
+CONFIG_MMU=y
+CONFIG_ARCH_MULTIPLATFORM=y
+# CONFIG_ARCH_GEMINI is not set
+# CONFIG_ARCH_EBSA110 is not set
+# CONFIG_ARCH_EP93XX is not set
+# CONFIG_ARCH_FOOTBRIDGE is not set
+# CONFIG_ARCH_NETX is not set
+# CONFIG_ARCH_IOP13XX is not set
+# CONFIG_ARCH_IOP32X is not set
+# CONFIG_ARCH_IOP33X is not set
+# CONFIG_ARCH_IXP4XX is not set
+# CONFIG_ARCH_DOVE is not set
+# CONFIG_ARCH_KS8695 is not set
+# CONFIG_ARCH_W90X900 is not set
+# CONFIG_ARCH_LPC32XX is not set
+# CONFIG_ARCH_PXA is not set
+# CONFIG_ARCH_RPC is not set
+# CONFIG_ARCH_SA1100 is not set
+# CONFIG_ARCH_S3C24XX is not set
+# CONFIG_ARCH_DAVINCI is not set
+# CONFIG_ARCH_OMAP1 is not set
+
+#
+# Multiple platform selection
+#
+
+#
+# CPU Core family selection
+#
+# CONFIG_ARCH_MULTI_V6 is not set
+CONFIG_ARCH_MULTI_V7=y
+CONFIG_ARCH_MULTI_V6_V7=y
+# CONFIG_ARCH_MULTI_CPU_AUTO is not set
+# CONFIG_ARCH_VIRT is not set
+# CONFIG_ARCH_MVEBU is not set
+# CONFIG_ARCH_ALPINE is not set
+# CONFIG_ARCH_ARTPEC is not set
+# CONFIG_ARCH_AT91 is not set
+# CONFIG_ARCH_BCM is not set
+# CONFIG_ARCH_BERLIN is not set
+# CONFIG_ARCH_DIGICOLOR is not set
+# CONFIG_ARCH_HIGHBANK is not set
+# CONFIG_ARCH_HISI is not set
+CONFIG_ARCH_HISI_BVT=y
+
+#
+# Hisilicon BVT platform type
+#
+CONFIG_HI_ZRELADDR=0x80008000
+CONFIG_HI_PARAMS_PHYS=0x00000100
+CONFIG_HI_INITRD_PHYS=0x00800000
+# CONFIG_ARCH_HI3516A is not set
+CONFIG_ARCH_HI3536DV100=y
+# CONFIG_ARCH_KEYSTONE is not set
+# CONFIG_ARCH_MESON is not set
+# CONFIG_ARCH_MXC is not set
+# CONFIG_ARCH_MEDIATEK is not set
+
+#
+# TI OMAP/AM/DM/DRA Family
+#
+# CONFIG_ARCH_OMAP3 is not set
+# CONFIG_ARCH_OMAP4 is not set
+# CONFIG_SOC_OMAP5 is not set
+# CONFIG_SOC_AM33XX is not set
+# CONFIG_SOC_AM43XX is not set
+# CONFIG_SOC_DRA7XX is not set
+# CONFIG_ARCH_MMP is not set
+# CONFIG_ARCH_QCOM is not set
+# CONFIG_ARCH_REALVIEW is not set
+# CONFIG_ARCH_ROCKCHIP is not set
+# CONFIG_ARCH_SOCFPGA is not set
+# CONFIG_PLAT_SPEAR is not set
+# CONFIG_ARCH_STI is not set
+# CONFIG_ARCH_S5PV210 is not set
+# CONFIG_ARCH_EXYNOS is not set
+# CONFIG_ARCH_RENESAS is not set
+# CONFIG_ARCH_SUNXI is not set
+# CONFIG_ARCH_SIRF is not set
+# CONFIG_ARCH_TANGO is not set
+# CONFIG_ARCH_TEGRA is not set
+# CONFIG_ARCH_UNIPHIER is not set
+# CONFIG_ARCH_U8500 is not set
+# CONFIG_ARCH_VEXPRESS is not set
+# CONFIG_ARCH_WM8850 is not set
+# CONFIG_ARCH_ZX is not set
+# CONFIG_ARCH_ZYNQ is not set
+
+#
+# Processor Type
+#
+CONFIG_CPU_V7=y
+CONFIG_CPU_32v6K=y
+CONFIG_CPU_32v7=y
+CONFIG_CPU_ABRT_EV7=y
+CONFIG_CPU_PABRT_V7=y
+CONFIG_CPU_CACHE_V7=y
+CONFIG_CPU_CACHE_VIPT=y
+CONFIG_CPU_COPY_V6=y
+CONFIG_CPU_TLB_V7=y
+CONFIG_CPU_HAS_ASID=y
+CONFIG_CPU_CP15=y
+CONFIG_CPU_CP15_MMU=y
+
+#
+# Processor Features
+#
+# CONFIG_ARM_LPAE is not set
+# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
+CONFIG_ARM_THUMB=y
+# CONFIG_ARM_THUMBEE is not set
+CONFIG_ARM_VIRT_EXT=y
+# CONFIG_SWP_EMULATE is not set
+# CONFIG_CPU_ICACHE_DISABLE is not set
+# CONFIG_CPU_DCACHE_DISABLE is not set
+# CONFIG_CPU_BPREDICT_DISABLE is not set
+CONFIG_KUSER_HELPERS=y
+CONFIG_VDSO=y
+CONFIG_MIGHT_HAVE_CACHE_L2X0=y
+# CONFIG_CACHE_L2X0 is not set
+CONFIG_ARM_L1_CACHE_SHIFT_6=y
+CONFIG_ARM_L1_CACHE_SHIFT=6
+CONFIG_ARM_DMA_MEM_BUFFERABLE=y
+# CONFIG_DEBUG_RODATA is not set
+CONFIG_MULTI_IRQ_HANDLER=y
+# CONFIG_ARM_ERRATA_430973 is not set
+# CONFIG_ARM_ERRATA_720789 is not set
+# CONFIG_ARM_ERRATA_754322 is not set
+# CONFIG_ARM_ERRATA_775420 is not set
+# CONFIG_ARM_ERRATA_773022 is not set
+# CONFIG_ARM_ERRATA_818325_852422 is not set
+# CONFIG_ARM_ERRATA_821420 is not set
+# CONFIG_ARM_ERRATA_825619 is not set
+# CONFIG_ARM_ERRATA_852421 is not set
+# CONFIG_ARM_ERRATA_852423 is not set
+
+#
+# Bus support
+#
+# CONFIG_PCI is not set
+# CONFIG_PCI_DOMAINS_GENERIC is not set
+# CONFIG_PCI_SYSCALL is not set
+# CONFIG_PCCARD is not set
+
+#
+# Kernel Features
+#
+CONFIG_HAVE_SMP=y
+# CONFIG_SMP is not set
+CONFIG_HAVE_ARM_ARCH_TIMER=y
+CONFIG_VMSPLIT_3G=y
+# CONFIG_VMSPLIT_3G_OPT is not set
+# CONFIG_VMSPLIT_2G is not set
+# CONFIG_VMSPLIT_1G is not set
+CONFIG_PAGE_OFFSET=0xC0000000
+# CONFIG_ARM_PSCI is not set
+CONFIG_ARCH_NR_GPIO=0
+CONFIG_PREEMPT_NONE=y
+# CONFIG_PREEMPT_VOLUNTARY is not set
+# CONFIG_PREEMPT is not set
+CONFIG_HZ_FIXED=0
+CONFIG_HZ_100=y
+# CONFIG_HZ_200 is not set
+# CONFIG_HZ_250 is not set
+# CONFIG_HZ_300 is not set
+# CONFIG_HZ_500 is not set
+# CONFIG_HZ_1000 is not set
+CONFIG_HZ=100
+# CONFIG_SCHED_HRTICK is not set
+# CONFIG_THUMB2_KERNEL is not set
+CONFIG_ARM_PATCH_IDIV=y
+CONFIG_AEABI=y
+# CONFIG_OABI_COMPAT is not set
+# CONFIG_ARCH_SPARSEMEM_DEFAULT is not set
+# CONFIG_ARCH_SELECT_MEMORY_MODEL is not set
+CONFIG_HAVE_ARCH_PFN_VALID=y
+# CONFIG_HIGHMEM is not set
+# CONFIG_CPU_SW_DOMAIN_PAN is not set
+CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
+# CONFIG_ARM_MODULE_PLTS is not set
+CONFIG_FLATMEM=y
+CONFIG_FLAT_NODE_MEM_MAP=y
+CONFIG_HAVE_MEMBLOCK=y
+CONFIG_NO_BOOTMEM=y
+# CONFIG_HAVE_BOOTMEM_INFO_NODE is not set
+CONFIG_SPLIT_PTLOCK_CPUS=4
+CONFIG_COMPACTION=y
+CONFIG_MIGRATION=y
+# CONFIG_PHYS_ADDR_T_64BIT is not set
+# CONFIG_KSM is not set
+CONFIG_DEFAULT_MMAP_MIN_ADDR=4096
+CONFIG_NEED_PER_CPU_KM=y
+# CONFIG_CLEANCACHE is not set
+# CONFIG_FRONTSWAP is not set
+# CONFIG_CMA is not set
+# CONFIG_ZPOOL is not set
+# CONFIG_ZBUD is not set
+# CONFIG_ZSMALLOC is not set
+CONFIG_GENERIC_EARLY_IOREMAP=y
+# CONFIG_IDLE_PAGE_TRACKING is not set
+CONFIG_FORCE_MAX_ZONEORDER=11
+CONFIG_ALIGNMENT_TRAP=y
+# CONFIG_UACCESS_WITH_MEMCPY is not set
+# CONFIG_SECCOMP is not set
+CONFIG_SWIOTLB=y
+CONFIG_IOMMU_HELPER=y
+# CONFIG_PARAVIRT is not set
+# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set
+# CONFIG_XEN is not set
+
+#
+# Boot options
+#
+CONFIG_USE_OF=y
+CONFIG_ATAGS=y
+# CONFIG_DEPRECATED_PARAM_STRUCT is not set
+CONFIG_ZBOOT_ROM_TEXT=0
+CONFIG_ZBOOT_ROM_BSS=0
+CONFIG_ARM_APPENDED_DTB=y
+CONFIG_ARM_ATAG_DTB_COMPAT=y
+CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_FROM_BOOTLOADER=y
+# CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND is not set
+CONFIG_CMDLINE=""
+# CONFIG_KEXEC is not set
+# CONFIG_CRASH_DUMP is not set
+CONFIG_AUTO_ZRELADDR=y
+# CONFIG_EFI is not set
+
+#
+# CPU Power Management
+#
+
+#
+# CPU Frequency scaling
+#
+# CONFIG_CPU_FREQ is not set
+
+#
+# CPU Idle
+#
+# CONFIG_CPU_IDLE is not set
+# CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED is not set
+
+#
+# Floating point emulation
+#
+
+#
+# At least one emulation must be selected
+#
+CONFIG_VFP=y
+CONFIG_VFPv3=y
+CONFIG_NEON=y
+# CONFIG_KERNEL_MODE_NEON is not set
+
+#
+# Userspace binary formats
+#
+CONFIG_BINFMT_ELF=y
+CONFIG_ELFCORE=y
+CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS=y
+CONFIG_BINFMT_SCRIPT=y
+# CONFIG_BINFMT_FLAT is not set
+# CONFIG_HAVE_AOUT is not set
+# CONFIG_BINFMT_MISC is not set
+CONFIG_COREDUMP=y
+
+#
+# Power management options
+#
+CONFIG_SUSPEND=y
+CONFIG_SUSPEND_FREEZER=y
+CONFIG_HIBERNATE_CALLBACKS=y
+CONFIG_HIBERNATION=y
+CONFIG_PM_STD_PARTITION=""
+CONFIG_PM_SLEEP=y
+# CONFIG_PM_AUTOSLEEP is not set
+# CONFIG_PM_WAKELOCKS is not set
+CONFIG_PM=y
+CONFIG_PM_DEBUG=y
+# CONFIG_PM_ADVANCED_DEBUG is not set
+# CONFIG_PM_TEST_SUSPEND is not set
+CONFIG_PM_SLEEP_DEBUG=y
+# CONFIG_APM_EMULATION is not set
+CONFIG_PM_CLK=y
+# CONFIG_WQ_POWER_EFFICIENT_DEFAULT is not set
+CONFIG_CPU_PM=y
+CONFIG_ARCH_SUSPEND_POSSIBLE=y
+CONFIG_ARM_CPU_SUSPEND=y
+CONFIG_ARCH_HIBERNATION_POSSIBLE=y
+CONFIG_NET=y
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_DIAG is not set
+CONFIG_UNIX=y
+# CONFIG_UNIX_DIAG is not set
+CONFIG_XFRM=y
+CONFIG_XFRM_ALGO=y
+CONFIG_XFRM_USER=y
+# CONFIG_XFRM_SUB_POLICY is not set
+# CONFIG_XFRM_MIGRATE is not set
+# CONFIG_XFRM_STATISTICS is not set
+CONFIG_NET_KEY=y
+# CONFIG_NET_KEY_MIGRATE is not set
+CONFIG_INET=y
+CONFIG_IP_MULTICAST=y
+CONFIG_IP_ADVANCED_ROUTER=y
+# CONFIG_IP_FIB_TRIE_STATS is not set
+CONFIG_IP_MULTIPLE_TABLES=y
+CONFIG_IP_ROUTE_MULTIPATH=y
+CONFIG_IP_ROUTE_VERBOSE=y
+CONFIG_IP_PNP=y
+# CONFIG_IP_PNP_DHCP is not set
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE_DEMUX is not set
+# CONFIG_NET_IP_TUNNEL is not set
+CONFIG_IP_MROUTE=y
+# CONFIG_IP_MROUTE_MULTIPLE_TABLES is not set
+CONFIG_IP_PIMSM_V1=y
+CONFIG_IP_PIMSM_V2=y
+CONFIG_SYN_COOKIES=y
+# CONFIG_NET_UDP_TUNNEL is not set
+# CONFIG_NET_FOU is not set
+# CONFIG_INET_AH is not set
+# CONFIG_INET_ESP is not set
+# CONFIG_INET_IPCOMP is not set
+# CONFIG_INET_XFRM_TUNNEL is not set
+# CONFIG_INET_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
+# CONFIG_INET_XFRM_MODE_TUNNEL is not set
+# CONFIG_INET_XFRM_MODE_BEET is not set
+CONFIG_INET_DIAG=y
+CONFIG_INET_TCP_DIAG=y
+# CONFIG_INET_UDP_DIAG is not set
+# CONFIG_INET_DIAG_DESTROY is not set
+CONFIG_TCP_CONG_ADVANCED=y
+CONFIG_TCP_CONG_BIC=m
+CONFIG_TCP_CONG_CUBIC=y
+CONFIG_TCP_CONG_WESTWOOD=m
+CONFIG_TCP_CONG_HTCP=m
+# CONFIG_TCP_CONG_HSTCP is not set
+# CONFIG_TCP_CONG_HYBLA is not set
+# CONFIG_TCP_CONG_VEGAS is not set
+# CONFIG_TCP_CONG_NV is not set
+# CONFIG_TCP_CONG_SCALABLE is not set
+# CONFIG_TCP_CONG_LP is not set
+# CONFIG_TCP_CONG_VENO is not set
+# CONFIG_TCP_CONG_YEAH is not set
+# CONFIG_TCP_CONG_ILLINOIS is not set
+# CONFIG_TCP_CONG_DCTCP is not set
+# CONFIG_TCP_CONG_CDG is not set
+# CONFIG_TCP_CONG_BBR is not set
+CONFIG_DEFAULT_CUBIC=y
+# CONFIG_DEFAULT_RENO is not set
+CONFIG_DEFAULT_TCP_CONG="cubic"
+CONFIG_TCP_MD5SIG=y
+# CONFIG_IPV6 is not set
+# CONFIG_NETWORK_SECMARK is not set
+# CONFIG_NET_PTP_CLASSIFY is not set
+# CONFIG_NETWORK_PHY_TIMESTAMPING is not set
+# CONFIG_NETFILTER is not set
+# CONFIG_IP_DCCP is not set
+# CONFIG_IP_SCTP is not set
+# CONFIG_RDS is not set
+# CONFIG_TIPC is not set
+# CONFIG_ATM is not set
+# CONFIG_L2TP is not set
+# CONFIG_BRIDGE is not set
+CONFIG_HAVE_NET_DSA=y
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_DECNET is not set
+# CONFIG_LLC2 is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_PHONET is not set
+# CONFIG_IEEE802154 is not set
+# CONFIG_NET_SCHED is not set
+# CONFIG_DCB is not set
+CONFIG_DNS_RESOLVER=y
+# CONFIG_BATMAN_ADV is not set
+# CONFIG_OPENVSWITCH is not set
+# CONFIG_VSOCKETS is not set
+# CONFIG_NETLINK_DIAG is not set
+# CONFIG_MPLS is not set
+# CONFIG_HSR is not set
+# CONFIG_NET_SWITCHDEV is not set
+# CONFIG_NET_L3_MASTER_DEV is not set
+# CONFIG_NET_NCSI is not set
+# CONFIG_SOCK_CGROUP_DATA is not set
+# CONFIG_CGROUP_NET_PRIO is not set
+# CONFIG_CGROUP_NET_CLASSID is not set
+CONFIG_NET_RX_BUSY_POLL=y
+CONFIG_BQL=y
+# CONFIG_BPF_JIT is not set
+
+#
+# Network testing
+#
+# CONFIG_NET_PKTGEN is not set
+# CONFIG_HAMRADIO is not set
+# CONFIG_CAN is not set
+# CONFIG_IRDA is not set
+# CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+# CONFIG_AF_KCM is not set
+# CONFIG_STREAM_PARSER is not set
+CONFIG_FIB_RULES=y
+CONFIG_WIRELESS=y
+CONFIG_WEXT_CORE=y
+CONFIG_WEXT_PROC=y
+CONFIG_CFG80211=m
+# CONFIG_NL80211_TESTMODE is not set
+# CONFIG_CFG80211_DEVELOPER_WARNINGS is not set
+CONFIG_CFG80211_DEFAULT_PS=y
+# CONFIG_CFG80211_INTERNAL_REGDB is not set
+CONFIG_CFG80211_CRDA_SUPPORT=y
+CONFIG_CFG80211_WEXT=y
+# CONFIG_LIB80211 is not set
+CONFIG_MAC80211=m
+CONFIG_MAC80211_HAS_RC=y
+CONFIG_MAC80211_RC_MINSTREL=y
+CONFIG_MAC80211_RC_MINSTREL_HT=y
+# CONFIG_MAC80211_RC_MINSTREL_VHT is not set
+CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
+CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"
+CONFIG_MAC80211_MESH=y
+# CONFIG_MAC80211_MESSAGE_TRACING is not set
+# CONFIG_MAC80211_DEBUG_MENU is not set
+CONFIG_MAC80211_STA_HASH_MAX_SIZE=0
+# CONFIG_WIMAX is not set
+# CONFIG_RFKILL is not set
+# CONFIG_NET_9P is not set
+# CONFIG_CAIF is not set
+# CONFIG_CEPH_LIB is not set
+# CONFIG_NFC is not set
+# CONFIG_LWTUNNEL is not set
+# CONFIG_DST_CACHE is not set
+# CONFIG_NET_DEVLINK is not set
+CONFIG_MAY_USE_DEVLINK=y
+CONFIG_HAVE_CBPF_JIT=y
+
+#
+# Device Drivers
+#
+CONFIG_ARM_AMBA=y
+
+#
+# Generic Driver Options
+#
+CONFIG_UEVENT_HELPER=y
+CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
+# CONFIG_DEVTMPFS is not set
+CONFIG_STANDALONE=y
+# CONFIG_PREVENT_FIRMWARE_BUILD is not set
+CONFIG_FW_LOADER=y
+CONFIG_FIRMWARE_IN_KERNEL=y
+CONFIG_EXTRA_FIRMWARE=""
+# CONFIG_FW_LOADER_USER_HELPER_FALLBACK is not set
+CONFIG_ALLOW_DEV_COREDUMP=y
+# CONFIG_DEBUG_DRIVER is not set
+# CONFIG_DEBUG_DEVRES is not set
+# CONFIG_DEBUG_TEST_DRIVER_REMOVE is not set
+# CONFIG_SYS_HYPERVISOR is not set
+# CONFIG_GENERIC_CPU_DEVICES is not set
+CONFIG_REGMAP=y
+CONFIG_REGMAP_I2C=y
+CONFIG_REGMAP_MMIO=y
+# CONFIG_DMA_SHARED_BUFFER is not set
+
+#
+# Bus devices
+#
+# CONFIG_BRCMSTB_GISB_ARB is not set
+# CONFIG_VEXPRESS_CONFIG is not set
+# CONFIG_CONNECTOR is not set
+CONFIG_MTD=y
+# CONFIG_MTD_TESTS is not set
+# CONFIG_MTD_REDBOOT_PARTS is not set
+CONFIG_MTD_CMDLINE_PARTS=y
+# CONFIG_MTD_AFS_PARTS is not set
+CONFIG_MTD_OF_PARTS=y
+# CONFIG_MTD_AR7_PARTS is not set
+
+#
+# User Modules And Translation Layers
+#
+CONFIG_MTD_BLKDEVS=y
+CONFIG_MTD_BLOCK=y
+# CONFIG_FTL is not set
+# CONFIG_NFTL is not set
+# CONFIG_INFTL is not set
+# CONFIG_RFD_FTL is not set
+# CONFIG_SSFDC is not set
+# CONFIG_SM_FTL is not set
+# CONFIG_MTD_OOPS is not set
+# CONFIG_MTD_SWAP is not set
+# CONFIG_MTD_PARTITIONED_MASTER is not set
+
+#
+# RAM/ROM/Flash chip drivers
+#
+# CONFIG_MTD_CFI is not set
+# CONFIG_MTD_JEDECPROBE is not set
+CONFIG_MTD_MAP_BANK_WIDTH_1=y
+CONFIG_MTD_MAP_BANK_WIDTH_2=y
+CONFIG_MTD_MAP_BANK_WIDTH_4=y
+# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
+# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
+CONFIG_MTD_CFI_I1=y
+CONFIG_MTD_CFI_I2=y
+# CONFIG_MTD_CFI_I4 is not set
+# CONFIG_MTD_CFI_I8 is not set
+# CONFIG_MTD_RAM is not set
+# CONFIG_MTD_ROM is not set
+# CONFIG_MTD_ABSENT is not set
+
+#
+# Mapping drivers for chip access
+#
+# CONFIG_MTD_COMPLEX_MAPPINGS is not set
+# CONFIG_MTD_PLATRAM is not set
+
+#
+# Self-contained MTD device drivers
+#
+# CONFIG_MTD_SLRAM is not set
+# CONFIG_MTD_PHRAM is not set
+# CONFIG_MTD_MTDRAM is not set
+# CONFIG_MTD_BLOCK2MTD is not set
+
+#
+# Disk-On-Chip Device Drivers
+#
+# CONFIG_MTD_DOCG3 is not set
+CONFIG_MTD_NAND_ECC=y
+# CONFIG_MTD_NAND_ECC_SMC is not set
+CONFIG_MTD_NAND=y
+# CONFIG_MTD_NAND_ECC_BCH is not set
+# CONFIG_MTD_SM_COMMON is not set
+# CONFIG_MTD_NAND_DENALI_DT is not set
+# CONFIG_MTD_NAND_GPIO is not set
+# CONFIG_MTD_NAND_OMAP_BCH_BUILD is not set
+CONFIG_MTD_NAND_IDS=y
+# CONFIG_MTD_NAND_DISKONCHIP is not set
+# CONFIG_MTD_NAND_DOCG4 is not set
+# CONFIG_MTD_NAND_NANDSIM is not set
+# CONFIG_MTD_NAND_BRCMNAND is not set
+# CONFIG_MTD_NAND_PLATFORM is not set
+# CONFIG_MTD_NAND_HISI504 is not set
+# CONFIG_MTD_NAND_MTK is not set
+CONFIG_MTD_SPI_NAND_HISI_BVT=y
+# CONFIG_HISI_NAND_ECC_STATUS_REPORT is not set
+# CONFIG_HISI_NAND_FS_MAY_NO_YAFFS2 is not set
+CONFIG_MTD_SPI_NAND_HIFMC100=y
+# CONFIG_MTD_ONENAND is not set
+
+#
+# LPDDR & LPDDR2 PCM memory drivers
+#
+# CONFIG_MTD_LPDDR is not set
+# CONFIG_MTD_LPDDR2_NVM is not set
+CONFIG_MTD_SPI_NOR=y
+# CONFIG_MTD_MT81xx_NOR is not set
+# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
+# CONFIG_SPI_CADENCE_QUADSPI is not set
+CONFIG_SPI_HISI_SFC=y
+# CONFIG_MTD_SPI_IDS is not set
+CONFIG_CLOSE_SPI_8PIN_4IO=y
+CONFIG_HISI_SPI_BLOCK_PROTECT=y
+CONFIG_MTD_UBI=y
+CONFIG_MTD_UBI_WL_THRESHOLD=4096
+CONFIG_MTD_UBI_BEB_LIMIT=20
+# CONFIG_MTD_UBI_FASTMAP is not set
+# CONFIG_MTD_UBI_GLUEBI is not set
+# CONFIG_MTD_UBI_BLOCK is not set
+CONFIG_DTC=y
+CONFIG_OF=y
+# CONFIG_OF_UNITTEST is not set
+CONFIG_OF_FLATTREE=y
+CONFIG_OF_EARLY_FLATTREE=y
+CONFIG_OF_ADDRESS=y
+CONFIG_OF_IRQ=y
+CONFIG_OF_NET=y
+CONFIG_OF_MDIO=y
+CONFIG_OF_RESERVED_MEM=y
+# CONFIG_OF_OVERLAY is not set
+CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
+# CONFIG_PARPORT is not set
+CONFIG_BLK_DEV=y
+# CONFIG_BLK_DEV_NULL_BLK is not set
+# CONFIG_BLK_DEV_COW_COMMON is not set
+# CONFIG_BLK_DEV_LOOP is not set
+# CONFIG_BLK_DEV_DRBD is not set
+# CONFIG_BLK_DEV_NBD is not set
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_COUNT=16
+CONFIG_BLK_DEV_RAM_SIZE=65536
+# CONFIG_CDROM_PKTCDVD is not set
+# CONFIG_ATA_OVER_ETH is not set
+# CONFIG_MG_DISK is not set
+# CONFIG_BLK_DEV_RBD is not set
+# CONFIG_NVME_TARGET is not set
+
+#
+# Misc devices
+#
+# CONFIG_SENSORS_LIS3LV02D is not set
+# CONFIG_AD525X_DPOT is not set
+# CONFIG_DUMMY_IRQ is not set
+# CONFIG_ICS932S401 is not set
+# CONFIG_ENCLOSURE_SERVICES is not set
+# CONFIG_APDS9802ALS is not set
+# CONFIG_ISL29003 is not set
+# CONFIG_ISL29020 is not set
+# CONFIG_SENSORS_TSL2550 is not set
+# CONFIG_SENSORS_BH1770 is not set
+# CONFIG_SENSORS_APDS990X is not set
+# CONFIG_HMC6352 is not set
+# CONFIG_DS1682 is not set
+# CONFIG_USB_SWITCH_FSA9480 is not set
+# CONFIG_SRAM is not set
+# CONFIG_C2PORT is not set
+
+#
+# EEPROM support
+#
+# CONFIG_EEPROM_AT24 is not set
+# CONFIG_EEPROM_LEGACY is not set
+# CONFIG_EEPROM_MAX6875 is not set
+# CONFIG_EEPROM_93CX6 is not set
+
+#
+# Texas Instruments shared transport line discipline
+#
+# CONFIG_TI_ST is not set
+# CONFIG_SENSORS_LIS3_I2C is not set
+
+#
+# Altera FPGA firmware download module
+#
+# CONFIG_ALTERA_STAPL is not set
+
+#
+# Intel MIC Bus Driver
+#
+
+#
+# SCIF Bus Driver
+#
+
+#
+# VOP Bus Driver
+#
+
+#
+# Intel MIC Host Driver
+#
+
+#
+# Intel MIC Card Driver
+#
+
+#
+# SCIF Driver
+#
+
+#
+# Intel MIC Coprocessor State Management (COSM) Drivers
+#
+
+#
+# VOP Driver
+#
+# CONFIG_ECHO is not set
+# CONFIG_CXL_BASE is not set
+# CONFIG_CXL_AFU_DRIVER_OPS is not set
+
+#
+# SCSI device support
+#
+CONFIG_SCSI_MOD=y
+# CONFIG_RAID_ATTRS is not set
+CONFIG_SCSI=y
+CONFIG_SCSI_DMA=y
+CONFIG_SCSI_NETLINK=y
+# CONFIG_SCSI_MQ_DEFAULT is not set
+CONFIG_SCSI_PROC_FS=y
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=y
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+CONFIG_BLK_DEV_SR=y
+# CONFIG_BLK_DEV_SR_VENDOR is not set
+# CONFIG_CHR_DEV_SG is not set
+# CONFIG_CHR_DEV_SCH is not set
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+# CONFIG_SCSI_SCAN_ASYNC is not set
+
+#
+# SCSI Transports
+#
+# CONFIG_SCSI_SPI_ATTRS is not set
+CONFIG_SCSI_FC_ATTRS=y
+# CONFIG_SCSI_ISCSI_ATTRS is not set
+# CONFIG_SCSI_SAS_ATTRS is not set
+# CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
+CONFIG_SCSI_LOWLEVEL=y
+# CONFIG_ISCSI_TCP is not set
+# CONFIG_ISCSI_BOOT_SYSFS is not set
+# CONFIG_SCSI_UFSHCD is not set
+# CONFIG_LIBFC is not set
+# CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_DH is not set
+# CONFIG_SCSI_OSD_INITIATOR is not set
+CONFIG_HISI_SATA=y
+CONFIG_HISI_SATA_IOBASE=0x10030000
+CONFIG_HISI_SATA_FBS=1
+CONFIG_HISI_SATA_NCQ=1
+# CONFIG_HISI_ESATA is not set
+CONFIG_ATA=y
+# CONFIG_ATA_NONSTANDARD is not set
+CONFIG_ATA_VERBOSE_ERROR=y
+CONFIG_SATA_PMP=y
+
+#
+# Controllers with non-SFF native interface
+#
+CONFIG_SATA_AHCI_PLATFORM=y
+# CONFIG_AHCI_CEVA is not set
+# CONFIG_AHCI_QORIQ is not set
+CONFIG_ATA_SFF=y
+
+#
+# SFF controllers with custom DMA interface
+#
+CONFIG_ATA_BMDMA=y
+
+#
+# SATA SFF controllers with BMDMA
+#
+
+#
+# PATA SFF controllers with BMDMA
+#
+
+#
+# PIO-only SFF controllers
+#
+
+#
+# Generic fallback / legacy drivers
+#
+# CONFIG_MD is not set
+# CONFIG_TARGET_CORE is not set
+CONFIG_NETDEVICES=y
+CONFIG_NET_CORE=y
+# CONFIG_BONDING is not set
+# CONFIG_DUMMY is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_NET_TEAM is not set
+# CONFIG_MACVLAN is not set
+# CONFIG_VXLAN is not set
+# CONFIG_MACSEC is not set
+# CONFIG_NETCONSOLE is not set
+# CONFIG_NETPOLL is not set
+# CONFIG_NET_POLL_CONTROLLER is not set
+# CONFIG_TUN is not set
+# CONFIG_TUN_VNET_CROSS_LE is not set
+# CONFIG_VETH is not set
+# CONFIG_NLMON is not set
+
+#
+# CAIF transport drivers
+#
+
+#
+# Distributed Switch Architecture drivers
+#
+CONFIG_ETHERNET=y
+# CONFIG_ALTERA_TSE is not set
+# CONFIG_NET_VENDOR_AMAZON is not set
+# CONFIG_NET_VENDOR_ARC is not set
+# CONFIG_NET_VENDOR_AURORA is not set
+# CONFIG_NET_CADENCE is not set
+# CONFIG_NET_VENDOR_BROADCOM is not set
+# CONFIG_NET_VENDOR_CIRRUS is not set
+# CONFIG_DM9000 is not set
+# CONFIG_DNET is not set
+# CONFIG_NET_VENDOR_EZCHIP is not set
+# CONFIG_NET_VENDOR_FARADAY is not set
+CONFIG_NET_VENDOR_HISILICON=y
+# CONFIG_HIX5HD2_GMAC is not set
+CONFIG_HISI_FEMAC=y
+# CONFIG_HIP04_ETH is not set
+# CONFIG_HNS is not set
+# CONFIG_HNS_DSAF is not set
+# CONFIG_HNS_ENET is not set
+# CONFIG_HIETH_GMAC is not set
+# CONFIG_NET_VENDOR_INTEL is not set
+# CONFIG_NET_VENDOR_MARVELL is not set
+# CONFIG_NET_VENDOR_MICREL is not set
+# CONFIG_NET_VENDOR_NATSEMI is not set
+# CONFIG_NET_VENDOR_NETRONOME is not set
+# CONFIG_ETHOC is not set
+# CONFIG_NET_VENDOR_QUALCOMM is not set
+# CONFIG_NET_VENDOR_RENESAS is not set
+# CONFIG_NET_VENDOR_ROCKER is not set
+# CONFIG_NET_VENDOR_SAMSUNG is not set
+# CONFIG_NET_VENDOR_SEEQ is not set
+# CONFIG_NET_VENDOR_SMSC is not set
+# CONFIG_NET_VENDOR_STMICRO is not set
+# CONFIG_NET_VENDOR_SYNOPSYS is not set
+# CONFIG_NET_VENDOR_VIA is not set
+# CONFIG_NET_VENDOR_WIZNET is not set
+CONFIG_PHYLIB=y
+CONFIG_SWPHY=y
+
+#
+# MDIO bus device drivers
+#
+# CONFIG_MDIO_BCM_UNIMAC is not set
+# CONFIG_MDIO_BITBANG is not set
+# CONFIG_MDIO_BUS_MUX_GPIO is not set
+# CONFIG_MDIO_BUS_MUX_MMIOREG is not set
+CONFIG_MDIO_HISI_FEMAC=y
+# CONFIG_MDIO_HISI_GEMAC is not set
+
+#
+# MII PHY device drivers
+#
+# CONFIG_AMD_PHY is not set
+# CONFIG_AQUANTIA_PHY is not set
+# CONFIG_AT803X_PHY is not set
+# CONFIG_BCM7XXX_PHY is not set
+# CONFIG_BCM87XX_PHY is not set
+# CONFIG_BROADCOM_PHY is not set
+# CONFIG_CICADA_PHY is not set
+# CONFIG_DAVICOM_PHY is not set
+# CONFIG_DP83848_PHY is not set
+# CONFIG_DP83867_PHY is not set
+CONFIG_FIXED_PHY=y
+# CONFIG_ICPLUS_PHY is not set
+# CONFIG_INTEL_XWAY_PHY is not set
+# CONFIG_LSI_ET1011C_PHY is not set
+# CONFIG_LXT_PHY is not set
+# CONFIG_MARVELL_PHY is not set
+# CONFIG_MICREL_PHY is not set
+# CONFIG_MICROCHIP_PHY is not set
+# CONFIG_MICROSEMI_PHY is not set
+# CONFIG_NATIONAL_PHY is not set
+# CONFIG_QSEMI_PHY is not set
+# CONFIG_REALTEK_PHY is not set
+# CONFIG_SMSC_PHY is not set
+# CONFIG_STE10XP is not set
+# CONFIG_TERANETICS_PHY is not set
+# CONFIG_VITESSE_PHY is not set
+# CONFIG_XILINX_GMII2RGMII is not set
+# CONFIG_PPP is not set
+# CONFIG_SLIP is not set
+CONFIG_USB_NET_DRIVERS=y
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_RTL8150 is not set
+# CONFIG_USB_RTL8152 is not set
+# CONFIG_USB_LAN78XX is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_USB_IPHETH is not set
+# CONFIG_WLAN is not set
+
+#
+# Enable WiMAX (Networking options) to see the WiMAX drivers
+#
+# CONFIG_WAN is not set
+# CONFIG_ISDN is not set
+# CONFIG_NVM is not set
+
+#
+# Input device support
+#
+CONFIG_INPUT=y
+# CONFIG_INPUT_FF_MEMLESS is not set
+# CONFIG_INPUT_POLLDEV is not set
+# CONFIG_INPUT_SPARSEKMAP is not set
+# CONFIG_INPUT_MATRIXKMAP is not set
+
+#
+# Userland interfaces
+#
+CONFIG_INPUT_MOUSEDEV=y
+CONFIG_INPUT_MOUSEDEV_PSAUX=y
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+CONFIG_INPUT_EVDEV=y
+# CONFIG_INPUT_EVBUG is not set
+
+#
+# Input Device Drivers
+#
+CONFIG_INPUT_KEYBOARD=y
+# CONFIG_KEYBOARD_ADP5588 is not set
+# CONFIG_KEYBOARD_ADP5589 is not set
+CONFIG_KEYBOARD_ATKBD=y
+# CONFIG_KEYBOARD_QT1070 is not set
+# CONFIG_KEYBOARD_QT2160 is not set
+# CONFIG_KEYBOARD_LKKBD is not set
+# CONFIG_KEYBOARD_GPIO is not set
+# CONFIG_KEYBOARD_GPIO_POLLED is not set
+# CONFIG_KEYBOARD_TCA6416 is not set
+# CONFIG_KEYBOARD_TCA8418 is not set
+# CONFIG_KEYBOARD_MATRIX is not set
+# CONFIG_KEYBOARD_LM8333 is not set
+# CONFIG_KEYBOARD_MAX7359 is not set
+# CONFIG_KEYBOARD_MCS is not set
+# CONFIG_KEYBOARD_MPR121 is not set
+# CONFIG_KEYBOARD_NEWTON is not set
+# CONFIG_KEYBOARD_OPENCORES is not set
+# CONFIG_KEYBOARD_SAMSUNG is not set
+# CONFIG_KEYBOARD_STOWAWAY is not set
+# CONFIG_KEYBOARD_SUNKBD is not set
+# CONFIG_KEYBOARD_OMAP4 is not set
+# CONFIG_KEYBOARD_XTKBD is not set
+# CONFIG_KEYBOARD_CAP11XX is not set
+# CONFIG_KEYBOARD_BCM is not set
+CONFIG_INPUT_MOUSE=y
+CONFIG_MOUSE_PS2=y
+CONFIG_MOUSE_PS2_ALPS=y
+CONFIG_MOUSE_PS2_BYD=y
+CONFIG_MOUSE_PS2_LOGIPS2PP=y
+CONFIG_MOUSE_PS2_SYNAPTICS=y
+CONFIG_MOUSE_PS2_CYPRESS=y
+CONFIG_MOUSE_PS2_TRACKPOINT=y
+# CONFIG_MOUSE_PS2_ELANTECH is not set
+# CONFIG_MOUSE_PS2_SENTELIC is not set
+# CONFIG_MOUSE_PS2_TOUCHKIT is not set
+CONFIG_MOUSE_PS2_FOCALTECH=y
+# CONFIG_MOUSE_SERIAL is not set
+# CONFIG_MOUSE_APPLETOUCH is not set
+# CONFIG_MOUSE_BCM5974 is not set
+# CONFIG_MOUSE_CYAPA is not set
+# CONFIG_MOUSE_ELAN_I2C is not set
+# CONFIG_MOUSE_VSXXXAA is not set
+# CONFIG_MOUSE_GPIO is not set
+# CONFIG_MOUSE_SYNAPTICS_I2C is not set
+# CONFIG_MOUSE_SYNAPTICS_USB is not set
+# CONFIG_INPUT_JOYSTICK is not set
+# CONFIG_INPUT_TABLET is not set
+# CONFIG_INPUT_TOUCHSCREEN is not set
+CONFIG_INPUT_MISC=y
+# CONFIG_INPUT_AD714X is not set
+# CONFIG_INPUT_ATMEL_CAPTOUCH is not set
+# CONFIG_INPUT_BMA150 is not set
+# CONFIG_INPUT_E3X0_BUTTON is not set
+# CONFIG_INPUT_MMA8450 is not set
+# CONFIG_INPUT_MPU3050 is not set
+# CONFIG_INPUT_GP2A is not set
+# CONFIG_INPUT_GPIO_BEEPER is not set
+# CONFIG_INPUT_GPIO_TILT_POLLED is not set
+# CONFIG_INPUT_GPIO_DECODER is not set
+# CONFIG_INPUT_ATI_REMOTE2 is not set
+# CONFIG_INPUT_KEYSPAN_REMOTE is not set
+# CONFIG_INPUT_KXTJ9 is not set
+# CONFIG_INPUT_POWERMATE is not set
+# CONFIG_INPUT_YEALINK is not set
+# CONFIG_INPUT_CM109 is not set
+CONFIG_INPUT_UINPUT=y
+# CONFIG_INPUT_PCF8574 is not set
+# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set
+# CONFIG_INPUT_ADXL34X is not set
+# CONFIG_INPUT_CMA3000 is not set
+# CONFIG_INPUT_DRV260X_HAPTICS is not set
+# CONFIG_INPUT_DRV2665_HAPTICS is not set
+# CONFIG_INPUT_DRV2667_HAPTICS is not set
+# CONFIG_RMI4_CORE is not set
+
+#
+# Hardware I/O ports
+#
+CONFIG_SERIO=y
+CONFIG_SERIO_SERPORT=y
+# CONFIG_SERIO_AMBAKMI is not set
+CONFIG_SERIO_LIBPS2=y
+# CONFIG_SERIO_RAW is not set
+# CONFIG_SERIO_ALTERA_PS2 is not set
+# CONFIG_SERIO_PS2MULT is not set
+# CONFIG_SERIO_ARC_PS2 is not set
+# CONFIG_SERIO_APBPS2 is not set
+# CONFIG_USERIO is not set
+# CONFIG_GAMEPORT is not set
+
+#
+# Character devices
+#
+CONFIG_TTY=y
+CONFIG_VT=y
+CONFIG_CONSOLE_TRANSLATIONS=y
+CONFIG_VT_CONSOLE=y
+CONFIG_VT_CONSOLE_SLEEP=y
+CONFIG_HW_CONSOLE=y
+# CONFIG_VT_HW_CONSOLE_BINDING is not set
+CONFIG_UNIX98_PTYS=y
+# CONFIG_LEGACY_PTYS is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+# CONFIG_N_GSM is not set
+# CONFIG_TRACE_SINK is not set
+CONFIG_DEVMEM=y
+# CONFIG_DEVKMEM is not set
+
+#
+# Serial drivers
+#
+CONFIG_SERIAL_EARLYCON=y
+# CONFIG_SERIAL_8250 is not set
+
+#
+# Non-8250 serial port support
+#
+# CONFIG_SERIAL_AMBA_PL010 is not set
+CONFIG_SERIAL_AMBA_PL011=y
+CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
+# CONFIG_SERIAL_EARLYCON_ARM_SEMIHOST is not set
+# CONFIG_SERIAL_UARTLITE is not set
+CONFIG_SERIAL_CORE=y
+CONFIG_SERIAL_CORE_CONSOLE=y
+# CONFIG_SERIAL_SCCNXP is not set
+# CONFIG_SERIAL_SC16IS7XX is not set
+# CONFIG_SERIAL_BCM63XX is not set
+# CONFIG_SERIAL_ALTERA_JTAGUART is not set
+# CONFIG_SERIAL_ALTERA_UART is not set
+# CONFIG_SERIAL_XILINX_PS_UART is not set
+# CONFIG_SERIAL_ARC is not set
+# CONFIG_SERIAL_FSL_LPUART is not set
+# CONFIG_SERIAL_CONEXANT_DIGICOLOR is not set
+# CONFIG_SERIAL_ST_ASC is not set
+# CONFIG_SERIAL_STM32 is not set
+# CONFIG_HVC_DCC is not set
+# CONFIG_IPMI_HANDLER is not set
+# CONFIG_HW_RANDOM is not set
+# CONFIG_R3964 is not set
+# CONFIG_RAW_DRIVER is not set
+# CONFIG_TCG_TPM is not set
+# CONFIG_XILLYBUS is not set
+
+#
+# I2C support
+#
+CONFIG_I2C=y
+CONFIG_I2C_BOARDINFO=y
+# CONFIG_I2C_COMPAT is not set
+CONFIG_I2C_CHARDEV=y
+# CONFIG_I2C_MUX is not set
+# CONFIG_I2C_HELPER_AUTO is not set
+# CONFIG_I2C_SMBUS is not set
+
+#
+# I2C Algorithms
+#
+# CONFIG_I2C_ALGOBIT is not set
+# CONFIG_I2C_ALGOPCF is not set
+# CONFIG_I2C_ALGOPCA is not set
+
+#
+# I2C Hardware Bus support
+#
+
+#
+# I2C system bus drivers (mostly embedded / system-on-chip)
+#
+# CONFIG_I2C_CBUS_GPIO is not set
+# CONFIG_I2C_DESIGNWARE_PLATFORM is not set
+# CONFIG_I2C_EMEV2 is not set
+# CONFIG_I2C_GPIO is not set
+CONFIG_I2C_HIBVT=y
+# CONFIG_I2C_NOMADIK is not set
+# CONFIG_I2C_OCORES is not set
+# CONFIG_I2C_PCA_PLATFORM is not set
+# CONFIG_I2C_PXA_PCI is not set
+# CONFIG_I2C_RK3X is not set
+# CONFIG_I2C_SIMTEC is not set
+# CONFIG_I2C_XILINX is not set
+
+#
+# External I2C/SMBus adapter drivers
+#
+# CONFIG_I2C_DIOLAN_U2C is not set
+# CONFIG_I2C_PARPORT_LIGHT is not set
+# CONFIG_I2C_ROBOTFUZZ_OSIF is not set
+# CONFIG_I2C_TAOS_EVM is not set
+# CONFIG_I2C_TINY_USB is not set
+
+#
+# Other I2C/SMBus bus drivers
+#
+CONFIG_DMA_MSG_LEN=5
+# CONFIG_I2C_STUB is not set
+# CONFIG_I2C_SLAVE is not set
+# CONFIG_I2C_DEBUG_CORE is not set
+# CONFIG_I2C_DEBUG_ALGO is not set
+# CONFIG_I2C_DEBUG_BUS is not set
+# CONFIG_SPI is not set
+# CONFIG_SPMI is not set
+# CONFIG_HSI is not set
+
+#
+# PPS support
+#
+# CONFIG_PPS is not set
+
+#
+# PPS generators support
+#
+
+#
+# PTP clock support
+#
+# CONFIG_PTP_1588_CLOCK is not set
+
+#
+# Enable PHYLIB and NETWORK_PHY_TIMESTAMPING to see the additional clocks.
+#
+CONFIG_PINCTRL=y
+
+#
+# Pin controllers
+#
+CONFIG_PINMUX=y
+CONFIG_PINCONF=y
+CONFIG_GENERIC_PINCONF=y
+# CONFIG_DEBUG_PINCTRL is not set
+# CONFIG_PINCTRL_AMD is not set
+CONFIG_PINCTRL_SINGLE=y
+CONFIG_ARCH_HAVE_CUSTOM_GPIO_H=y
+CONFIG_GPIOLIB=y
+CONFIG_OF_GPIO=y
+CONFIG_GPIOLIB_IRQCHIP=y
+# CONFIG_DEBUG_GPIO is not set
+CONFIG_GPIO_SYSFS=y
+
+#
+# Memory mapped GPIO drivers
+#
+# CONFIG_GPIO_74XX_MMIO is not set
+# CONFIG_GPIO_ALTERA is not set
+# CONFIG_GPIO_DWAPB is not set
+# CONFIG_GPIO_EM is not set
+# CONFIG_GPIO_GENERIC_PLATFORM is not set
+# CONFIG_GPIO_GRGPIO is not set
+# CONFIG_GPIO_MOCKUP is not set
+# CONFIG_GPIO_MPC8XXX is not set
+CONFIG_GPIO_PL061=y
+# CONFIG_GPIO_XILINX is not set
+# CONFIG_GPIO_ZEVIO is not set
+# CONFIG_GPIO_ZX is not set
+
+#
+# I2C GPIO expanders
+#
+# CONFIG_GPIO_ADP5588 is not set
+# CONFIG_GPIO_ADNP is not set
+# CONFIG_GPIO_MAX7300 is not set
+# CONFIG_GPIO_MAX732X is not set
+# CONFIG_GPIO_PCA953X is not set
+# CONFIG_GPIO_PCF857X is not set
+# CONFIG_GPIO_SX150X is not set
+# CONFIG_GPIO_TPIC2810 is not set
+# CONFIG_GPIO_TS4900 is not set
+
+#
+# MFD GPIO expanders
+#
+# CONFIG_HTC_EGPIO is not set
+
+#
+# SPI or I2C GPIO expanders
+#
+# CONFIG_GPIO_MCP23S08 is not set
+
+#
+# USB GPIO expanders
+#
+# CONFIG_W1 is not set
+# CONFIG_POWER_AVS is not set
+CONFIG_POWER_RESET=y
+# CONFIG_POWER_RESET_BRCMKONA is not set
+# CONFIG_POWER_RESET_GPIO is not set
+# CONFIG_POWER_RESET_GPIO_RESTART is not set
+CONFIG_POWER_RESET_HISI=y
+# CONFIG_POWER_RESET_LTC2952 is not set
+# CONFIG_POWER_RESET_RESTART is not set
+# CONFIG_POWER_RESET_SYSCON is not set
+# CONFIG_POWER_RESET_SYSCON_POWEROFF is not set
+CONFIG_POWER_SUPPLY=y
+# CONFIG_POWER_SUPPLY_DEBUG is not set
+# CONFIG_PDA_POWER is not set
+# CONFIG_TEST_POWER is not set
+# CONFIG_BATTERY_DS2780 is not set
+# CONFIG_BATTERY_DS2781 is not set
+# CONFIG_BATTERY_DS2782 is not set
+# CONFIG_BATTERY_SBS is not set
+# CONFIG_BATTERY_BQ27XXX is not set
+# CONFIG_BATTERY_MAX17040 is not set
+# CONFIG_BATTERY_MAX17042 is not set
+# CONFIG_CHARGER_MAX8903 is not set
+# CONFIG_CHARGER_LP8727 is not set
+# CONFIG_CHARGER_GPIO is not set
+# CONFIG_CHARGER_BQ2415X is not set
+# CONFIG_CHARGER_BQ24190 is not set
+# CONFIG_CHARGER_BQ24257 is not set
+# CONFIG_CHARGER_BQ24735 is not set
+# CONFIG_CHARGER_BQ25890 is not set
+# CONFIG_CHARGER_SMB347 is not set
+# CONFIG_BATTERY_GAUGE_LTC2941 is not set
+# CONFIG_CHARGER_RT9455 is not set
+# CONFIG_HWMON is not set
+# CONFIG_THERMAL is not set
+# CONFIG_WATCHDOG is not set
+CONFIG_SSB_POSSIBLE=y
+
+#
+# Sonics Silicon Backplane
+#
+# CONFIG_SSB is not set
+CONFIG_BCMA_POSSIBLE=y
+
+#
+# Broadcom specific AMBA
+#
+# CONFIG_BCMA is not set
+
+#
+# Multifunction device drivers
+#
+CONFIG_MFD_CORE=y
+# CONFIG_MFD_ACT8945A is not set
+# CONFIG_MFD_AS3711 is not set
+# CONFIG_MFD_AS3722 is not set
+# CONFIG_PMIC_ADP5520 is not set
+# CONFIG_MFD_AAT2870_CORE is not set
+# CONFIG_MFD_ATMEL_FLEXCOM is not set
+# CONFIG_MFD_ATMEL_HLCDC is not set
+# CONFIG_MFD_BCM590XX is not set
+# CONFIG_MFD_AXP20X_I2C is not set
+# CONFIG_MFD_CROS_EC is not set
+# CONFIG_MFD_ASIC3 is not set
+# CONFIG_PMIC_DA903X is not set
+# CONFIG_MFD_DA9052_I2C is not set
+# CONFIG_MFD_DA9055 is not set
+# CONFIG_MFD_DA9062 is not set
+# CONFIG_MFD_DA9063 is not set
+# CONFIG_MFD_DA9150 is not set
+# CONFIG_MFD_DLN2 is not set
+# CONFIG_MFD_EXYNOS_LPASS is not set
+# CONFIG_MFD_MC13XXX_I2C is not set
+# CONFIG_MFD_HI6421_PMIC is not set
+CONFIG_MFD_HISI_FMC=y
+# CONFIG_HTC_PASIC3 is not set
+# CONFIG_HTC_I2CPLD is not set
+# CONFIG_INTEL_SOC_PMIC is not set
+# CONFIG_MFD_KEMPLD is not set
+# CONFIG_MFD_88PM800 is not set
+# CONFIG_MFD_88PM805 is not set
+# CONFIG_MFD_88PM860X is not set
+# CONFIG_MFD_MAX14577 is not set
+# CONFIG_MFD_MAX77620 is not set
+# CONFIG_MFD_MAX77686 is not set
+# CONFIG_MFD_MAX77693 is not set
+# CONFIG_MFD_MAX77843 is not set
+# CONFIG_MFD_MAX8907 is not set
+# CONFIG_MFD_MAX8925 is not set
+# CONFIG_MFD_MAX8997 is not set
+# CONFIG_MFD_MAX8998 is not set
+# CONFIG_MFD_MT6397 is not set
+# CONFIG_MFD_MENF21BMC is not set
+# CONFIG_MFD_VIPERBOARD is not set
+# CONFIG_MFD_RETU is not set
+# CONFIG_MFD_PCF50633 is not set
+# CONFIG_MFD_PM8921_CORE is not set
+# CONFIG_MFD_RT5033 is not set
+# CONFIG_MFD_RTSX_USB is not set
+# CONFIG_MFD_RC5T583 is not set
+# CONFIG_MFD_RK808 is not set
+# CONFIG_MFD_RN5T618 is not set
+# CONFIG_MFD_SEC_CORE is not set
+# CONFIG_MFD_SI476X_CORE is not set
+# CONFIG_MFD_SM501 is not set
+# CONFIG_MFD_SKY81452 is not set
+# CONFIG_MFD_SMSC is not set
+# CONFIG_ABX500_CORE is not set
+# CONFIG_MFD_STMPE is not set
+# CONFIG_MFD_SYSCON is not set
+# CONFIG_MFD_TI_AM335X_TSCADC is not set
+# CONFIG_MFD_LP3943 is not set
+# CONFIG_MFD_LP8788 is not set
+# CONFIG_MFD_PALMAS is not set
+# CONFIG_TPS6105X is not set
+# CONFIG_TPS65010 is not set
+# CONFIG_TPS6507X is not set
+# CONFIG_MFD_TPS65086 is not set
+# CONFIG_MFD_TPS65090 is not set
+# CONFIG_MFD_TPS65217 is not set
+# CONFIG_MFD_TI_LP873X is not set
+# CONFIG_MFD_TPS65218 is not set
+# CONFIG_MFD_TPS6586X is not set
+# CONFIG_MFD_TPS65910 is not set
+# CONFIG_MFD_TPS65912_I2C is not set
+# CONFIG_MFD_TPS80031 is not set
+# CONFIG_TWL4030_CORE is not set
+# CONFIG_TWL6040_CORE is not set
+# CONFIG_MFD_WL1273_CORE is not set
+# CONFIG_MFD_LM3533 is not set
+# CONFIG_MFD_TC3589X is not set
+# CONFIG_MFD_TMIO is not set
+# CONFIG_MFD_T7L66XB is not set
+# CONFIG_MFD_TC6387XB is not set
+# CONFIG_MFD_TC6393XB is not set
+# CONFIG_MFD_ARIZONA_I2C is not set
+# CONFIG_MFD_WM8400 is not set
+# CONFIG_MFD_WM831X_I2C is not set
+# CONFIG_MFD_WM8350_I2C is not set
+# CONFIG_MFD_WM8994 is not set
+# CONFIG_REGULATOR is not set
+# CONFIG_MEDIA_SUPPORT is not set
+
+#
+# Graphics support
+#
+# CONFIG_IMX_IPUV3_CORE is not set
+# CONFIG_DRM is not set
+
+#
+# ACP (Audio CoProcessor) Configuration
+#
+
+#
+# Frame buffer Devices
+#
+CONFIG_FB=y
+# CONFIG_FIRMWARE_EDID is not set
+CONFIG_FB_CMDLINE=y
+CONFIG_FB_NOTIFY=y
+# CONFIG_FB_DDC is not set
+# CONFIG_FB_BOOT_VESA_SUPPORT is not set
+# CONFIG_FB_CFB_FILLRECT is not set
+# CONFIG_FB_CFB_COPYAREA is not set
+# CONFIG_FB_CFB_IMAGEBLIT is not set
+# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
+# CONFIG_FB_SYS_FILLRECT is not set
+# CONFIG_FB_SYS_COPYAREA is not set
+# CONFIG_FB_SYS_IMAGEBLIT is not set
+# CONFIG_FB_FOREIGN_ENDIAN is not set
+# CONFIG_FB_SYS_FOPS is not set
+# CONFIG_FB_SVGALIB is not set
+# CONFIG_FB_MACMODES is not set
+# CONFIG_FB_BACKLIGHT is not set
+# CONFIG_FB_MODE_HELPERS is not set
+# CONFIG_FB_TILEBLITTING is not set
+
+#
+# Frame buffer hardware drivers
+#
+# CONFIG_FB_ARMCLCD is not set
+# CONFIG_FB_OPENCORES is not set
+# CONFIG_FB_S1D13XXX is not set
+# CONFIG_FB_SMSCUFX is not set
+# CONFIG_FB_UDL is not set
+# CONFIG_FB_IBM_GXT4500 is not set
+# CONFIG_FB_VIRTUAL is not set
+# CONFIG_FB_METRONOME is not set
+# CONFIG_FB_BROADSHEET is not set
+# CONFIG_FB_AUO_K190X is not set
+# CONFIG_FB_SIMPLE is not set
+# CONFIG_FB_SSD1307 is not set
+# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
+# CONFIG_VGASTATE is not set
+
+#
+# Console display driver support
+#
+CONFIG_DUMMY_CONSOLE=y
+# CONFIG_FRAMEBUFFER_CONSOLE is not set
+# CONFIG_LOGO is not set
+# CONFIG_SOUND is not set
+
+#
+# HID support
+#
+CONFIG_HID=y
+# CONFIG_HID_BATTERY_STRENGTH is not set
+# CONFIG_HIDRAW is not set
+# CONFIG_UHID is not set
+CONFIG_HID_GENERIC=y
+
+#
+# Special HID drivers
+#
+# CONFIG_HID_A4TECH is not set
+# CONFIG_HID_ACRUX is not set
+# CONFIG_HID_APPLE is not set
+# CONFIG_HID_APPLEIR is not set
+# CONFIG_HID_AUREAL is not set
+# CONFIG_HID_BELKIN is not set
+# CONFIG_HID_BETOP_FF is not set
+# CONFIG_HID_CHERRY is not set
+# CONFIG_HID_CHICONY is not set
+# CONFIG_HID_CMEDIA is not set
+# CONFIG_HID_CP2112 is not set
+# CONFIG_HID_CYPRESS is not set
+# CONFIG_HID_DRAGONRISE is not set
+# CONFIG_HID_EMS_FF is not set
+# CONFIG_HID_ELECOM is not set
+# CONFIG_HID_ELO is not set
+# CONFIG_HID_EZKEY is not set
+# CONFIG_HID_GEMBIRD is not set
+# CONFIG_HID_GFRM is not set
+# CONFIG_HID_HOLTEK is not set
+# CONFIG_HID_KEYTOUCH is not set
+# CONFIG_HID_KYE is not set
+# CONFIG_HID_UCLOGIC is not set
+# CONFIG_HID_WALTOP is not set
+# CONFIG_HID_GYRATION is not set
+# CONFIG_HID_ICADE is not set
+# CONFIG_HID_TWINHAN is not set
+# CONFIG_HID_KENSINGTON is not set
+# CONFIG_HID_LCPOWER is not set
+# CONFIG_HID_LENOVO is not set
+# CONFIG_HID_LOGITECH is not set
+# CONFIG_HID_MAGICMOUSE is not set
+CONFIG_HID_MICROSOFT=y
+# CONFIG_HID_MONTEREY is not set
+# CONFIG_HID_MULTITOUCH is not set
+# CONFIG_HID_NTRIG is not set
+# CONFIG_HID_ORTEK is not set
+# CONFIG_HID_PANTHERLORD is not set
+# CONFIG_HID_PENMOUNT is not set
+# CONFIG_HID_PETALYNX is not set
+# CONFIG_HID_PICOLCD is not set
+# CONFIG_HID_PLANTRONICS is not set
+# CONFIG_HID_PRIMAX is not set
+# CONFIG_HID_ROCCAT is not set
+# CONFIG_HID_SAITEK is not set
+# CONFIG_HID_SAMSUNG is not set
+# CONFIG_HID_SPEEDLINK is not set
+# CONFIG_HID_STEELSERIES is not set
+# CONFIG_HID_SUNPLUS is not set
+# CONFIG_HID_RMI is not set
+# CONFIG_HID_GREENASIA is not set
+# CONFIG_HID_SMARTJOYPLUS is not set
+# CONFIG_HID_TIVO is not set
+# CONFIG_HID_TOPSEED is not set
+# CONFIG_HID_THRUSTMASTER is not set
+# CONFIG_HID_WACOM is not set
+# CONFIG_HID_XINMO is not set
+# CONFIG_HID_ZEROPLUS is not set
+# CONFIG_HID_ZYDACRON is not set
+# CONFIG_HID_SENSOR_HUB is not set
+# CONFIG_HID_ALPS is not set
+
+#
+# USB HID support
+#
+CONFIG_USB_HID=y
+# CONFIG_HID_PID is not set
+# CONFIG_USB_HIDDEV is not set
+
+#
+# I2C HID support
+#
+# CONFIG_I2C_HID is not set
+CONFIG_USB_OHCI_LITTLE_ENDIAN=y
+CONFIG_USB_SUPPORT=y
+CONFIG_USB_COMMON=y
+CONFIG_USB_ARCH_HAS_HCD=y
+CONFIG_USB=y
+# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEFAULT_PERSIST=y
+# CONFIG_USB_DYNAMIC_MINORS is not set
+# CONFIG_USB_OTG is not set
+# CONFIG_USB_OTG_WHITELIST is not set
+# CONFIG_USB_MON is not set
+# CONFIG_USB_WUSB_CBAF is not set
+
+#
+# USB Host Controller Drivers
+#
+# CONFIG_USB_C67X00_HCD is not set
+# CONFIG_USB_XHCI_HCD is not set
+CONFIG_USB_EHCI_HCD=y
+# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+CONFIG_USB_EHCI_TT_NEWSCHED=y
+CONFIG_USB_EHCI_HCD_PLATFORM=y
+# CONFIG_USB_OXU210HP_HCD is not set
+# CONFIG_USB_ISP116X_HCD is not set
+# CONFIG_USB_ISP1362_HCD is not set
+# CONFIG_USB_FOTG210_HCD is not set
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_HCD_PLATFORM=y
+# CONFIG_USB_SL811_HCD is not set
+# CONFIG_USB_R8A66597_HCD is not set
+# CONFIG_USB_HCD_TEST_MODE is not set
+
+#
+# USB Device Class drivers
+#
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+# CONFIG_USB_WDM is not set
+# CONFIG_USB_TMC is not set
+
+#
+# NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may
+#
+
+#
+# also be needed; see USB_STORAGE Help for more info
+#
+CONFIG_USB_STORAGE=y
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_REALTEK is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_USBAT is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_SDDR55 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_STORAGE_ALAUDA is not set
+# CONFIG_USB_STORAGE_ONETOUCH is not set
+# CONFIG_USB_STORAGE_KARMA is not set
+# CONFIG_USB_STORAGE_CYPRESS_ATACB is not set
+# CONFIG_USB_STORAGE_ENE_UB6250 is not set
+# CONFIG_USB_UAS is not set
+
+#
+# USB Imaging devices
+#
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USBIP_CORE is not set
+# CONFIG_USB_MUSB_HDRC is not set
+# CONFIG_USB_DWC3 is not set
+# CONFIG_USB_DWC2 is not set
+# CONFIG_USB_CHIPIDEA is not set
+# CONFIG_USB_ISP1760 is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_SERIAL is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_EMI62 is not set
+# CONFIG_USB_EMI26 is not set
+# CONFIG_USB_ADUTUX is not set
+# CONFIG_USB_SEVSEG is not set
+# CONFIG_USB_RIO500 is not set
+# CONFIG_USB_LEGOTOWER is not set
+# CONFIG_USB_LCD is not set
+# CONFIG_USB_CYPRESS_CY7C63 is not set
+# CONFIG_USB_CYTHERM is not set
+# CONFIG_USB_IDMOUSE is not set
+# CONFIG_USB_FTDI_ELAN is not set
+# CONFIG_USB_APPLEDISPLAY is not set
+# CONFIG_USB_SISUSBVGA is not set
+# CONFIG_USB_LD is not set
+# CONFIG_USB_TRANCEVIBRATOR is not set
+# CONFIG_USB_IOWARRIOR is not set
+# CONFIG_USB_TEST is not set
+# CONFIG_USB_EHSET_TEST_FIXTURE is not set
+# CONFIG_USB_ISIGHTFW is not set
+# CONFIG_USB_YUREX is not set
+# CONFIG_USB_EZUSB_FX2 is not set
+# CONFIG_USB_HSIC_USB3503 is not set
+# CONFIG_USB_HSIC_USB4604 is not set
+# CONFIG_USB_LINK_LAYER_TEST is not set
+
+#
+# USB Physical Layer drivers
+#
+# CONFIG_USB_PHY is not set
+# CONFIG_NOP_USB_XCEIV is not set
+# CONFIG_USB_GPIO_VBUS is not set
+# CONFIG_USB_ISP1301 is not set
+# CONFIG_USB_ULPI is not set
+# CONFIG_USB_GADGET is not set
+# CONFIG_USB_ULPI_BUS is not set
+# CONFIG_UWB is not set
+# CONFIG_MMC is not set
+# CONFIG_MEMSTICK is not set
+# CONFIG_NEW_LEDS is not set
+# CONFIG_ACCESSIBILITY is not set
+CONFIG_EDAC_ATOMIC_SCRUB=y
+CONFIG_EDAC_SUPPORT=y
+# CONFIG_EDAC is not set
+CONFIG_RTC_LIB=y
+CONFIG_RTC_CLASS=y
+CONFIG_RTC_HCTOSYS=y
+CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
+CONFIG_RTC_SYSTOHC=y
+CONFIG_RTC_SYSTOHC_DEVICE="rtc0"
+# CONFIG_RTC_DEBUG is not set
+
+#
+# RTC interfaces
+#
+CONFIG_RTC_INTF_SYSFS=y
+CONFIG_RTC_INTF_PROC=y
+CONFIG_RTC_INTF_DEV=y
+# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
+# CONFIG_RTC_DRV_TEST is not set
+
+#
+# I2C RTC drivers
+#
+# CONFIG_RTC_DRV_ABB5ZES3 is not set
+# CONFIG_RTC_DRV_ABX80X is not set
+# CONFIG_RTC_DRV_DS1307 is not set
+# CONFIG_RTC_DRV_DS1374 is not set
+# CONFIG_RTC_DRV_DS1672 is not set
+# CONFIG_RTC_DRV_HYM8563 is not set
+# CONFIG_RTC_DRV_MAX6900 is not set
+# CONFIG_RTC_DRV_RS5C372 is not set
+# CONFIG_RTC_DRV_ISL1208 is not set
+# CONFIG_RTC_DRV_ISL12022 is not set
+# CONFIG_RTC_DRV_X1205 is not set
+# CONFIG_RTC_DRV_PCF8523 is not set
+# CONFIG_RTC_DRV_PCF85063 is not set
+# CONFIG_RTC_DRV_PCF8563 is not set
+# CONFIG_RTC_DRV_PCF8583 is not set
+# CONFIG_RTC_DRV_M41T80 is not set
+# CONFIG_RTC_DRV_BQ32K is not set
+# CONFIG_RTC_DRV_S35390A is not set
+# CONFIG_RTC_DRV_FM3130 is not set
+# CONFIG_RTC_DRV_RX8010 is not set
+# CONFIG_RTC_DRV_RX8581 is not set
+# CONFIG_RTC_DRV_RX8025 is not set
+# CONFIG_RTC_DRV_EM3027 is not set
+# CONFIG_RTC_DRV_RV8803 is not set
+
+#
+# SPI RTC drivers
+#
+CONFIG_RTC_I2C_AND_SPI=y
+
+#
+# SPI and I2C RTC drivers
+#
+# CONFIG_RTC_DRV_DS3232 is not set
+# CONFIG_RTC_DRV_PCF2127 is not set
+# CONFIG_RTC_DRV_RV3029C2 is not set
+
+#
+# Platform RTC drivers
+#
+CONFIG_RTC_DRV_HIBVT=y
+# CONFIG_RTC_DRV_CMOS is not set
+# CONFIG_RTC_DRV_DS1286 is not set
+# CONFIG_RTC_DRV_DS1511 is not set
+# CONFIG_RTC_DRV_DS1553 is not set
+# CONFIG_RTC_DRV_DS1685_FAMILY is not set
+# CONFIG_RTC_DRV_DS1742 is not set
+# CONFIG_RTC_DRV_DS2404 is not set
+# CONFIG_RTC_DRV_STK17TA8 is not set
+# CONFIG_RTC_DRV_M48T86 is not set
+# CONFIG_RTC_DRV_M48T35 is not set
+# CONFIG_RTC_DRV_M48T59 is not set
+# CONFIG_RTC_DRV_MSM6242 is not set
+# CONFIG_RTC_DRV_BQ4802 is not set
+# CONFIG_RTC_DRV_RP5C01 is not set
+# CONFIG_RTC_DRV_V3020 is not set
+# CONFIG_RTC_DRV_ZYNQMP is not set
+
+#
+# on-CPU RTC drivers
+#
+# CONFIG_RTC_DRV_PL030 is not set
+# CONFIG_RTC_DRV_PL031 is not set
+# CONFIG_RTC_DRV_SNVS is not set
+
+#
+# HID Sensor RTC drivers
+#
+# CONFIG_RTC_DRV_HID_SENSOR_TIME is not set
+# CONFIG_DMADEVICES is not set
+
+#
+# DMABUF options
+#
+# CONFIG_SYNC_FILE is not set
+# CONFIG_AUXDISPLAY is not set
+# CONFIG_UIO is not set
+# CONFIG_VIRT_DRIVERS is not set
+
+#
+# Virtio drivers
+#
+# CONFIG_VIRTIO_MMIO is not set
+
+#
+# Microsoft Hyper-V guest support
+#
+# CONFIG_STAGING is not set
+# CONFIG_GOLDFISH is not set
+# CONFIG_CHROME_PLATFORMS is not set
+CONFIG_CLKDEV_LOOKUP=y
+CONFIG_HAVE_CLK_PREPARE=y
+CONFIG_COMMON_CLK=y
+
+#
+# Common Clock Framework
+#
+# CONFIG_COMMON_CLK_SI5351 is not set
+# CONFIG_COMMON_CLK_SI514 is not set
+# CONFIG_COMMON_CLK_SI570 is not set
+# CONFIG_COMMON_CLK_CDCE706 is not set
+# CONFIG_COMMON_CLK_CDCE925 is not set
+# CONFIG_COMMON_CLK_CS2000_CP is not set
+# CONFIG_CLK_QORIQ is not set
+# CONFIG_COMMON_CLK_NXP is not set
+# CONFIG_COMMON_CLK_PXA is not set
+# CONFIG_COMMON_CLK_PIC32 is not set
+CONFIG_COMMON_CLK_HI3536DV100=y
+CONFIG_RESET_HISI=y
+
+#
+# Hardware Spinlock drivers
+#
+
+#
+# Clock Source drivers
+#
+CONFIG_CLKSRC_OF=y
+CONFIG_CLKSRC_PROBE=y
+CONFIG_CLKSRC_MMIO=y
+CONFIG_ARM_ARCH_TIMER=y
+CONFIG_ARM_ARCH_TIMER_EVTSTREAM=y
+CONFIG_ARM_TIMER_SP804=y
+# CONFIG_ATMEL_PIT is not set
+# CONFIG_SH_TIMER_CMT is not set
+# CONFIG_SH_TIMER_MTU2 is not set
+# CONFIG_SH_TIMER_TMU is not set
+# CONFIG_EM_TIMER_STI is not set
+# CONFIG_MAILBOX is not set
+# CONFIG_IOMMU_SUPPORT is not set
+
+#
+# Remoteproc drivers
+#
+# CONFIG_STE_MODEM_RPROC is not set
+
+#
+# Rpmsg drivers
+#
+
+#
+# SOC (System On Chip) specific Drivers
+#
+
+#
+# Broadcom SoC drivers
+#
+# CONFIG_SOC_BRCMSTB is not set
+# CONFIG_SUNXI_SRAM is not set
+# CONFIG_SOC_TI is not set
+# CONFIG_PM_DEVFREQ is not set
+# CONFIG_EXTCON is not set
+# CONFIG_MEMORY is not set
+# CONFIG_IIO is not set
+# CONFIG_PWM is not set
+CONFIG_IRQCHIP=y
+CONFIG_ARM_GIC=y
+CONFIG_ARM_GIC_MAX_NR=1
+# CONFIG_IPACK_BUS is not set
+CONFIG_RESET_CONTROLLER=y
+# CONFIG_RESET_ATH79 is not set
+# CONFIG_RESET_BERLIN is not set
+# CONFIG_RESET_LPC18XX is not set
+# CONFIG_RESET_MESON is not set
+# CONFIG_RESET_PISTACHIO is not set
+# CONFIG_RESET_SOCFPGA is not set
+# CONFIG_RESET_STM32 is not set
+# CONFIG_RESET_SUNXI is not set
+# CONFIG_TI_SYSCON_RESET is not set
+# CONFIG_RESET_ZYNQ is not set
+# CONFIG_FMC is not set
+
+#
+# PHY Subsystem
+#
+CONFIG_GENERIC_PHY=y
+# CONFIG_PHY_PXA_28NM_HSIC is not set
+# CONFIG_PHY_PXA_28NM_USB2 is not set
+# CONFIG_BCM_KONA_USB2_PHY is not set
+CONFIG_PHY_HISI_SATA=y
+CONFIG_HISI_SATA_MODE=1
+CONFIG_PHY_HISI_USB2=y
+# CONFIG_POWERCAP is not set
+# CONFIG_MCB is not set
+
+#
+# Performance monitor support
+#
+# CONFIG_RAS is not set
+
+#
+# Android
+#
+# CONFIG_ANDROID is not set
+# CONFIG_NVMEM is not set
+# CONFIG_STM is not set
+# CONFIG_INTEL_TH is not set
+
+#
+# FPGA Configuration Support
+#
+# CONFIG_FPGA is not set
+CONFIG_HI_DMAC=y
+CONFIG_HI_DMAC_CHANNEL_NUM=4
+
+#
+# Firmware Drivers
+#
+# CONFIG_FIRMWARE_MEMMAP is not set
+# CONFIG_FW_CFG_SYSFS is not set
+CONFIG_HAVE_ARM_SMCCC=y
+
+#
+# File systems
+#
+CONFIG_DCACHE_WORD_ACCESS=y
+CONFIG_EXT2_FS=y
+# CONFIG_EXT2_FS_XATTR is not set
+CONFIG_EXT3_FS=y
+# CONFIG_EXT3_FS_POSIX_ACL is not set
+# CONFIG_EXT3_FS_SECURITY is not set
+CONFIG_EXT4_FS=y
+# CONFIG_EXT4_FS_POSIX_ACL is not set
+# CONFIG_EXT4_FS_SECURITY is not set
+# CONFIG_EXT4_ENCRYPTION is not set
+# CONFIG_EXT4_DEBUG is not set
+CONFIG_JBD2=y
+# CONFIG_JBD2_DEBUG is not set
+CONFIG_FS_MBCACHE=y
+# CONFIG_REISERFS_FS is not set
+# CONFIG_JFS_FS is not set
+# CONFIG_XFS_FS is not set
+# CONFIG_GFS2_FS is not set
+# CONFIG_OCFS2_FS is not set
+# CONFIG_BTRFS_FS is not set
+# CONFIG_NILFS2_FS is not set
+# CONFIG_F2FS_FS is not set
+CONFIG_FS_POSIX_ACL=y
+CONFIG_EXPORTFS=y
+# CONFIG_EXPORTFS_BLOCK_OPS is not set
+CONFIG_FILE_LOCKING=y
+CONFIG_MANDATORY_FILE_LOCKING=y
+# CONFIG_FS_ENCRYPTION is not set
+CONFIG_FSNOTIFY=y
+CONFIG_DNOTIFY=y
+CONFIG_INOTIFY_USER=y
+# CONFIG_FANOTIFY is not set
+# CONFIG_QUOTA is not set
+# CONFIG_QUOTACTL is not set
+# CONFIG_AUTOFS4_FS is not set
+# CONFIG_FUSE_FS is not set
+# CONFIG_OVERLAY_FS is not set
+
+#
+# Caches
+#
+# CONFIG_FSCACHE is not set
+
+#
+# CD-ROM/DVD Filesystems
+#
+CONFIG_ISO9660_FS=y
+# CONFIG_JOLIET is not set
+# CONFIG_ZISOFS is not set
+# CONFIG_UDF_FS is not set
+
+#
+# DOS/FAT/NT Filesystems
+#
+CONFIG_FAT_FS=y
+CONFIG_MSDOS_FS=y
+CONFIG_VFAT_FS=y
+CONFIG_FAT_DEFAULT_CODEPAGE=437
+CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_FAT_DEFAULT_UTF8 is not set
+# CONFIG_NTFS_FS is not set
+
+#
+# Pseudo filesystems
+#
+CONFIG_PROC_FS=y
+CONFIG_PROC_SYSCTL=y
+CONFIG_PROC_PAGE_MONITOR=y
+# CONFIG_PROC_CHILDREN is not set
+CONFIG_KERNFS=y
+CONFIG_SYSFS=y
+CONFIG_TMPFS=y
+CONFIG_TMPFS_POSIX_ACL=y
+CONFIG_TMPFS_XATTR=y
+# CONFIG_HUGETLB_PAGE is not set
+CONFIG_CONFIGFS_FS=m
+CONFIG_MISC_FILESYSTEMS=y
+# CONFIG_ORANGEFS_FS is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_ECRYPT_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_HFSPLUS_FS is not set
+# CONFIG_BEFS_FS is not set
+# CONFIG_BFS_FS is not set
+# CONFIG_EFS_FS is not set
+CONFIG_YAFFS_FS=y
+CONFIG_YAFFS_YAFFS1=y
+# CONFIG_YAFFS_9BYTE_TAGS is not set
+# CONFIG_YAFFS_DOES_ECC is not set
+CONFIG_YAFFS_YAFFS2=y
+CONFIG_YAFFS_AUTO_YAFFS2=y
+# CONFIG_YAFFS_DISABLE_TAGS_ECC is not set
+# CONFIG_YAFFS_ALWAYS_CHECK_CHUNK_ERASED is not set
+# CONFIG_YAFFS_EMPTY_LOST_AND_FOUND is not set
+# CONFIG_YAFFS_DISABLE_BLOCK_REFRESHING is not set
+# CONFIG_YAFFS_DISABLE_BACKGROUND is not set
+# CONFIG_YAFFS_DISABLE_BAD_BLOCK_MARKING is not set
+CONFIG_YAFFS_XATTR=y
+CONFIG_JFFS2_FS=y
+CONFIG_JFFS2_FS_DEBUG=0
+CONFIG_JFFS2_FS_WRITEBUFFER=y
+# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
+# CONFIG_JFFS2_SUMMARY is not set
+# CONFIG_JFFS2_FS_XATTR is not set
+# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
+CONFIG_JFFS2_ZLIB=y
+# CONFIG_JFFS2_LZO is not set
+CONFIG_JFFS2_RTIME=y
+# CONFIG_JFFS2_RUBIN is not set
+CONFIG_UBIFS_FS=y
+# CONFIG_UBIFS_FS_ADVANCED_COMPR is not set
+CONFIG_UBIFS_FS_LZO=y
+CONFIG_UBIFS_FS_ZLIB=y
+# CONFIG_UBIFS_ATIME_SUPPORT is not set
+# CONFIG_LOGFS is not set
+CONFIG_CRAMFS=y
+# CONFIG_SQUASHFS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_OMFS_FS is not set
+# CONFIG_HPFS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX6FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+# CONFIG_PSTORE is not set
+# CONFIG_SYSV_FS is not set
+# CONFIG_UFS_FS is not set
+CONFIG_NETWORK_FILESYSTEMS=y
+CONFIG_NFS_FS=y
+CONFIG_NFS_V2=y
+CONFIG_NFS_V3=y
+CONFIG_NFS_V3_ACL=y
+CONFIG_NFS_V4=y
+# CONFIG_NFS_SWAP is not set
+# CONFIG_NFS_V4_1 is not set
+CONFIG_ROOT_NFS=y
+# CONFIG_NFS_USE_LEGACY_DNS is not set
+CONFIG_NFS_USE_KERNEL_DNS=y
+# CONFIG_NFSD is not set
+CONFIG_GRACE_PERIOD=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_NFS_ACL_SUPPORT=y
+CONFIG_NFS_COMMON=y
+CONFIG_SUNRPC=y
+CONFIG_SUNRPC_GSS=y
+# CONFIG_SUNRPC_DEBUG is not set
+# CONFIG_CEPH_FS is not set
+# CONFIG_CIFS is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_CODA_FS is not set
+# CONFIG_AFS_FS is not set
+CONFIG_NLS=y
+CONFIG_NLS_DEFAULT="iso8859-1"
+CONFIG_NLS_CODEPAGE_437=y
+CONFIG_NLS_CODEPAGE_737=m
+CONFIG_NLS_CODEPAGE_775=m
+CONFIG_NLS_CODEPAGE_850=m
+CONFIG_NLS_CODEPAGE_852=m
+CONFIG_NLS_CODEPAGE_855=m
+CONFIG_NLS_CODEPAGE_857=m
+CONFIG_NLS_CODEPAGE_860=m
+CONFIG_NLS_CODEPAGE_861=m
+CONFIG_NLS_CODEPAGE_862=m
+CONFIG_NLS_CODEPAGE_863=m
+CONFIG_NLS_CODEPAGE_864=m
+CONFIG_NLS_CODEPAGE_865=m
+CONFIG_NLS_CODEPAGE_866=m
+CONFIG_NLS_CODEPAGE_869=m
+CONFIG_NLS_CODEPAGE_936=y
+CONFIG_NLS_CODEPAGE_950=m
+CONFIG_NLS_CODEPAGE_932=m
+CONFIG_NLS_CODEPAGE_949=m
+CONFIG_NLS_CODEPAGE_874=m
+CONFIG_NLS_ISO8859_8=m
+CONFIG_NLS_CODEPAGE_1250=m
+CONFIG_NLS_CODEPAGE_1251=m
+CONFIG_NLS_ASCII=y
+CONFIG_NLS_ISO8859_1=y
+CONFIG_NLS_ISO8859_2=m
+CONFIG_NLS_ISO8859_3=m
+CONFIG_NLS_ISO8859_4=m
+CONFIG_NLS_ISO8859_5=m
+CONFIG_NLS_ISO8859_6=m
+CONFIG_NLS_ISO8859_7=m
+CONFIG_NLS_ISO8859_9=m
+CONFIG_NLS_ISO8859_13=m
+CONFIG_NLS_ISO8859_14=m
+CONFIG_NLS_ISO8859_15=m
+CONFIG_NLS_KOI8_R=m
+CONFIG_NLS_KOI8_U=m
+# CONFIG_NLS_MAC_ROMAN is not set
+# CONFIG_NLS_MAC_CELTIC is not set
+# CONFIG_NLS_MAC_CENTEURO is not set
+# CONFIG_NLS_MAC_CROATIAN is not set
+# CONFIG_NLS_MAC_CYRILLIC is not set
+# CONFIG_NLS_MAC_GAELIC is not set
+# CONFIG_NLS_MAC_GREEK is not set
+# CONFIG_NLS_MAC_ICELAND is not set
+# CONFIG_NLS_MAC_INUIT is not set
+# CONFIG_NLS_MAC_ROMANIAN is not set
+# CONFIG_NLS_MAC_TURKISH is not set
+CONFIG_NLS_UTF8=y
+# CONFIG_DLM is not set
+
+#
+# Kernel hacking
+#
+
+#
+# printk and dmesg options
+#
+# CONFIG_PRINTK_TIME is not set
+CONFIG_MESSAGE_LOGLEVEL_DEFAULT=4
+# CONFIG_BOOT_PRINTK_DELAY is not set
+
+#
+# Compile-time checks and compiler options
+#
+# CONFIG_DEBUG_INFO is not set
+# CONFIG_ENABLE_WARN_DEPRECATED is not set
+# CONFIG_ENABLE_MUST_CHECK is not set
+CONFIG_FRAME_WARN=1024
+# CONFIG_STRIP_ASM_SYMS is not set
+# CONFIG_READABLE_ASM is not set
+# CONFIG_UNUSED_SYMBOLS is not set
+# CONFIG_PAGE_OWNER is not set
+# CONFIG_DEBUG_FS is not set
+# CONFIG_HEADERS_CHECK is not set
+# CONFIG_DEBUG_SECTION_MISMATCH is not set
+CONFIG_SECTION_MISMATCH_WARN_ONLY=y
+CONFIG_FRAME_POINTER=y
+# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
+# CONFIG_MAGIC_SYSRQ is not set
+CONFIG_DEBUG_KERNEL=y
+
+#
+# Memory Debugging
+#
+# CONFIG_PAGE_EXTENSION is not set
+# CONFIG_PAGE_POISONING is not set
+# CONFIG_DEBUG_OBJECTS is not set
+# CONFIG_SLUB_DEBUG_ON is not set
+# CONFIG_SLUB_STATS is not set
+CONFIG_HAVE_DEBUG_KMEMLEAK=y
+# CONFIG_DEBUG_KMEMLEAK is not set
+# CONFIG_DEBUG_STACK_USAGE is not set
+# CONFIG_DEBUG_VM is not set
+CONFIG_DEBUG_MEMORY_INIT=y
+# CONFIG_DEBUG_SHIRQ is not set
+
+#
+# Debug Lockups and Hangs
+#
+# CONFIG_LOCKUP_DETECTOR is not set
+# CONFIG_DETECT_HUNG_TASK is not set
+# CONFIG_WQ_WATCHDOG is not set
+# CONFIG_PANIC_ON_OOPS is not set
+CONFIG_PANIC_ON_OOPS_VALUE=0
+CONFIG_PANIC_TIMEOUT=0
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_SCHED_INFO is not set
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_SCHED_STACK_END_CHECK is not set
+# CONFIG_DEBUG_TIMEKEEPING is not set
+# CONFIG_TIMER_STATS is not set
+
+#
+# Lock Debugging (spinlocks, mutexes, etc...)
+#
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_DEBUG_SPINLOCK is not set
+CONFIG_DEBUG_MUTEXES=y
+# CONFIG_DEBUG_WW_MUTEX_SLOWPATH is not set
+# CONFIG_DEBUG_LOCK_ALLOC is not set
+# CONFIG_PROVE_LOCKING is not set
+# CONFIG_LOCK_STAT is not set
+# CONFIG_DEBUG_ATOMIC_SLEEP is not set
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+# CONFIG_LOCK_TORTURE_TEST is not set
+CONFIG_STACKTRACE=y
+# CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
+# CONFIG_DEBUG_LIST is not set
+# CONFIG_DEBUG_PI_LIST is not set
+# CONFIG_DEBUG_SG is not set
+# CONFIG_DEBUG_NOTIFIERS is not set
+# CONFIG_DEBUG_CREDENTIALS is not set
+
+#
+# RCU Debugging
+#
+# CONFIG_PROVE_RCU is not set
+# CONFIG_SPARSE_RCU_POINTER is not set
+# CONFIG_TORTURE_TEST is not set
+# CONFIG_RCU_PERF_TEST is not set
+# CONFIG_RCU_TORTURE_TEST is not set
+# CONFIG_RCU_TRACE is not set
+# CONFIG_RCU_EQS_DEBUG is not set
+# CONFIG_DEBUG_WQ_FORCE_RR_CPU is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_NOTIFIER_ERROR_INJECTION is not set
+# CONFIG_FAULT_INJECTION is not set
+# CONFIG_LATENCYTOP is not set
+CONFIG_HAVE_FUNCTION_TRACER=y
+CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y
+CONFIG_HAVE_DYNAMIC_FTRACE=y
+CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y
+CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
+CONFIG_HAVE_C_RECORDMCOUNT=y
+CONFIG_TRACING_SUPPORT=y
+# CONFIG_FTRACE is not set
+
+#
+# Runtime Testing
+#
+# CONFIG_TEST_LIST_SORT is not set
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_RBTREE_TEST is not set
+# CONFIG_INTERVAL_TREE_TEST is not set
+# CONFIG_PERCPU_TEST is not set
+# CONFIG_ATOMIC64_SELFTEST is not set
+# CONFIG_TEST_HEXDUMP is not set
+# CONFIG_TEST_STRING_HELPERS is not set
+# CONFIG_TEST_KSTRTOX is not set
+# CONFIG_TEST_PRINTF is not set
+# CONFIG_TEST_BITMAP is not set
+# CONFIG_TEST_UUID is not set
+# CONFIG_TEST_RHASHTABLE is not set
+# CONFIG_TEST_HASH is not set
+# CONFIG_DMA_API_DEBUG is not set
+# CONFIG_TEST_LKM is not set
+# CONFIG_TEST_USER_COPY is not set
+# CONFIG_TEST_BPF is not set
+# CONFIG_TEST_FIRMWARE is not set
+# CONFIG_TEST_UDELAY is not set
+# CONFIG_MEMTEST is not set
+# CONFIG_TEST_STATIC_KEYS is not set
+# CONFIG_SAMPLES is not set
+CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
+# CONFIG_ARCH_WANTS_UBSAN_NO_NULL is not set
+# CONFIG_UBSAN is not set
+CONFIG_ARCH_HAS_DEVMEM_IS_ALLOWED=y
+CONFIG_STRICT_DEVMEM=y
+# CONFIG_IO_STRICT_DEVMEM is not set
+# CONFIG_ARM_PTDUMP is not set
+# CONFIG_ARM_UNWIND is not set
+# CONFIG_DEBUG_USER is not set
+# CONFIG_DEBUG_LL is not set
+CONFIG_DEBUG_LL_INCLUDE="mach/debug-macro.S"
+# CONFIG_DEBUG_UART_8250 is not set
+CONFIG_UNCOMPRESS_INCLUDE="debug/uncompress.h"
+# CONFIG_PID_IN_CONTEXTIDR is not set
+# CONFIG_DEBUG_SET_MODULE_RONX is not set
+# CONFIG_CORESIGHT is not set
+
+#
+# Security options
+#
+CONFIG_KEYS=y
+# CONFIG_PERSISTENT_KEYRINGS is not set
+# CONFIG_ENCRYPTED_KEYS is not set
+# CONFIG_KEY_DH_OPERATIONS is not set
+# CONFIG_SECURITY_DMESG_RESTRICT is not set
+# CONFIG_SECURITY is not set
+# CONFIG_SECURITYFS is not set
+CONFIG_HAVE_HARDENED_USERCOPY_ALLOCATOR=y
+CONFIG_HAVE_ARCH_HARDENED_USERCOPY=y
+# CONFIG_HARDENED_USERCOPY is not set
+CONFIG_DEFAULT_SECURITY_DAC=y
+CONFIG_DEFAULT_SECURITY=""
+CONFIG_CRYPTO=y
+
+#
+# Crypto core or helper
+#
+CONFIG_CRYPTO_ALGAPI=y
+CONFIG_CRYPTO_ALGAPI2=y
+CONFIG_CRYPTO_AEAD=m
+CONFIG_CRYPTO_AEAD2=y
+CONFIG_CRYPTO_BLKCIPHER=y
+CONFIG_CRYPTO_BLKCIPHER2=y
+CONFIG_CRYPTO_HASH=y
+CONFIG_CRYPTO_HASH2=y
+CONFIG_CRYPTO_RNG=m
+CONFIG_CRYPTO_RNG2=y
+CONFIG_CRYPTO_RNG_DEFAULT=m
+CONFIG_CRYPTO_AKCIPHER2=y
+CONFIG_CRYPTO_KPP2=y
+# CONFIG_CRYPTO_RSA is not set
+# CONFIG_CRYPTO_DH is not set
+# CONFIG_CRYPTO_ECDH is not set
+CONFIG_CRYPTO_MANAGER=m
+CONFIG_CRYPTO_MANAGER2=y
+# CONFIG_CRYPTO_USER is not set
+CONFIG_CRYPTO_MANAGER_DISABLE_TESTS=y
+CONFIG_CRYPTO_GF128MUL=m
+CONFIG_CRYPTO_NULL=m
+CONFIG_CRYPTO_NULL2=y
+CONFIG_CRYPTO_WORKQUEUE=y
+# CONFIG_CRYPTO_CRYPTD is not set
+# CONFIG_CRYPTO_MCRYPTD is not set
+# CONFIG_CRYPTO_AUTHENC is not set
+# CONFIG_CRYPTO_TEST is not set
+
+#
+# Authenticated Encryption with Associated Data
+#
+CONFIG_CRYPTO_CCM=m
+CONFIG_CRYPTO_GCM=m
+# CONFIG_CRYPTO_CHACHA20POLY1305 is not set
+CONFIG_CRYPTO_SEQIV=m
+CONFIG_CRYPTO_ECHAINIV=m
+
+#
+# Block modes
+#
+# CONFIG_CRYPTO_CBC is not set
+CONFIG_CRYPTO_CTR=m
+# CONFIG_CRYPTO_CTS is not set
+# CONFIG_CRYPTO_ECB is not set
+# CONFIG_CRYPTO_LRW is not set
+# CONFIG_CRYPTO_PCBC is not set
+# CONFIG_CRYPTO_XTS is not set
+# CONFIG_CRYPTO_KEYWRAP is not set
+
+#
+# Hash modes
+#
+# CONFIG_CRYPTO_CMAC is not set
+CONFIG_CRYPTO_HMAC=m
+# CONFIG_CRYPTO_XCBC is not set
+# CONFIG_CRYPTO_VMAC is not set
+
+#
+# Digest
+#
+CONFIG_CRYPTO_CRC32C=y
+# CONFIG_CRYPTO_CRC32 is not set
+CONFIG_CRYPTO_CRCT10DIF=y
+CONFIG_CRYPTO_GHASH=m
+# CONFIG_CRYPTO_POLY1305 is not set
+# CONFIG_CRYPTO_MD4 is not set
+CONFIG_CRYPTO_MD5=y
+# CONFIG_CRYPTO_MICHAEL_MIC is not set
+# CONFIG_CRYPTO_RMD128 is not set
+# CONFIG_CRYPTO_RMD160 is not set
+# CONFIG_CRYPTO_RMD256 is not set
+# CONFIG_CRYPTO_RMD320 is not set
+CONFIG_CRYPTO_SHA1=y
+CONFIG_CRYPTO_SHA256=y
+# CONFIG_CRYPTO_SHA512 is not set
+# CONFIG_CRYPTO_SHA3 is not set
+# CONFIG_CRYPTO_TGR192 is not set
+# CONFIG_CRYPTO_WP512 is not set
+
+#
+# Ciphers
+#
+CONFIG_CRYPTO_AES=y
+# CONFIG_CRYPTO_ANUBIS is not set
+CONFIG_CRYPTO_ARC4=y
+# CONFIG_CRYPTO_BLOWFISH is not set
+# CONFIG_CRYPTO_CAMELLIA is not set
+# CONFIG_CRYPTO_CAST5 is not set
+# CONFIG_CRYPTO_CAST6 is not set
+# CONFIG_CRYPTO_DES is not set
+# CONFIG_CRYPTO_FCRYPT is not set
+# CONFIG_CRYPTO_KHAZAD is not set
+# CONFIG_CRYPTO_SALSA20 is not set
+# CONFIG_CRYPTO_CHACHA20 is not set
+# CONFIG_CRYPTO_SEED is not set
+# CONFIG_CRYPTO_SERPENT is not set
+# CONFIG_CRYPTO_TEA is not set
+# CONFIG_CRYPTO_TWOFISH is not set
+
+#
+# Compression
+#
+CONFIG_CRYPTO_DEFLATE=y
+CONFIG_CRYPTO_LZO=y
+# CONFIG_CRYPTO_842 is not set
+# CONFIG_CRYPTO_LZ4 is not set
+# CONFIG_CRYPTO_LZ4HC is not set
+
+#
+# Random Number Generation
+#
+# CONFIG_CRYPTO_ANSI_CPRNG is not set
+CONFIG_CRYPTO_DRBG_MENU=m
+CONFIG_CRYPTO_DRBG_HMAC=y
+# CONFIG_CRYPTO_DRBG_HASH is not set
+# CONFIG_CRYPTO_DRBG_CTR is not set
+CONFIG_CRYPTO_DRBG=m
+CONFIG_CRYPTO_JITTERENTROPY=m
+# CONFIG_CRYPTO_USER_API_HASH is not set
+# CONFIG_CRYPTO_USER_API_SKCIPHER is not set
+# CONFIG_CRYPTO_USER_API_RNG is not set
+# CONFIG_CRYPTO_USER_API_AEAD is not set
+# CONFIG_CRYPTO_HW is not set
+# CONFIG_ASYMMETRIC_KEY_TYPE is not set
+
+#
+# Certificates for signature checking
+#
+# CONFIG_ARM_CRYPTO is not set
+# CONFIG_BINARY_PRINTF is not set
+
+#
+# Library routines
+#
+CONFIG_BITREVERSE=y
+CONFIG_HAVE_ARCH_BITREVERSE=y
+CONFIG_RATIONAL=y
+CONFIG_GENERIC_STRNCPY_FROM_USER=y
+CONFIG_GENERIC_STRNLEN_USER=y
+CONFIG_GENERIC_NET_UTILS=y
+CONFIG_GENERIC_PCI_IOMAP=y
+CONFIG_GENERIC_IO=y
+CONFIG_ARCH_USE_CMPXCHG_LOCKREF=y
+CONFIG_CRC_CCITT=y
+CONFIG_CRC16=y
+CONFIG_CRC_T10DIF=y
+CONFIG_CRC_ITU_T=y
+CONFIG_CRC32=y
+# CONFIG_CRC32_SELFTEST is not set
+CONFIG_CRC32_SLICEBY8=y
+# CONFIG_CRC32_SLICEBY4 is not set
+# CONFIG_CRC32_SARWATE is not set
+# CONFIG_CRC32_BIT is not set
+# CONFIG_CRC7 is not set
+CONFIG_LIBCRC32C=y
+# CONFIG_CRC8 is not set
+# CONFIG_AUDIT_ARCH_COMPAT_GENERIC is not set
+# CONFIG_RANDOM32_SELFTEST is not set
+CONFIG_ZLIB_INFLATE=y
+CONFIG_ZLIB_DEFLATE=y
+CONFIG_LZO_COMPRESS=y
+CONFIG_LZO_DECOMPRESS=y
+CONFIG_LZ4_DECOMPRESS=y
+CONFIG_XZ_DEC=y
+CONFIG_XZ_DEC_X86=y
+CONFIG_XZ_DEC_POWERPC=y
+CONFIG_XZ_DEC_IA64=y
+CONFIG_XZ_DEC_ARM=y
+CONFIG_XZ_DEC_ARMTHUMB=y
+CONFIG_XZ_DEC_SPARC=y
+CONFIG_XZ_DEC_BCJ=y
+# CONFIG_XZ_DEC_TEST is not set
+CONFIG_DECOMPRESS_GZIP=y
+CONFIG_DECOMPRESS_LZ4=y
+CONFIG_GENERIC_ALLOCATOR=y
+CONFIG_ASSOCIATIVE_ARRAY=y
+CONFIG_HAS_IOMEM=y
+CONFIG_HAS_IOPORT_MAP=y
+CONFIG_HAS_DMA=y
+CONFIG_DQL=y
+CONFIG_GLOB=y
+# CONFIG_GLOB_SELFTEST is not set
+CONFIG_NLATTR=y
+# CONFIG_CORDIC is not set
+# CONFIG_DDR is not set
+# CONFIG_IRQ_POLL is not set
+CONFIG_LIBFDT=y
+CONFIG_OID_REGISTRY=y
+# CONFIG_SG_SPLIT is not set
+CONFIG_SG_POOL=y
+CONFIG_ARCH_HAS_SG_CHAIN=y
+CONFIG_SBITMAP=y
+# CONFIG_VIRTUALIZATION is not set
diff --git a/arch/arm/mach-hibvt/Kconfig b/arch/arm/mach-hibvt/Kconfig
new file mode 100644
index 0000000..ac0db1c
--- /dev/null
+++ b/arch/arm/mach-hibvt/Kconfig
@@ -0,0 +1,46 @@
+config ARCH_HISI_BVT
+ bool "Hisilicon BVT SoC Support"
+ select ARM_AMBA
+ select ARM_GIC
+ select ARM_TIMER_SP804
+ select POWER_RESET
+ select POWER_RESET_HISI
+ select POWER_SUPPLY
+
+if ARCH_HISI_BVT
+
+menu "Hisilicon BVT platform type"
+
+config HI_ZRELADDR
+ hex 'zreladdr'
+ default "0x80008000"
+
+config HI_PARAMS_PHYS
+ hex 'params_phys'
+ default "0x00000100"
+
+config HI_INITRD_PHYS
+ hex 'initrd_phys'
+ default "0x00800000"
+
+config ARCH_HI3516A
+ bool "Hisilicon Hi3516A Cortex-A7(Single) family"
+ select HAVE_ARM_ARCH_TIMER
+ select ARM_GIC
+ select ARCH_HAS_RESET_CONTROLLER
+ select RESET_CONTROLLER
+ select ARCH_MULTI_V7
+ help
+ Support for Hisilicon Hi3516A Soc family.
+
+config ARCH_HI3536DV100
+ bool "Hisilicon Hi3536DV100 Cortex-A7(Single) family"
+ depends on ARCH_MULTI_V7
+ select HAVE_ARM_ARCH_TIMER
+ select PINCTRL
+ help
+ Support for Hisilicon Hi3536DV100 Soc family.
+
+endmenu
+
+endif
diff --git a/arch/arm/mach-hibvt/Makefile b/arch/arm/mach-hibvt/Makefile
new file mode 100644
index 0000000..680a8a8
--- /dev/null
+++ b/arch/arm/mach-hibvt/Makefile
@@ -0,0 +1,6 @@
+#
+# Makefile for Hisilicon processors family
+#
+
+obj-$(CONFIG_ARCH_HI3516A) += mach-hi3516a.o
+obj-$(CONFIG_ARCH_HI3536DV100) += mach-hi3536dv100.o
diff --git a/arch/arm/mach-hibvt/Makefile.boot b/arch/arm/mach-hibvt/Makefile.boot
new file mode 100644
index 0000000..be34718
--- /dev/null
+++ b/arch/arm/mach-hibvt/Makefile.boot
@@ -0,0 +1,3 @@
+zreladdr-$(CONFIG_ARCH_HISI_BVT) := $(CONFIG_HI_ZRELADDR)
+params_phys-$(CONFIG_ARCH_HISI_BVT) := $(CONFIG_HI_PARAMS_PHYS)
+initrd_phys-$(CONFIG_ARCH_HISI_BVT) := $(CONFIG_HI_INITRD_PHYS)
diff --git a/arch/arm/mach-hibvt/include/mach/hi3516a_io.h b/arch/arm/mach-hibvt/include/mach/hi3516a_io.h
new file mode 100644
index 0000000..7654fb7
--- /dev/null
+++ b/arch/arm/mach-hibvt/include/mach/hi3516a_io.h
@@ -0,0 +1,25 @@
+#ifndef __HI3516A_IO_H
+#define __HI3516A_IO_H
+
+/*
+ * phy: 0x20000000 ~ 0x20700000
+ * vir: 0xFE100000 ~ 0xFE800000
+ */
+#define HI3516A_IOCH2_PHYS 0x20000000
+#define IO_OFFSET_HIGH 0xDE100000
+#define HI3516A_IOCH2_VIRT (HI3516A_IOCH2_PHYS + IO_OFFSET_HIGH)
+#define HI3516A_IOCH2_SIZE 0x700000
+
+/* phy: 0x10000000 ~ 0x100D0000
+ * vir: 0xFE000000 ~ 0xFE0D0000
+ */
+#define HI3516A_IOCH1_PHYS 0x10000000
+#define IO_OFFSET_LOW 0xEE000000
+#define HI3516A_IOCH1_VIRT (HI3516A_IOCH1_PHYS + IO_OFFSET_LOW)
+#define HI3516A_IOCH1_SIZE 0xD0000
+
+#define IO_ADDRESS(x) ((x) >= HI3516A_IOCH2_PHYS ? (x) + IO_OFFSET_HIGH \
+ : (x) + IO_OFFSET_LOW)
+#endif
+
+
diff --git a/arch/arm/mach-hibvt/include/mach/hi3536dv100_io.h b/arch/arm/mach-hibvt/include/mach/hi3536dv100_io.h
new file mode 100644
index 0000000..6135e75
--- /dev/null
+++ b/arch/arm/mach-hibvt/include/mach/hi3536dv100_io.h
@@ -0,0 +1,44 @@
+#ifndef __HI3536DV100_IO_H
+#define __HI3536DV100_IO_H
+
+/* phys_addr virt_addr
+ * 0x1100_0000 <-----> 0xFE00_0000
+ * 0x1104_0000 <-----> 0xFE04_0000
+ */
+#define HI3536DV100_IOCH1_VIRT (0xFE000000)
+#define HI3536DV100_IOCH1_PHYS (0x11000000)
+#define HI3536DV100_IOCH1_SIZE (0x00040000)
+
+/* phys_addr virt_addr
+ * 0x1200_0000 <-----> 0xFE10_0000
+ * 0x121B_0000 <-----> 0xFE2B_0000
+ */
+#define HI3536DV100_IOCH2_VIRT (0xFE100000)
+#define HI3536DV100_IOCH2_PHYS (0x12000000)
+#define HI3536DV100_IOCH2_SIZE (0x001B0000)
+
+/* phys_addr virt_addr
+ * 0x1300_0000 <-----> 0xFE30_0000
+ * 0x1321_0000 <-----> 0xFE51_0000
+ */
+#define HI3536DV100_IOCH3_VIRT (0xFE300000)
+#define HI3536DV100_IOCH3_PHYS (0x13000000)
+#define HI3536DV100_IOCH3_SIZE (0x00210000)
+
+#define IO_OFFSET_LOW (0xEB300000)
+#define IO_OFFSET_MID (0xEC100000)
+#define IO_OFFSET_HIGH (0xED000000)
+
+#define IO_ADDRESS_LOW(x) ((x) + IO_OFFSET_LOW)
+#define IO_ADDRESS_MID(x) ((x) + IO_OFFSET_MID)
+#define IO_ADDRESS_HIGH(x) ((x) + IO_OFFSET_HIGH)
+
+#define __IO_ADDRESS_HIGH(x) ((x >= HI3536DV100_IOCH2_PHYS) ? IO_ADDRESS_MID(x) \
+ : IO_ADDRESS_HIGH(x))
+#define IO_ADDRESS(x) ((x) >= HI3536DV100_IOCH3_PHYS ? IO_ADDRESS_LOW(x) \
+ : __IO_ADDRESS_HIGH(x))
+
+#define __io_address(x) (IOMEM(IO_ADDRESS(x)))
+
+#endif
+
diff --git a/arch/arm/mach-hibvt/include/mach/hi3536dv100_platform.h b/arch/arm/mach-hibvt/include/mach/hi3536dv100_platform.h
new file mode 100644
index 0000000..bf21bc5
--- /dev/null
+++ b/arch/arm/mach-hibvt/include/mach/hi3536dv100_platform.h
@@ -0,0 +1,14 @@
+#ifndef __HISI_CHIP_REGS_H__
+#define __HISI_CHIP_REGS_H__
+
+/* -------------------------------------------------------------------- */
+/* Clock and Reset Generator REG */
+/* -------------------------------------------------------------------- */
+#define REG_CRG_BASE 0x12040000
+
+/* -------------------------------------------------------------------- */
+/* Misc control REG */
+/* -------------------------------------------------------------------- */
+#define REG_MISC_CTRL_BASE 0x12120000
+
+#endif /* End of __HISI_CHIP_REGS_H__ */
diff --git a/arch/arm/mach-hibvt/include/mach/io.h b/arch/arm/mach-hibvt/include/mach/io.h
new file mode 100644
index 0000000..07abf1c
--- /dev/null
+++ b/arch/arm/mach-hibvt/include/mach/io.h
@@ -0,0 +1,12 @@
+#ifndef __ASM_ARM_ARCH_IO_H
+#define __ASM_ARM_ARCH_IO_H
+
+#ifdef CONFIG_ARCH_HI3516A
+#include
+#endif
+
+#ifdef CONFIG_ARCH_HI3536DV100
+#include
+#endif
+
+#endif
diff --git a/arch/arm/mach-hibvt/include/mach/platform.h b/arch/arm/mach-hibvt/include/mach/platform.h
new file mode 100644
index 0000000..00ac02f
--- /dev/null
+++ b/arch/arm/mach-hibvt/include/mach/platform.h
@@ -0,0 +1,8 @@
+#ifndef __HISI_PLATFORM_H__
+#define __HISI_PLATFORM_H__
+
+#ifdef CONFIG_ARCH_HI3536DV100
+#include
+#endif
+
+#endif /* End of __HISI_PLATFORM_H__ */
diff --git a/arch/arm/mach-hibvt/mach-hi3516a.c b/arch/arm/mach-hibvt/mach-hi3516a.c
new file mode 100644
index 0000000..ed49f25
--- /dev/null
+++ b/arch/arm/mach-hibvt/mach-hi3516a.c
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2016-2017 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+*/
+
+#include
+#include
+
+#include
+#include
+#include
+
+/*
+ * This table is only for optimization. Since ioremap() could always share
+ * the same mapping if it's defined as static IO mapping.
+ *
+ * Without this table, system could also work. The cost is some virtual address
+ * spaces wasted since ioremap() may be called multi times for the same
+ * IO space.
+ */
+static struct map_desc hi3516a_io_desc[] __initdata = {
+ {
+ /* hi3516a_IOCH1 */
+ .pfn = __phys_to_pfn(HI3516A_IOCH1_PHYS),
+ .virtual = HI3516A_IOCH1_VIRT,
+ .length = HI3516A_IOCH1_SIZE,
+ .type = MT_DEVICE,
+ },
+ {
+ /* hi3516a_IOCH2 */
+ .pfn = __phys_to_pfn(HI3516A_IOCH2_PHYS),
+ .virtual = HI3516A_IOCH2_VIRT,
+ .length = HI3516A_IOCH2_SIZE,
+ .type = MT_DEVICE,
+ },
+};
+
+static void __init hi3516a_map_io(void)
+{
+ /* debug_ll_io_init(); */
+ iotable_init(hi3516a_io_desc, ARRAY_SIZE(hi3516a_io_desc));
+}
+
+static const char *const hi3516a_compat[] __initconst = {
+ "hisilicon,hi3516a",
+ NULL,
+};
+
+DT_MACHINE_START(HI3516A_DT, "Hisilicon Hi3516A (Flattened Device Tree)")
+ .map_io = hi3516a_map_io,
+ .dt_compat = hi3516a_compat,
+MACHINE_END
diff --git a/arch/arm/mach-hibvt/mach-hi3536dv100.c b/arch/arm/mach-hibvt/mach-hi3536dv100.c
new file mode 100644
index 0000000..7b27dfa
--- /dev/null
+++ b/arch/arm/mach-hibvt/mach-hi3536dv100.c
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2016-2017 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+*/
+
+#include
+#include
+
+#include
+#include
+#include
+
+/*
+ * This table is only for optimization. Since ioremap() could always share
+ * the same mapping if it's defined as static IO mapping.
+ *
+ * Without this table, system could also work. The cost is some virtual address
+ * spaces wasted since ioremap() may be called multi times for the same
+ * IO space.
+ */
+static struct map_desc hi3536dv100_io_desc[] __initdata = {
+ /* hi3536dv100_IOCH1 */
+ {
+ .virtual = HI3536DV100_IOCH1_VIRT,
+ .pfn = __phys_to_pfn(HI3536DV100_IOCH1_PHYS),
+ .length = HI3536DV100_IOCH1_SIZE,
+ .type = MT_DEVICE
+ },
+ /* hi3536dv100_IOCH2 */
+ {
+ .virtual = HI3536DV100_IOCH2_VIRT,
+ .pfn = __phys_to_pfn(HI3536DV100_IOCH2_PHYS),
+ .length = HI3536DV100_IOCH2_SIZE,
+ .type = MT_DEVICE
+ },
+ /* hi3536dv100_IOCH3 */
+ {
+ .virtual = HI3536DV100_IOCH3_VIRT,
+ .pfn = __phys_to_pfn(HI3536DV100_IOCH3_PHYS),
+ .length = HI3536DV100_IOCH3_SIZE,
+ .type = MT_DEVICE
+ },
+};
+
+static void __init hi3536dv100_map_io(void)
+{
+ iotable_init(hi3536dv100_io_desc, ARRAY_SIZE(hi3536dv100_io_desc));
+}
+static const char *const hi3536dv100_compat[] __initconst = {
+ "hisilicon,hi3536dv100",
+ NULL,
+};
+
+DT_MACHINE_START(HI3536DV100_DT, "Hisilicon Hi3536DV100 (Flattened Device Tree)")
+ .map_io = hi3536dv100_map_io,
+ .dt_compat = hi3536dv100_compat,
+MACHINE_END
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index ab77100..6143695 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -2397,3 +2397,10 @@ void arch_teardown_dma_ops(struct device *dev)
{
arm_teardown_iommu_dma_ops(dev);
}
+
+void hi_dmac_map_area(const void *kaddr, size_t size,
+ enum dma_data_direction dir)
+{
+ dmac_map_area(kaddr, size, dir);
+}
+EXPORT_SYMBOL(hi_dmac_map_area);
diff --git a/drivers/Kconfig b/drivers/Kconfig
index e1e2066..ee519f7 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -202,4 +202,6 @@ source "drivers/hwtracing/intel_th/Kconfig"
source "drivers/fpga/Kconfig"
+source "drivers/hidmac/Kconfig"
+
endmenu
diff --git a/drivers/Makefile b/drivers/Makefile
index 733bf0b..36a7a91 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -174,3 +174,4 @@ obj-$(CONFIG_STM) += hwtracing/stm/
obj-$(CONFIG_ANDROID) += android/
obj-$(CONFIG_NVMEM) += nvmem/
obj-$(CONFIG_FPGA) += fpga/
+obj-$(CONFIG_HI_DMAC) += hidmac/
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 2c8be74..9154bc8 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -2,6 +2,8 @@
# SATA/PATA driver configuration
#
+source "drivers/ata/Kconfig.hiahci"
+
config HAVE_PATA_PLATFORM
bool
help
diff --git a/drivers/ata/Kconfig.hiahci b/drivers/ata/Kconfig.hiahci
new file mode 100644
index 0000000..3bc0424
--- /dev/null
+++ b/drivers/ata/Kconfig.hiahci
@@ -0,0 +1,43 @@
+menuconfig HISI_SATA
+ bool "Hisilicon sata device support"
+ depends on ARCH_HI3536DV100
+ default y if ARCH_HI3536DV100
+ select ATA
+ select ATA_VERBOSE_ERROR
+ select SATA_PMP
+ select SATA_AHCI_PLATFORM
+
+if HISI_SATA
+config HISI_SATA_IOBASE
+ hex "Hisi sata IO address"
+ default "0x10030000" if ARCH_HI3536DV100
+ help
+ hisilicon sata io base address.
+
+config HISI_SATA_FBS
+ int "Hisi sata FIS-Based switching"
+ default 1
+ range 0 1
+ help
+ Hisatav200 supports FBS.
+ FBS is FIS-Based switching.
+ Choose y if you want to use it.
+
+config HISI_SATA_NCQ
+ int "Hisi sata Native Command Queuing"
+ default 1
+ range 0 1
+ help
+ Hisatav200 supports NCQ.
+ NCQ is Native Command Queuing.
+ Choose y if you want to use it.
+
+config HISI_ESATA
+ bool "Support Hisi eSATA"
+ default n
+ help
+ Hisatav200 supports eSATA.
+ Choose y if you want to use it.
+
+endif
+
diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
index a46e6b7..40ee545 100644
--- a/drivers/ata/Makefile
+++ b/drivers/ata/Makefile
@@ -1,5 +1,6 @@
obj-$(CONFIG_ATA) += libata.o
+obj-$(CONFIG_HISI_SATA) += hisi_sata_dbg.o
# non-SFF interface
obj-$(CONFIG_SATA_AHCI) += ahci.o libahci.o
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index 0cc08f8..4fe8dc3 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -240,6 +240,9 @@ enum {
error-handling stage) */
AHCI_HFLAG_NO_DEVSLP = (1 << 17), /* no device sleep */
AHCI_HFLAG_NO_FBS = (1 << 18), /* no FBS */
+#ifdef CONFIG_HISI_SATA
+ AHCI_HFLAG_NO_SXS = (1 << 19), /* do not support External SATA */
+#endif
#ifdef CONFIG_PCI_MSI
AHCI_HFLAG_MULTI_MSI = (1 << 20), /* per-port MSI(-X) */
@@ -344,6 +347,13 @@ struct ahci_host_priv {
bool got_runtime_pm; /* Did we do pm_runtime_get? */
struct clk *clks[AHCI_MAX_CLKS]; /* Optional */
struct regulator **target_pwrs; /* Optional */
+
+#ifdef CONFIG_HISI_SATA
+#define PCI_AHCI 0
+#define ORI_AHCI 1
+ u32 type;
+#endif
+
/*
* If platform uses PHYs. There is a 1:1 relation between the port number and
* the PHY position in this array.
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
index 62a04c8..e08e678 100644
--- a/drivers/ata/ahci_platform.c
+++ b/drivers/ata/ahci_platform.c
@@ -26,6 +26,12 @@
#define DRV_NAME "ahci"
+#ifdef CONFIG_HISI_SATA_NCQ
+static unsigned int ncq_en = CONFIG_HISI_SATA_NCQ;
+module_param(ncq_en, uint, 0600);
+MODULE_PARM_DESC(ncq_en, "ahci ncq flag (default:1)");
+#endif
+
static const struct ata_port_info ahci_port_info = {
.flags = AHCI_FLAG_COMMON,
.pio_mask = ATA_PIO4,
@@ -54,8 +60,20 @@ static int ahci_probe(struct platform_device *pdev)
of_property_read_u32(dev->of_node,
"ports-implemented", &hpriv->force_port_map);
+#ifdef CONFIG_HISI_SATA
+ hpriv->type = ORI_AHCI;
+#ifndef CONFIG_HISI_ESATA
+ hpriv->flags |= AHCI_HFLAG_NO_SXS;
+#endif
+
+#ifdef CONFIG_HISI_SATA_NCQ
+ if (!ncq_en)
+ hpriv->flags |= AHCI_HFLAG_NO_NCQ;
+#endif
+#else
if (of_device_is_compatible(dev->of_node, "hisilicon,hisi-ahci"))
hpriv->flags |= AHCI_HFLAG_NO_FBS | AHCI_HFLAG_NO_NCQ;
+#endif
rc = ahci_platform_init_host(pdev, hpriv, &ahci_port_info,
&ahci_platform_sht);
diff --git a/drivers/ata/hisi_sata_dbg.c b/drivers/ata/hisi_sata_dbg.c
new file mode 100644
index 0000000..45efc6b
--- /dev/null
+++ b/drivers/ata/hisi_sata_dbg.c
@@ -0,0 +1,158 @@
+#include
+#include
+#include
+#include
+#include
+#include "ahci.h"
+#include "hisi_sata_dbg.h"
+
+void hisi_sata_mem_dump(unsigned int *addr, unsigned int size)
+{
+ int ix;
+
+ for (ix = 0; ix < size; ix += 0x04, addr++) {
+ if (!(ix & 0x0F))
+ pr_debug("\n0x%08X: ",
+ (unsigned int)virt_to_phys(addr));
+ pr_debug("%08X ", *addr);
+ }
+}
+EXPORT_SYMBOL(hisi_sata_mem_dump);
+
+void hisi_sata_phys_mem_dump(unsigned int addr, unsigned int size)
+{
+ hisi_sata_mem_dump(phys_to_virt(addr), size);
+}
+EXPORT_SYMBOL(hisi_sata_phys_mem_dump);
+
+void hisi_ahci_reg_dump(void)
+{
+ int ix;
+ unsigned int regbase;
+
+ regbase = CONFIG_HISI_SATA_IOBASE;
+ pr_debug("AHCI GHC Register dump:");
+ for (ix = 0; ix <= 0x28; ix += 0x04) {
+ if (!(ix & 0x0F))
+ pr_debug("\n0x%08X: ", (regbase + ix));
+ pr_debug("%08X ", readl(__io_address(regbase + ix)));
+ }
+ pr_debug("\n");
+
+ regbase = CONFIG_HISI_SATA_IOBASE + 0x0100;
+ pr_debug("AHCI PORT 0 Register dump:");
+ for (ix = 0; ix <= 0x7F; ix += 0x04) {
+ if (!(ix & 0x0F))
+ pr_debug("\n0x%08X: ", (regbase + ix));
+ pr_debug("%08X ", readl(__io_address(regbase + ix)));
+ }
+ pr_debug("\n");
+}
+EXPORT_SYMBOL(hisi_ahci_reg_dump);
+
+void hisi_ahci_rx_fis_dump(struct ata_link *link, int pmp_port_num)
+{
+ struct ahci_port_priv *pp = NULL;
+
+ pp = link->ap->private_data;
+ if (NULL == pp) {
+ pr_debug("Error: pp=NULL\n");
+ return;
+ }
+ pr_debug("ACHI Received FIS:");
+ hisi_sata_phys_mem_dump((unsigned int)(pp->rx_fis_dma),
+ AHCI_RX_FIS_SZ * pmp_port_num);
+ pr_debug("\n");
+}
+EXPORT_SYMBOL_GPL(hisi_ahci_rx_fis_dump);
+
+void hisi_ata_taskfile_dump(struct ata_taskfile *tf)
+{
+ if (NULL == tf) {
+ pr_debug("Error: tf=NULL\n");
+ return;
+ }
+
+ pr_debug("Taskfile dump:\n");
+ pr_debug("flags:0x%08lX, protocol:0x%02X, command:0x%02X, device:0x%02X, ctl:0x%02X\n",
+ tf->flags, tf->protocol, tf->command, tf->device, tf->ctl);
+ pr_debug("feature:0x%08X, nsect:0x%02X, lbal:0x%02X, lbam:0x%02X, lbah:0x%02X\n",
+ tf->feature, tf->nsect, tf->lbal, tf->lbam, tf->lbah);
+ pr_debug("hob_feature:0x%08X, hob_nsect:0x%02X, hob_lbal:0x%02X, hob_lbam:0x%02X, hob_lbah:0x%02X\n",
+ tf->hob_feature, tf->hob_nsect, tf->hob_lbal,
+ tf->hob_lbam, tf->hob_lbah);
+}
+EXPORT_SYMBOL_GPL(hisi_ata_taskfile_dump);
+
+static void __hisi_ahci_st_md(void __iomem *addr)
+{
+ unsigned int *addr_v;
+ unsigned int *tmp;
+ unsigned int i;
+
+ addr_v = (unsigned int *)addr;
+
+ pr_debug("\n\n");
+ for (i = 0; i < 16; i++) {
+ tmp = addr_v + i * 4;
+ pr_debug("%8x: %8x %8x %8x %8x\n",
+ (unsigned int)(addr + i * 16),
+ *tmp, *(tmp + 1), *(tmp + 2), *(tmp + 3));
+ }
+
+ pr_debug("\n");
+}
+
+void hisi_ahci_st_dump(void __iomem *port_base)
+{
+ unsigned int tmp;
+
+ pr_debug("\n**********Dmac status**********\n");
+ tmp = readl(port_base + 0x58);
+ pr_debug("txdmac_curr_st:0x%2x\n", (tmp>>24) & 0xf);
+ tmp = readl(port_base + 0x64);
+ pr_debug("rxdmac_curr_st:0x%2x\n", (tmp>>24) & 0xf);
+ tmp = readl(port_base + 0x70);
+ pr_debug("dmac tx fifo:count-0x%x-empty-%x-ful-%x\n",
+ (tmp>>0) & 0xff,
+ (tmp>>16) & 0x1, (tmp>>17) & 0x1);
+ pr_debug("dmac rx fifo:count-0x%x-empty-%x-ful-%x\n",
+ (tmp>>8) & 0xff,
+ (tmp>>18) & 0x1, (tmp>>19) & 0x1);
+
+ pr_debug("\n");
+ pr_debug("**********HBA status**********\n");
+ tmp = readl(port_base + 0x50);
+ pr_debug("pxxx_curr_st:0x%2x ndrx_curr_st:0x%2x\n",
+ (tmp>>24) & 0xf,
+ (tmp>>16) & 0xff);
+ pr_debug("cfis_curr_st:0x%2x piox_curr_st:0x%2x\n",
+ (tmp>>12) & 0xf,
+ (tmp>>8) & 0xf);
+ pr_debug("pmxx_curr_st:0x%2x errx_curr_st:0x%2x\n",
+ (tmp>>4) & 0xf,
+ (tmp>>0) & 0xf);
+
+ pr_debug("\n");
+ pr_debug("**********Link status**********\n");
+ tmp = readl(port_base + 0x54);
+ pr_debug("link_curr_st:0x%2x\n", (tmp>>24) & 0x1f);
+ pr_debug("link tx fifo:count-0x%x-empty-%x-ful-%x\n",
+ (tmp>>0) & 0x1f,
+ (tmp>>5) & 0x1, (tmp>>6) & 0x1);
+ pr_debug("link rx fifo:count-0x%x-empty-%x-ful-%x\n",
+ (tmp>>8) & 0x1f,
+ (tmp>>13) & 0x1, (tmp>>14) & 0x1);
+ pr_debug("link df fifo:count-0x%x-empty-%x-ful-%x\n\n",
+ (tmp>>16) & 0x1f,
+ (tmp>>21) & 0x1, (tmp>>22) & 0x1);
+
+ pr_debug("**********CMD header**********\n");
+ tmp = readl(port_base + 0x0);
+ __hisi_ahci_st_md(phys_to_virt(tmp));
+ __hisi_ahci_st_md(phys_to_virt(tmp+0x100));
+ __hisi_ahci_st_md(phys_to_virt(tmp+0x200));
+ __hisi_ahci_st_md(phys_to_virt(tmp+0x300));
+}
+EXPORT_SYMBOL_GPL(hisi_ahci_st_dump);
+
diff --git a/drivers/ata/hisi_sata_dbg.h b/drivers/ata/hisi_sata_dbg.h
new file mode 100644
index 0000000..27b14fe
--- /dev/null
+++ b/drivers/ata/hisi_sata_dbg.h
@@ -0,0 +1,47 @@
+
+#ifndef _HISI_SATA_DBG_H
+#define _HISI_SATA_DBG_H
+#include
+#include
+#include
+#include "ahci.h"
+
+
+void hisi_sata_mem_dump(unsigned int *addr, unsigned int size);
+void hisi_sata_phys_mem_dump(unsigned int addr, unsigned int size);
+void hisi_ahci_rx_fis_dump(struct ata_link *link, int pmp_port_num);
+void hisi_ata_taskfile_dump(struct ata_taskfile *tf);
+void hisi_ahci_st_dump(void __iomem *port_base);
+void hisi_ahci_reg_dump(void);
+
+#define HISI_AHCI_REG_DUMP(X) \
+do {\
+ pr_debug("------------------[ Start ]--------------------\n"); \
+ pr_debug("Dump AHCI registers at %s %d\n", __func__, __LINE__); \
+ hisi_ahci_reg_dump(); \
+ pr_debug("------------------[ End ]--------------------\n");\
+} while (0)
+
+#define hisi_sata_readl(addr) do {\
+ unsigned int reg = readl((unsigned int)addr); \
+ pr_debug("HI_AHCI(REG) %s:%d: readl(0x%08X) = 0x%08X\n",\
+ __func__, __LINE__, (unsigned int)addr, reg); \
+ reg;\
+ } while (0)
+
+#define hisi_sata_writel(v, addr) do { writel(v, (unsigned int)addr); \
+ pr_debug("HI_AHCI(REG) %s:%d: writel(0x%08X) = 0x%08X\n",\
+ __func__, __LINE__, (unsigned int)addr, \
+ (unsigned int)(v)); \
+ } while (0)
+
+#undef HISI_DUMP_AHCI_REG_OPS
+#ifdef HISI_DUMP_AHCI_REG_OPS
+#define readl(addr) hisi_sata_readl(addr)
+#define write(v, addr) hisi_sata_writel(v, addr)
+#endif
+
+#endif /* _HISI_SATA_DBG_H */
+
+
+
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index 0d028ea..4d1e0f8 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -57,6 +57,30 @@ MODULE_PARM_DESC(skip_host_reset, "skip global host reset (0=don't skip, 1=skip)
module_param_named(ignore_sss, ahci_ignore_sss, int, 0444);
MODULE_PARM_DESC(ignore_sss, "Ignore staggered spinup flag (0=don't ignore, 1=ignore)");
+#ifdef CONFIG_HISI_SATA_FBS
+static int fbs_en = CONFIG_HISI_SATA_FBS;
+module_param(fbs_en, uint, 0600);
+MODULE_PARM_DESC(fbs_en, "ahci fbs flags (default:1)");
+
+#define AHCI_TIMEOUT_COUNT 10
+#define AHCI_POLL_TIMER (20 * HZ)
+
+struct ata_fbs_ctrl {
+ unsigned int fbs_enable_ctrl; /* fbs enable or disable control switch */
+ unsigned int fbs_mode_ctrl; /* 1.5G: fbs disable, 3G/6G: fbs enable */
+ unsigned int fbs_enable_flag;
+ unsigned int fbs_disable_flag;
+ unsigned int fbs_cmd_issue_flag;
+ struct timer_list poll_timer;
+};
+static struct ata_fbs_ctrl fbs_ctrl[4];
+extern void hisi_sata_set_fifoth(void *mmio);
+#endif
+#ifdef CONFIG_ARCH_HI3536DV100
+extern void hisi_sata_reset_rxtx_assert(void);
+extern void hisi_sata_reset_rxtx_deassert(void);
+#endif
+
static int ahci_set_lpm(struct ata_link *link, enum ata_lpm_policy policy,
unsigned hints);
static ssize_t ahci_led_show(struct ata_port *ap, char *buf);
@@ -503,6 +527,13 @@ void ahci_save_initial_config(struct device *dev, struct ahci_host_priv *hpriv)
cap &= ~HOST_CAP_FBS;
}
+#ifdef CONFIG_HISI_SATA
+ if ((cap & HOST_CAP_SXS) && (hpriv->flags & AHCI_HFLAG_NO_SXS)) {
+ dev_info(dev, "controller can't support eSATA, turning off CAP_SXS\n");
+ cap &= ~HOST_CAP_SXS;
+ }
+#endif
+
if (hpriv->force_port_map && port_map != hpriv->force_port_map) {
dev_info(dev, "forcing port_map 0x%x -> 0x%x\n",
port_map, hpriv->force_port_map);
@@ -1380,8 +1411,28 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,
bool fbs_disabled = false;
int rc;
+#ifdef CONFIG_HISI_SATA_FBS
+ unsigned int port_num = ap->port_no;
+#endif
+
DPRINTK("ENTER\n");
+#ifdef CONFIG_HISI_SATA_FBS
+ if (fbs_ctrl[port_num].fbs_enable_ctrl &&
+ (link->pmp == SATA_PMP_CTRL_PORT) &&
+ (hpriv->type == ORI_AHCI)) {
+ struct ahci_port_priv *pp = ap->private_data;
+
+ if (pp->fbs_enabled == false)
+ ahci_enable_fbs(ap);
+
+ fbs_ctrl[port_num].fbs_enable_flag = 0;
+ fbs_ctrl[port_num].fbs_disable_flag = 0;
+ fbs_ctrl[port_num].fbs_cmd_issue_flag = 0;
+
+ }
+#endif
+
/* prepare for SRST (AHCI-1.1 10.4.1) */
rc = ahci_kick_engine(ap);
if (rc && rc != -EOPNOTSUPP)
@@ -1410,6 +1461,10 @@ int ahci_do_softreset(struct ata_link *link, unsigned int *class,
AHCI_CMD_RESET | AHCI_CMD_CLR_BUSY, msecs)) {
rc = -EIO;
reason = "1st FIS failed";
+#ifdef CONFIG_ARCH_HI3536DV100
+ hisi_sata_reset_rxtx_assert();
+ hisi_sata_reset_rxtx_deassert();
+#endif
goto fail;
}
@@ -1599,6 +1654,68 @@ static int ahci_pmp_qc_defer(struct ata_queued_cmd *qc)
struct ata_port *ap = qc->ap;
struct ahci_port_priv *pp = ap->private_data;
+#ifdef CONFIG_HISI_SATA_FBS
+ struct ahci_host_priv *hpriv = ap->host->private_data;
+ int is_atapi = ata_is_atapi(qc->tf.protocol);
+ void __iomem *port_mmio = ahci_port_base(ap);
+ unsigned int port_num = ap->port_no;
+ unsigned int cmd_timeout_count;
+
+ if (fbs_ctrl[port_num].fbs_enable_ctrl &&
+ (ap->link.pmp == SATA_PMP_CTRL_PORT) &&
+ (hpriv->type == ORI_AHCI)) {
+ if (is_atapi || fbs_ctrl[ap->port_no].fbs_cmd_issue_flag) {
+ mod_timer(&fbs_ctrl[port_num].poll_timer,
+ jiffies + AHCI_POLL_TIMER);
+
+ if (!fbs_ctrl[port_num].fbs_disable_flag) {
+ cmd_timeout_count = 0;
+ while (readl(port_mmio + PORT_SCR_ACT)
+ || readl(port_mmio
+ + PORT_CMD_ISSUE)
+ || readl(port_mmio
+ + PORT_IRQ_STAT)) {
+ cmd_timeout_count++;
+ if (cmd_timeout_count >=
+ AHCI_TIMEOUT_COUNT) {
+ fbs_ctrl[ap->port_no].
+ fbs_cmd_issue_flag = 1;
+ return ATA_DEFER_LINK;
+ }
+ }
+
+ if (pp->fbs_enabled == true)
+ ahci_disable_fbs(ap);
+
+ ap->excl_link = NULL;
+ ap->nr_active_links = 0;
+ fbs_ctrl[port_num].fbs_disable_flag = 1;
+ fbs_ctrl[port_num].fbs_enable_flag = 0;
+ fbs_ctrl[ap->port_no].fbs_cmd_issue_flag = 0;
+ }
+ } else {
+ if (fbs_ctrl[port_num].fbs_enable_flag) {
+ cmd_timeout_count = 0;
+ while (readl(port_mmio + PORT_SCR_ACT)
+ || readl(port_mmio
+ + PORT_CMD_ISSUE)
+ || readl(port_mmio
+ + PORT_IRQ_STAT)) {
+ cmd_timeout_count++;
+ if (cmd_timeout_count >=
+ AHCI_TIMEOUT_COUNT) {
+ return ATA_DEFER_LINK;
+ }
+ }
+
+ if (pp->fbs_enabled == false)
+ ahci_enable_fbs(ap);
+ fbs_ctrl[port_num].fbs_enable_flag = 0;
+ fbs_ctrl[port_num].fbs_disable_flag = 0;
+ }
+ }
+ }
+#endif
if (!sata_pmp_attached(ap) || pp->fbs_enabled)
return ata_std_qc_defer(qc);
else
@@ -1643,6 +1760,7 @@ static void ahci_qc_prep(struct ata_queued_cmd *qc)
ahci_fill_cmd_slot(pp, qc->tag, opts);
}
+#ifndef CONFIG_HISI_SATA_FBS
static void ahci_fbs_dec_intr(struct ata_port *ap)
{
struct ahci_port_priv *pp = ap->private_data;
@@ -1666,6 +1784,7 @@ static void ahci_fbs_dec_intr(struct ata_port *ap)
if (fbs & PORT_FBS_DEC)
dev_err(ap->host->dev, "failed to clear device error\n");
}
+#endif
static void ahci_error_intr(struct ata_port *ap, u32 irq_stat)
{
@@ -1773,7 +1892,9 @@ static void ahci_error_intr(struct ata_port *ap, u32 irq_stat)
ata_port_freeze(ap);
else if (fbs_need_dec) {
ata_link_abort(link);
+#ifndef CONFIG_HISI_SATA_FBS
ahci_fbs_dec_intr(ap);
+#endif
} else
ata_port_abort(ap);
}
@@ -2170,7 +2291,9 @@ static void ahci_enable_fbs(struct ata_port *ap)
writel(fbs | PORT_FBS_EN, port_mmio + PORT_FBS);
fbs = readl(port_mmio + PORT_FBS);
if (fbs & PORT_FBS_EN) {
+#ifndef CONFIG_HISI_SATA_FBS
dev_info(ap->host->dev, "FBS is enabled\n");
+#endif
pp->fbs_enabled = true;
pp->fbs_last_dev = -1; /* initialization */
} else
@@ -2210,6 +2333,9 @@ static void ahci_disable_fbs(struct ata_port *ap)
}
hpriv->start_engine(ap);
+#ifdef CONFIG_HISI_SATA_FBS
+ hisi_sata_set_fifoth(port_mmio);
+#endif
}
static void ahci_pmp_attach(struct ata_port *ap)
@@ -2218,12 +2344,24 @@ static void ahci_pmp_attach(struct ata_port *ap)
struct ahci_port_priv *pp = ap->private_data;
u32 cmd;
+#ifdef CONFIG_HISI_SATA_FBS
+ struct ahci_host_priv *hpriv = ap->host->private_data;
+ unsigned int port_num = ap->port_no;
+#endif
+
cmd = readl(port_mmio + PORT_CMD);
cmd |= PORT_CMD_PMP;
writel(cmd, port_mmio + PORT_CMD);
ahci_enable_fbs(ap);
+#ifdef CONFIG_HISI_SATA_FBS
+ if (hpriv->type == ORI_AHCI) {
+ if (!fbs_ctrl[port_num].fbs_enable_ctrl)
+ ahci_disable_fbs(ap);
+ }
+#endif
+
pp->intr_mask |= PORT_IRQ_BAD_PMP;
/*
@@ -2292,6 +2430,19 @@ static int ahci_port_suspend(struct ata_port *ap, pm_message_t mesg)
}
#endif
+#ifdef CONFIG_HISI_SATA_FBS
+static void ahci_poll_func(unsigned long arg)
+{
+ struct ata_port *ap = (struct ata_port *)arg;
+ unsigned int port_num = ap->port_no;
+
+ if (ap->link.pmp == SATA_PMP_CTRL_PORT) {
+ fbs_ctrl[port_num].fbs_enable_flag = 1;
+ fbs_ctrl[port_num].fbs_disable_flag = 0;
+ }
+}
+#endif
+
static int ahci_port_start(struct ata_port *ap)
{
struct ahci_host_priv *hpriv = ap->host->private_data;
@@ -2385,6 +2536,20 @@ static int ahci_port_start(struct ata_port *ap)
ap->private_data = pp;
+#ifdef CONFIG_HISI_SATA_FBS
+ if (hpriv->type == ORI_AHCI) {
+ fbs_ctrl[ap->port_no].fbs_enable_ctrl = fbs_en;
+ fbs_ctrl[ap->port_no].fbs_enable_flag = 0;
+ fbs_ctrl[ap->port_no].fbs_disable_flag = 0;
+ fbs_ctrl[ap->port_no].fbs_cmd_issue_flag = 0;
+
+ init_timer(&fbs_ctrl[ap->port_no].poll_timer);
+ fbs_ctrl[ap->port_no].poll_timer.function = ahci_poll_func;
+ fbs_ctrl[ap->port_no].poll_timer.data = (unsigned long)ap;
+ fbs_ctrl[ap->port_no].poll_timer.expires = jiffies + AHCI_POLL_TIMER;
+ }
+#endif
+
/* engage engines, captain */
return ahci_port_resume(ap);
}
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 08d1dd5..c378812 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1744,7 +1744,7 @@ urandom_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos)
if (!crng_ready() && maxwarn > 0) {
maxwarn--;
- printk(KERN_NOTICE "random: %s: uninitialized urandom read "
+ printk_once(KERN_NOTICE "random: %s: uninitialized urandom read "
"(%zd bytes read)\n",
current->comm, nbytes);
spin_lock_irqsave(&primary_crng.lock, flags);
diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile
index 42042c0..0a0c6d9 100644
--- a/drivers/clk/Makefile
+++ b/drivers/clk/Makefile
@@ -57,6 +57,7 @@ obj-y += bcm/
obj-$(CONFIG_ARCH_BERLIN) += berlin/
obj-$(CONFIG_H8300) += h8300/
obj-$(CONFIG_ARCH_HISI) += hisilicon/
+obj-$(CONFIG_ARCH_HISI_BVT) += hisilicon/
obj-$(CONFIG_ARCH_MXC) += imx/
obj-$(CONFIG_MACH_INGENIC) += ingenic/
obj-$(CONFIG_COMMON_CLK_KEYSTONE) += keystone/
diff --git a/drivers/clk/hisilicon/Kconfig b/drivers/clk/hisilicon/Kconfig
index 3f537a0..f331da5 100644
--- a/drivers/clk/hisilicon/Kconfig
+++ b/drivers/clk/hisilicon/Kconfig
@@ -6,6 +6,22 @@ config COMMON_CLK_HI3519
help
Build the clock driver for hi3519.
+config COMMON_CLK_HI3516A
+ tristate "Hi3516A Clock Driver"
+ depends on ARCH_HI3516A || COMPILE_TEST
+ select RESET_HISI
+ default ARCH_HISI
+ help
+ Build the clock driver for hi3516A.
+
+config COMMON_CLK_HI3536DV100
+ tristate "Hi3536DV100 Clock Driver"
+ depends on ARCH_HI3536DV100 || COMPILE_TEST
+ select RESET_HISI
+ default ARCH_HISI
+ help
+ Build the clock driver for hi3536DV100.
+
config COMMON_CLK_HI6220
bool "Hi6220 Clock Driver"
depends on ARCH_HISI || COMPILE_TEST
@@ -15,7 +31,7 @@ config COMMON_CLK_HI6220
config RESET_HISI
bool "HiSilicon Reset Controller Driver"
- depends on ARCH_HISI || COMPILE_TEST
+ depends on ARCH_HISI || COMPILE_TEST || ARCH_HISI_BVT
select RESET_CONTROLLER
help
Build reset controller driver for HiSilicon device chipsets.
diff --git a/drivers/clk/hisilicon/Makefile b/drivers/clk/hisilicon/Makefile
index e169ec7..6eefb3d 100644
--- a/drivers/clk/hisilicon/Makefile
+++ b/drivers/clk/hisilicon/Makefile
@@ -8,6 +8,8 @@ obj-$(CONFIG_ARCH_HI3xxx) += clk-hi3620.o
obj-$(CONFIG_ARCH_HIP04) += clk-hip04.o
obj-$(CONFIG_ARCH_HIX5HD2) += clk-hix5hd2.o
obj-$(CONFIG_COMMON_CLK_HI3519) += clk-hi3519.o
+obj-$(CONFIG_COMMON_CLK_HI3516A) += clk-hi3516a.o
+obj-$(CONFIG_COMMON_CLK_HI3536DV100) += clk-hi3536dv100.o
obj-$(CONFIG_COMMON_CLK_HI6220) += clk-hi6220.o
obj-$(CONFIG_RESET_HISI) += reset.o
obj-$(CONFIG_STUB_CLK_HI6220) += clk-hi6220-stub.o
diff --git a/drivers/clk/hisilicon/clk-hi3516a.c b/drivers/clk/hisilicon/clk-hi3516a.c
new file mode 100644
index 0000000..d007d13
--- /dev/null
+++ b/drivers/clk/hisilicon/clk-hi3516a.c
@@ -0,0 +1,491 @@
+/*
+ * Hi3516A Clock Driver
+ *
+ * Copyright (c) 2016-2017 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "clk.h"
+#include "crg.h"
+#include "reset.h"
+
+struct hi3516a_pll_clock {
+ u32 id;
+ const char *name;
+ const char *parent_name;
+ u32 ctrl_reg1;
+ u8 frac_shift;
+ u8 frac_width;
+ u8 postdiv1_shift;
+ u8 postdiv1_width;
+ u8 postdiv2_shift;
+ u8 postdiv2_width;
+ u32 ctrl_reg2;
+ u8 fbdiv_shift;
+ u8 fbdiv_width;
+ u8 refdiv_shift;
+ u8 refdiv_width;
+};
+
+struct hi3516a_clk_pll {
+ struct clk_hw hw;
+ u32 id;
+ void __iomem *ctrl_reg1;
+ u8 frac_shift;
+ u8 frac_width;
+ u8 postdiv1_shift;
+ u8 postdiv1_width;
+ u8 postdiv2_shift;
+ u8 postdiv2_width;
+ void __iomem *ctrl_reg2;
+ u8 fbdiv_shift;
+ u8 fbdiv_width;
+ u8 refdiv_shift;
+ u8 refdiv_width;
+};
+
+static const struct
+hisi_fixed_rate_clock hi3516a_fixed_rate_clks_crg[] = {
+ { HI3516A_FIXED_3M, "3m", NULL, 0, 3000000, },
+ { HI3516A_FIXED_6M, "6m", NULL, 0, 6000000, },
+ { HI3516A_FIXED_13P5M, "13.5m", NULL, 0, 13500000, },
+ { HI3516A_FIXED_24M, "24m", NULL, 0, 24000000, },
+ { HI3516A_FIXED_25M, "25m", NULL, 0, 25000000, },
+ { HI3516A_FIXED_27M, "27m", NULL, 0, 27000000, },
+ { HI3516A_FIXED_37P125M, "37.125m", NULL, 0, 37125000, },
+ { HI3516A_FIXED_50M, "50m", NULL, 0, 50000000, },
+ { HI3516A_FIXED_74P25M, "74.25m", NULL, 0, 74250000, },
+ { HI3516A_FIXED_75M, "75m", NULL, 0, 75000000, },
+ { HI3516A_FIXED_99M, "99m", NULL, 0, 99000000, },
+ { HI3516A_FIXED_100M, "100m", NULL, 0, 100000000, },
+ { HI3516A_FIXED_125M, "125m", NULL, 0, 125000000, },
+ { HI3516A_FIXED_145M, "145m", NULL, 0, 145000000, },
+ { HI3516A_FIXED_148P5M, "148.5m", NULL, 0, 148500000, },
+ { HI3516A_FIXED_150M, "150m", NULL, 0, 150000000, },
+ { HI3516A_FIXED_194M, "194m", NULL, 0, 194000000, },
+ { HI3516A_FIXED_198M, "198m", NULL, 0, 198000000, },
+ { HI3516A_FIXED_200M, "200m", NULL, 0, 200000000, },
+ { HI3516A_FIXED_229M, "229m", NULL, 0, 229000000, },
+ { HI3516A_FIXED_237M, "237m", NULL, 0, 237000000, },
+ { HI3516A_FIXED_242M, "242m", NULL, 0, 242000000, },
+ { HI3516A_FIXED_250M, "250m", NULL, 0, 250000000, },
+ { HI3516A_FIXED_297M, "297m", NULL, 0, 297000000, },
+ { HI3516A_FIXED_300M, "300m", NULL, 0, 300000000, },
+ { HI3516A_FIXED_333M, "333m", NULL, 0, 333000000, },
+ { HI3516A_FIXED_400M, "400m", NULL, 0, 400000000, },
+ { HI3516A_FIXED_500M, "500m", NULL, 0, 500000000, },
+ { HI3516A_FIXED_594M, "594m", NULL, 0, 594000000, },
+ { HI3516A_FIXED_600M, "600m", NULL, 0, 600000000, },
+ { HI3516A_FIXED_726P25M, "725.25m", NULL, 0, 726250000, },
+ { HI3516A_FIXED_750M, "750m", NULL, 0, 750000000, },
+ { HI3516A_FIXED_900M, "900m", NULL, 0, 900000000, },
+ { HI3516A_FIXED_1000M, "1000m", NULL, 0, 1000000000UL, },
+ { HI3516A_FIXED_1188M, "1188m", NULL, 0, 1188000000UL, },
+};
+
+static const char *const sysaxi_mux_p[] = {"198m", "148.5m"};
+static const char *const uart_mux_p[] = {"clk_sysapb", "6m"};
+static const char *const snor_mux_p[] = {"24m", "75m", "125m"};
+static const char *const snand_mux_p[] = {"24m", "75m", "125m"};
+static const char *const nand_mux_p[] = {"24m", "198m"};
+static const char *const eth_phy_mux_p[] = {"50m", "25m"};
+static const char *const a7_mux_p[] = {"400m", "500m", "apll"};
+static const char *const mmc_mux_p[] = {"50m", "100m", "25m", "75m"};
+
+static u32 sysaxi_mux_table[] = {0, 1};
+static u32 uart_mux_table[] = {0, 1};
+static u32 snor_mux_table[] = {0, 1, 2};
+static u32 snand_mux_table[] = {0, 1, 2};
+static u32 nand_mux_table[] = {0, 1};
+static u32 eth_phy_mux_table[] = {0, 1};
+static u32 a7_mux_table[] = {2, 1, 0};
+static u32 mmc_mux_table[] = {0, 1, 2, 3};
+
+static const struct hisi_mux_clock hi3516a_mux_clks_crg[] = {
+ { HI3516A_SYSAXI_CLK, "sysaxi_mux", sysaxi_mux_p,
+ ARRAY_SIZE(sysaxi_mux_p),
+ CLK_SET_RATE_PARENT, 0x30, 3, 1, 0, sysaxi_mux_table, },
+ { HI3516A_SNOR_MUX, "snor_mux", snor_mux_p, ARRAY_SIZE(snor_mux_p),
+ CLK_SET_RATE_PARENT, 0xc0, 2, 2, 0, snor_mux_table, },
+ { HI3516A_SNAND_MUX, "snand_mux", snand_mux_p, ARRAY_SIZE(snand_mux_p),
+ CLK_SET_RATE_PARENT, 0xc0, 6, 2, 0, snand_mux_table, },
+ { HI3516A_NAND_MUX, "nand_mux", nand_mux_p, ARRAY_SIZE(nand_mux_p),
+ CLK_SET_RATE_PARENT, 0xd0, 2, 1, 0, nand_mux_table, },
+ { HI3516A_MMC0_MUX, "mmc0_mux", mmc_mux_p, ARRAY_SIZE(mmc_mux_p),
+ CLK_SET_RATE_PARENT, 0xc4, 2, 2, 0, mmc_mux_table, },
+ { HI3516A_MMC1_MUX, "mmc1_mux", mmc_mux_p, ARRAY_SIZE(mmc_mux_p),
+ CLK_SET_RATE_PARENT, 0xc4, 10, 2, 0, mmc_mux_table, },
+ { HI3516A_UART_MUX, "uart_mux", uart_mux_p,
+ ARRAY_SIZE(uart_mux_p),
+ CLK_SET_RATE_PARENT, 0xe4, 19, 1, 0, uart_mux_table, },
+ { HI3516A_ETH_PHY_MUX, "eth_phy_mux", eth_phy_mux_p,
+ ARRAY_SIZE(eth_phy_mux_p), CLK_SET_RATE_PARENT,
+ 0xcc, 6, 1, 0, eth_phy_mux_table, },
+ { HI3516A_A7_MUX, "a7_mux", a7_mux_p, ARRAY_SIZE(a7_mux_p),
+ CLK_SET_RATE_PARENT, 0x30, 8, 2, 0, a7_mux_table, },
+};
+
+/* fixed factor clocks */
+static struct hisi_fixed_factor_clock
+ hi3516a_fixed_factor_clks[] = {
+ { HI3516A_SYSAXI_CLK, "clk_sysapb", "sysaxi_mux", 1, 4,
+ CLK_SET_RATE_PARENT, },
+};
+
+static const struct hisi_gate_clock hi3516a_gate_clks[] = {
+ /* spi nor */
+ { HI3516A_SNOR_CLK, "clk_snor", "snor_mux",
+ CLK_SET_RATE_PARENT, 0xc0, 1, 0, },
+ /* spi nand */
+ { HI3516A_SNAND_CLK, "clk_snand", "snand_mux",
+ CLK_SET_RATE_PARENT, 0xc0, 5, 0, },
+ /* nand */
+ { HI3516A_NAND_CLK, "clk_nand", "nand_mux",
+ CLK_SET_RATE_PARENT, 0xd8, 1, 0, },
+ /* mmc */
+ { HI3516A_MMC0_CLK, "clk_mmc0", "mmc0_mux",
+ CLK_SET_RATE_PARENT, 0xc4, 1, 0, },
+ { HI3516A_MMC1_CLK, "clk_mmc1", "mmc1_mux",
+ CLK_SET_RATE_PARENT, 0xc4, 9, 0, },
+
+ /* usb ctrl */
+ { HI3516A_USB2_CTRL_UTMI0_REQ, "usb2_cttl_utmi0_req", NULL,
+ CLK_SET_RATE_PARENT, 0xb4, 5, 1, },
+ { HI3516A_USB2_HRST_REQ, "usb2_hrst_req", NULL,
+ CLK_SET_RATE_PARENT, 0xb4, 0, 1, },
+
+ /* uart */
+ { HI3516A_UART0_CLK, "clk_uart0", "50m",
+ CLK_SET_RATE_PARENT, 0xe4, 15, 0, },
+ { HI3516A_UART1_CLK, "clk_uart1", "50m",
+ CLK_SET_RATE_PARENT, 0xe4, 16, 0, },
+ { HI3516A_UART2_CLK, "clk_uart2", "50m",
+ CLK_SET_RATE_PARENT, 0xe4, 17, 0, },
+ { HI3516A_UART3_CLK, "clk_uart3", "50m",
+ CLK_SET_RATE_PARENT, 0xe4, 18, 0, },
+ /* ethernet mac */
+ { HI3516A_ETH_CLK, "clk_eth", NULL,
+ CLK_SET_RATE_PARENT, 0xcc, 1, 0, },
+ { HI3516A_ETH_MACIF_CLK, "clk_eth_macif", NULL,
+ CLK_SET_RATE_PARENT, 0xcc, 3, 0, },
+ /* spi */
+ { HI3516A_SPI0_CLK, "clk_spi0", "clk_sysapb",
+ CLK_SET_RATE_PARENT, 0xe4, 13, 0, },
+ { HI3516A_SPI1_CLK, "clk_spi1", "clk_sysapb",
+ CLK_SET_RATE_PARENT, 0xe4, 14, 0, },
+};
+
+static struct hi3516a_pll_clock hi3516a_pll_clks[] __initdata = {
+ { HI3516A_APLL_CLK, "apll", NULL, 0x0, 0, 24, 24, 3, 28, 3,
+ 0x4, 0, 12, 12, 6},
+};
+
+#define to_pll_clk(_hw) container_of(_hw, struct hi3516a_clk_pll, hw)
+
+static void hi3516a_calc_pll(u32 *frac_val, u32 *postdiv1_val, u32 *postdiv2_val,
+ u32 *fbdiv_val, u32 *refdiv_val, u64 rate)
+{
+ u64 rem;
+ *frac_val = 0;
+ rem = do_div(rate, 1000000);
+ *fbdiv_val = rate;
+ *refdiv_val = 24;
+ rem = rem * (1 << 24);
+ do_div(rem, 1000000);
+ *frac_val = rem;
+}
+
+static int clk_pll_set_rate(struct clk_hw *hw,
+ unsigned long rate,
+ unsigned long parent_rate)
+{
+ struct hi3516a_clk_pll *clk = to_pll_clk(hw);
+ u32 frac_val, postdiv1_val, postdiv2_val, fbdiv_val, refdiv_val;
+ u32 val;
+
+ /*Fixme ignore postdives now because apll don't use them*/
+ postdiv1_val = postdiv2_val = 0;
+
+ hi3516a_calc_pll(&frac_val, &postdiv1_val, &postdiv2_val,
+ &fbdiv_val, &refdiv_val, (u64)rate);
+
+ val = readl_relaxed(clk->ctrl_reg1);
+ val &= ~(((1 << clk->frac_width) - 1) << clk->frac_shift);
+ val &= ~(((1 << clk->postdiv1_width) - 1) << clk->postdiv1_shift);
+ val &= ~(((1 << clk->postdiv2_width) - 1) << clk->postdiv2_shift);
+
+ val |= frac_val << clk->frac_shift;
+ val |= postdiv1_val << clk->postdiv1_shift;
+ val |= postdiv2_val << clk->postdiv2_shift;
+ writel_relaxed(val, clk->ctrl_reg1);
+
+ val = readl_relaxed(clk->ctrl_reg2);
+ val &= ~(((1 << clk->fbdiv_width) - 1) << clk->fbdiv_shift);
+ val &= ~(((1 << clk->refdiv_width) - 1) << clk->refdiv_shift);
+
+ val |= fbdiv_val << clk->fbdiv_shift;
+ val |= refdiv_val << clk->refdiv_shift;
+ writel_relaxed(val, clk->ctrl_reg2);
+
+ return 0;
+}
+
+static unsigned long clk_pll_recalc_rate(struct clk_hw *hw,
+ unsigned long parent_rate)
+{
+ struct hi3516a_clk_pll *clk = to_pll_clk(hw);
+ u64 frac_val, fbdiv_val, refdiv_val;
+ u32 val;
+ u64 tmp, rate;
+
+ val = readl_relaxed(clk->ctrl_reg1);
+ val = val >> clk->frac_shift;
+ val &= ((1 << clk->frac_width) - 1);
+ frac_val = val;
+
+ val = readl_relaxed(clk->ctrl_reg2);
+ val = val >> clk->fbdiv_shift;
+ val &= ((1 << clk->fbdiv_width) - 1);
+ fbdiv_val = val;
+
+ val = readl_relaxed(clk->ctrl_reg2);
+ val = val >> clk->refdiv_shift;
+ val &= ((1 << clk->refdiv_width) - 1) ;
+ refdiv_val = val;
+
+ /* rate = 24000000 * (fbdiv + frac / (1<<24) ) / refdiv */
+ rate = 0;
+ tmp = 24000000 * fbdiv_val;
+ rate += tmp;
+ do_div(rate, refdiv_val);
+
+ return rate;
+}
+
+static int clk_pll_determine_rate(struct clk_hw *hw,
+ struct clk_rate_request *req)
+{
+ return req->rate;
+}
+
+static struct clk_ops clk_pll_ops = {
+ .set_rate = clk_pll_set_rate,
+ .determine_rate = clk_pll_determine_rate,
+ .recalc_rate = clk_pll_recalc_rate,
+};
+
+void __init hi3516a_clk_register_pll(struct hi3516a_pll_clock *clks,
+ int nums, struct hisi_clock_data *data)
+{
+ void __iomem *base = data->base;
+ int i;
+
+ for (i = 0; i < nums; i++) {
+ struct hi3516a_clk_pll *p_clk;
+ struct clk *clk;
+ struct clk_init_data init;
+
+ p_clk = kzalloc(sizeof(*p_clk), GFP_KERNEL);
+ if (!p_clk)
+ return;
+
+ init.name = clks[i].name;
+ init.flags = CLK_IS_BASIC;
+ init.parent_names =
+ (clks[i].parent_name ? &clks[i].parent_name : NULL);
+ init.num_parents = (clks[i].parent_name ? 1 : 0);
+ init.ops = &clk_pll_ops;
+
+ p_clk->ctrl_reg1 = base + clks[i].ctrl_reg1;
+ p_clk->frac_shift = clks[i].frac_shift;
+ p_clk->frac_width = clks[i].frac_width;
+ p_clk->postdiv1_shift = clks[i].postdiv1_shift;
+ p_clk->postdiv1_width = clks[i].postdiv1_width;
+ p_clk->postdiv2_shift = clks[i].postdiv2_shift;
+ p_clk->postdiv2_width = clks[i].postdiv2_width;
+
+ p_clk->ctrl_reg2 = base + clks[i].ctrl_reg2;
+ p_clk->fbdiv_shift = clks[i].fbdiv_shift;
+ p_clk->fbdiv_width = clks[i].fbdiv_width;
+ p_clk->refdiv_shift = clks[i].refdiv_shift;
+ p_clk->refdiv_width = clks[i].refdiv_width;
+ p_clk->hw.init = &init;
+
+ clk = clk_register(NULL, &p_clk->hw);
+ if (IS_ERR(clk)) {
+ kfree(p_clk);
+ pr_err("%s: failed to register clock %s\n",
+ __func__, clks[i].name);
+ continue;
+ }
+
+ data->clk_data.clks[clks[i].id] = clk;
+ }
+
+
+}
+
+static struct hisi_clock_data *hi3516a_clk_register(
+ struct platform_device *pdev)
+{
+ struct hisi_clock_data *clk_data;
+ int ret;
+
+ clk_data = hisi_clk_alloc(pdev, HI3516A_CRG_NR_CLKS);
+ if (!clk_data)
+ return ERR_PTR(-ENOMEM);
+
+ ret = hisi_clk_register_fixed_rate(hi3516a_fixed_rate_clks_crg,
+ ARRAY_SIZE(hi3516a_fixed_rate_clks_crg), clk_data);
+ if (ret)
+ return ERR_PTR(ret);
+
+ hi3516a_clk_register_pll(hi3516a_pll_clks,
+ ARRAY_SIZE(hi3516a_pll_clks), clk_data);
+
+ ret = hisi_clk_register_mux(hi3516a_mux_clks_crg,
+ ARRAY_SIZE(hi3516a_mux_clks_crg), clk_data);
+ if (ret)
+ goto unregister_fixed_rate;
+
+ ret = hisi_clk_register_fixed_factor(hi3516a_fixed_factor_clks,
+ ARRAY_SIZE(hi3516a_fixed_factor_clks), clk_data);
+ if (ret)
+ goto unregister_mux;
+
+ ret = hisi_clk_register_gate(hi3516a_gate_clks,
+ ARRAY_SIZE(hi3516a_gate_clks), clk_data);
+ if (ret)
+ goto unregister_factor;
+
+ ret = of_clk_add_provider(pdev->dev.of_node,
+ of_clk_src_onecell_get, &clk_data->clk_data);
+ if (ret)
+ goto unregister_gate;
+
+ return clk_data;
+
+unregister_gate:
+ hisi_clk_unregister_gate(hi3516a_gate_clks,
+ ARRAY_SIZE(hi3516a_gate_clks), clk_data);
+unregister_factor:
+ hisi_clk_unregister_fixed_factor(hi3516a_fixed_factor_clks,
+ ARRAY_SIZE(hi3516a_fixed_factor_clks), clk_data);
+unregister_mux:
+ hisi_clk_unregister_mux(hi3516a_mux_clks_crg,
+ ARRAY_SIZE(hi3516a_mux_clks_crg), clk_data);
+unregister_fixed_rate:
+ hisi_clk_unregister_fixed_rate(hi3516a_fixed_rate_clks_crg,
+ ARRAY_SIZE(hi3516a_fixed_rate_clks_crg), clk_data);
+ return ERR_PTR(ret);
+}
+
+static void hi3516a_clk_unregister(struct platform_device *pdev)
+{
+ struct hisi_crg_dev *crg = platform_get_drvdata(pdev);
+
+ of_clk_del_provider(pdev->dev.of_node);
+
+ hisi_clk_unregister_gate(hi3516a_gate_clks,
+ ARRAY_SIZE(hi3516a_gate_clks), crg->clk_data);
+ hisi_clk_unregister_mux(hi3516a_mux_clks_crg,
+ ARRAY_SIZE(hi3516a_mux_clks_crg), crg->clk_data);
+ hisi_clk_unregister_fixed_factor(hi3516a_fixed_factor_clks,
+ ARRAY_SIZE(hi3516a_fixed_factor_clks), crg->clk_data);
+ hisi_clk_unregister_fixed_rate(hi3516a_fixed_rate_clks_crg,
+ ARRAY_SIZE(hi3516a_fixed_rate_clks_crg), crg->clk_data);
+}
+
+static const struct hisi_crg_funcs hi3516a_crg_funcs = {
+ .register_clks = hi3516a_clk_register,
+ .unregister_clks = hi3516a_clk_unregister,
+};
+
+
+static const struct of_device_id hi3516a_crg_match_table[] = {
+ {
+ .compatible = "hisilicon,hi3516a-clock",
+ .data = &hi3516a_crg_funcs
+ },
+ { }
+};
+MODULE_DEVICE_TABLE(of, hi3516a_crg_match_table);
+
+static int hi3516a_crg_probe(struct platform_device *pdev)
+{
+ struct hisi_crg_dev *crg;
+
+ crg = devm_kmalloc(&pdev->dev, sizeof(*crg), GFP_KERNEL);
+ if (!crg)
+ return -ENOMEM;
+
+ crg->funcs = of_device_get_match_data(&pdev->dev);
+ if (!crg->funcs)
+ return -ENOENT;
+
+ crg->rstc = hisi_reset_init(pdev);
+ if (!crg->rstc)
+ return -ENOMEM;
+
+ crg->clk_data = crg->funcs->register_clks(pdev);
+ if (IS_ERR(crg->clk_data)) {
+ hisi_reset_exit(crg->rstc);
+ return PTR_ERR(crg->clk_data);
+ }
+
+ platform_set_drvdata(pdev, crg);
+ return 0;
+}
+
+static int hi3516a_crg_remove(struct platform_device *pdev)
+{
+ struct hisi_crg_dev *crg = platform_get_drvdata(pdev);
+
+ hisi_reset_exit(crg->rstc);
+ crg->funcs->unregister_clks(pdev);
+ return 0;
+}
+
+static struct platform_driver hi3516a_crg_driver = {
+ .probe = hi3516a_crg_probe,
+ .remove = hi3516a_crg_remove,
+ .driver = {
+ .name = "hi3516a-clock",
+ .of_match_table = hi3516a_crg_match_table,
+ },
+};
+
+static int __init hi3516a_crg_init(void)
+{
+ return platform_driver_register(&hi3516a_crg_driver);
+}
+core_initcall(hi3516a_crg_init);
+
+static void __exit hi3516a_crg_exit(void)
+{
+ platform_driver_unregister(&hi3516a_crg_driver);
+}
+module_exit(hi3516a_crg_exit);
+
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("HiSilicon Hi3516A CRG Driver");
diff --git a/drivers/clk/hisilicon/clk-hi3536dv100.c b/drivers/clk/hisilicon/clk-hi3536dv100.c
new file mode 100644
index 0000000..19f35633
--- /dev/null
+++ b/drivers/clk/hisilicon/clk-hi3536dv100.c
@@ -0,0 +1,247 @@
+/*
+ * Hi3536DV100 Clock Driver
+ *
+ * Copyright (c) 2016-2017 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include "clk.h"
+#include "crg.h"
+#include "reset.h"
+
+static const struct
+hisi_fixed_rate_clock hi3536dv100_fixed_rate_clks_crg[] = {
+ { HI3536DV100_FIXED_3M, "3m", NULL, 0, 3000000, },
+ { HI3536DV100_FIXED_6M, "6m", NULL, 0, 6000000, },
+ { HI3536DV100_FIXED_12M, "12m", NULL, 0, 12000000, },
+ { HI3536DV100_FIXED_24M, "24m", NULL, 0, 24000000, },
+ { HI3536DV100_FIXED_50M, "50m", NULL, 0, 50000000, },
+ { HI3536DV100_FIXED_83P3M, "83.3m",NULL, 0, 83300000, },
+ { HI3536DV100_FIXED_100M, "100m", NULL, 0, 100000000, },
+ { HI3536DV100_FIXED_125M, "125m", NULL, 0, 125000000, },
+ { HI3536DV100_FIXED_150M, "150m", NULL, 0, 150000000, },
+ { HI3536DV100_FIXED_200M, "200m", NULL, 0, 200000000, },
+ { HI3536DV100_FIXED_250M, "250m", NULL, 0, 250000000, },
+ { HI3536DV100_FIXED_300M, "300m", NULL, 0, 300000000, },
+ { HI3536DV100_FIXED_324M, "324m", NULL, 0, 324000000, },
+ { HI3536DV100_FIXED_342M, "342m", NULL, 0, 342000000, },
+ { HI3536DV100_FIXED_342M, "375m", NULL, 0, 375000000, },
+ { HI3536DV100_FIXED_400M, "400m", NULL, 0, 400000000, },
+ { HI3536DV100_FIXED_448M, "448m", NULL, 0, 448000000, },
+ { HI3536DV100_FIXED_500M, "500m", NULL, 0, 500000000, },
+ { HI3536DV100_FIXED_540M, "540m", NULL, 0, 540000000, },
+ { HI3536DV100_FIXED_600M, "600m", NULL, 0, 600000000, },
+ { HI3536DV100_FIXED_750M, "750m", NULL, 0, 750000000, },
+ { HI3536DV100_FIXED_1500M, "1500m",NULL, 0, 1500000000UL, },
+};
+
+static const char *sysaxi_mux_p[] __initconst = {
+ "24m", "250m", "200m", "300m"};
+static const char *sysapb_mux_p[] __initconst = {"24m", "50m"};
+static const char *uart_mux_p[] __initconst = {"sysapb_mux", "24m", "2m"};
+static const char *fmc_mux_p[] __initconst = {"24m", "83.3m", "150m"};
+
+static u32 sysaxi_mux_table[] = {0, 1, 2, 3};
+static u32 sysapb_mux_table[] = {0, 1};
+static u32 uart_mux_table[] = {0, 1, 2};
+static u32 fmc_mux_table[] = {0, 1, 2};
+
+static struct hisi_mux_clock hi3536dv100_mux_clks_crg[] __initdata = {
+ { HI3536DV100_SYSAXI_CLK, "sysaxi_mux", sysaxi_mux_p,
+ ARRAY_SIZE(sysaxi_mux_p),
+ CLK_SET_RATE_PARENT, 0x50, 2, 2, 0, sysaxi_mux_table, },
+ { HI3536DV100_SYSAPB_CLK, "sysapb_mux", sysapb_mux_p,
+ ARRAY_SIZE(sysapb_mux_p),
+ CLK_SET_RATE_PARENT, 0x50, 0, 1, 0, sysapb_mux_table, },
+ { HI3536DV100_FMC_MUX, "fmc_mux", fmc_mux_p, ARRAY_SIZE(fmc_mux_p),
+ CLK_SET_RATE_PARENT, 0xc0, 2, 2, 0, fmc_mux_table, },
+ { HI3536DV100_UART_MUX, "uart_mux", uart_mux_p,
+ ARRAY_SIZE(uart_mux_p),
+ CLK_SET_RATE_PARENT, 0xcc, 18, 2, 0, uart_mux_table, },
+};
+
+static struct hisi_fixed_factor_clock
+ hi3536dv100_fixed_factor_clks[] __initdata = {
+ { HI3536DV100_SYSAXI_CLK, "clk_sysaxi", "sysaxi_mux", 1, 4,
+ CLK_SET_RATE_PARENT},
+};
+
+static struct hisi_gate_clock hi3536dv100_gate_clks[] __initdata = {
+ /* fmc */
+ { HI3536DV100_FMC_CLK, "clk_fmc", "fmc_mux",
+ CLK_SET_RATE_PARENT, 0xc0, 1, 0, },
+ /* uart */
+ { HI3536DV100_UART0_CLK, "clk_uart0", "24m",
+ CLK_SET_RATE_PARENT, 0xcc, 15, 0, },
+ { HI3536DV100_UART1_CLK, "clk_uart1", "24m",
+ CLK_SET_RATE_PARENT, 0xcc, 16, 0, },
+ { HI3536DV100_UART2_CLK, "clk_uart2", "24m",
+ CLK_SET_RATE_PARENT, 0xcc, 17, 0, },
+ /* ethernet mac */
+ { HI3536DV100_ETH0_CLK, "clk_eth0", NULL,
+ CLK_SET_RATE_PARENT, 0xc4, 1, 0, },
+ { HI3536DV100_ETH0_PHY_CLK, "clk_eth0_phy", NULL,
+ CLK_SET_RATE_PARENT, 0xc4, 10, 0, },
+ { HI3536DV100_DMAC_CLK, "clk_dmac", "50m",
+ CLK_SET_RATE_PARENT, 0xc8, 5, 0, },
+};
+
+static struct hisi_clock_data *hi3536dv100_clk_register(
+ struct platform_device *pdev)
+{
+ struct hisi_clock_data *clk_data;
+ int ret;
+
+ clk_data = hisi_clk_alloc(pdev, HI3536DV100_CRG_NR_CLKS);
+ if (!clk_data)
+ return ERR_PTR(-ENOMEM);
+
+ ret = hisi_clk_register_fixed_rate(hi3536dv100_fixed_rate_clks_crg,
+ ARRAY_SIZE(hi3536dv100_fixed_rate_clks_crg), clk_data);
+ if (ret)
+ return ERR_PTR(ret);
+
+ ret = hisi_clk_register_mux(hi3536dv100_mux_clks_crg,
+ ARRAY_SIZE(hi3536dv100_mux_clks_crg), clk_data);
+ if (ret)
+ goto unregister_fixed_rate;
+
+ ret = hisi_clk_register_fixed_factor(hi3536dv100_fixed_factor_clks,
+ ARRAY_SIZE(hi3536dv100_fixed_factor_clks), clk_data);
+ if (ret)
+ goto unregister_mux;
+
+ ret = hisi_clk_register_gate(hi3536dv100_gate_clks,
+ ARRAY_SIZE(hi3536dv100_gate_clks), clk_data);
+ if (ret)
+ goto unregister_factor;
+
+ ret = of_clk_add_provider(pdev->dev.of_node,
+ of_clk_src_onecell_get, &clk_data->clk_data);
+ if (ret)
+ goto unregister_gate;
+
+ return clk_data;
+
+unregister_gate:
+ hisi_clk_unregister_gate(hi3536dv100_gate_clks,
+ ARRAY_SIZE(hi3536dv100_gate_clks), clk_data);
+unregister_factor:
+ hisi_clk_unregister_fixed_factor(hi3536dv100_fixed_factor_clks,
+ ARRAY_SIZE(hi3536dv100_fixed_factor_clks), clk_data);
+unregister_mux:
+ hisi_clk_unregister_mux(hi3536dv100_mux_clks_crg,
+ ARRAY_SIZE(hi3536dv100_mux_clks_crg), clk_data);
+unregister_fixed_rate:
+ hisi_clk_unregister_fixed_rate(hi3536dv100_fixed_rate_clks_crg,
+ ARRAY_SIZE(hi3536dv100_fixed_rate_clks_crg), clk_data);
+ return ERR_PTR(ret);
+}
+
+static void hi3536dv100_clk_unregister(struct platform_device *pdev)
+{
+ struct hisi_crg_dev *crg = platform_get_drvdata(pdev);
+
+ of_clk_del_provider(pdev->dev.of_node);
+
+ hisi_clk_unregister_gate(hi3536dv100_gate_clks,
+ ARRAY_SIZE(hi3536dv100_gate_clks), crg->clk_data);
+ hisi_clk_unregister_mux(hi3536dv100_mux_clks_crg,
+ ARRAY_SIZE(hi3536dv100_mux_clks_crg), crg->clk_data);
+ hisi_clk_unregister_fixed_factor(hi3536dv100_fixed_factor_clks,
+ ARRAY_SIZE(hi3536dv100_fixed_factor_clks), crg->clk_data);
+ hisi_clk_unregister_fixed_rate(hi3536dv100_fixed_rate_clks_crg,
+ ARRAY_SIZE(hi3536dv100_fixed_rate_clks_crg), crg->clk_data);
+}
+
+static const struct hisi_crg_funcs hi3536dv100_crg_funcs = {
+ .register_clks = hi3536dv100_clk_register,
+ .unregister_clks = hi3536dv100_clk_unregister,
+};
+
+
+static const struct of_device_id hi3536dv100_crg_match_table[] = {
+ {
+ .compatible = "hisilicon,hi3536dv100-clock",
+ .data = &hi3536dv100_crg_funcs
+ },
+ { }
+};
+MODULE_DEVICE_TABLE(of, hi3536dv100_crg_match_table);
+
+static int hi3536dv100_crg_probe(struct platform_device *pdev)
+{
+ struct hisi_crg_dev *crg;
+
+ crg = devm_kmalloc(&pdev->dev, sizeof(*crg), GFP_KERNEL);
+ if (!crg)
+ return -ENOMEM;
+
+ crg->funcs = of_device_get_match_data(&pdev->dev);
+ if (!crg->funcs)
+ return -ENOENT;
+
+ crg->rstc = hisi_reset_init(pdev);
+ if (!crg->rstc)
+ return -ENOMEM;
+
+ crg->clk_data = crg->funcs->register_clks(pdev);
+ if (IS_ERR(crg->clk_data)) {
+ hisi_reset_exit(crg->rstc);
+ return PTR_ERR(crg->clk_data);
+ }
+
+ platform_set_drvdata(pdev, crg);
+ return 0;
+}
+
+static int hi3536dv100_crg_remove(struct platform_device *pdev)
+{
+ struct hisi_crg_dev *crg = platform_get_drvdata(pdev);
+
+ hisi_reset_exit(crg->rstc);
+ crg->funcs->unregister_clks(pdev);
+ return 0;
+}
+
+static struct platform_driver hi3536dv100_crg_driver = {
+ .probe = hi3536dv100_crg_probe,
+ .remove = hi3536dv100_crg_remove,
+ .driver = {
+ .name = "hi3536dv100-clock",
+ .of_match_table = hi3536dv100_crg_match_table,
+ },
+};
+
+static int __init hi3536dv100_crg_init(void)
+{
+ return platform_driver_register(&hi3536dv100_crg_driver);
+}
+core_initcall(hi3536dv100_crg_init);
+
+static void __exit hi3536dv100_crg_exit(void)
+{
+ platform_driver_unregister(&hi3536dv100_crg_driver);
+}
+module_exit(hi3536dv100_crg_exit);
+
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("HiSilicon Hi3536DV100 CRG Driver");
diff --git a/drivers/clk/hisilicon/crg.h b/drivers/clk/hisilicon/crg.h
new file mode 100644
index 0000000..e073971
--- /dev/null
+++ b/drivers/clk/hisilicon/crg.h
@@ -0,0 +1,34 @@
+/*
+ * HiSilicon Clock and Reset Driver Header
+ *
+ * Copyright (c) 2016 HiSilicon Limited.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __HISI_CRG_H
+#define __HISI_CRG_H
+
+struct hisi_clock_data;
+struct hisi_reset_controller;
+
+struct hisi_crg_funcs {
+ struct hisi_clock_data* (*register_clks)(struct platform_device *pdev);
+ void (*unregister_clks)(struct platform_device *pdev);
+};
+
+struct hisi_crg_dev {
+ struct hisi_clock_data *clk_data;
+ struct hisi_reset_controller *rstc;
+ const struct hisi_crg_funcs *funcs;
+};
+
+#endif /* __HISI_CRG_H */
diff --git a/drivers/clocksource/timer-sp804.c b/drivers/clocksource/timer-sp804.c
index d078633..46e9055 100644
--- a/drivers/clocksource/timer-sp804.c
+++ b/drivers/clocksource/timer-sp804.c
@@ -235,6 +235,10 @@ static int __init sp804_of_init(struct device_node *np)
writel(0, base + TIMER_CTRL);
writel(0, base + TIMER_2_BASE + TIMER_CTRL);
+ /* Ensure timer interrupts are clear */
+ writel(1, base + TIMER_INTCLR);
+ writel(1, base + TIMER_2_BASE + TIMER_INTCLR);
+
if (initialized || !of_device_is_available(np)) {
ret = -EINVAL;
goto err;
diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c
index 6e3c143..1489e46 100644
--- a/drivers/gpio/gpio-pl061.c
+++ b/drivers/gpio/gpio-pl061.c
@@ -208,6 +208,25 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger)
return 0;
}
+#ifdef CONFIG_ARCH_HISI_BVT
+static irqreturn_t pl061_irq_handler(int irq, void *data)
+{
+ unsigned long pending;
+ int offset;
+ struct gpio_chip *gc = data;
+ struct pl061_gpio *chip = container_of(gc, struct pl061_gpio, gc);
+
+ pending = readb(chip->base + GPIOMIS);
+ writeb(pending, chip->base + GPIOIC);
+ if (pending) {
+ for_each_set_bit(offset, &pending, PL061_GPIO_NR)
+ generic_handle_irq(irq_find_mapping(gc->irqdomain,
+ offset));
+ }
+
+ return IRQ_HANDLED;
+}
+#else
static void pl061_irq_handler(struct irq_desc *desc)
{
unsigned long pending;
@@ -227,6 +246,7 @@ static void pl061_irq_handler(struct irq_desc *desc)
chained_irq_exit(irqchip, desc);
}
+#endif
static void pl061_irq_mask(struct irq_data *d)
{
@@ -308,7 +328,17 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
return -ENODEV;
}
} else {
+#ifdef CONFIG_ARCH_HISI_BVT
+ if (dev->of_node) {
+ i = of_alias_get_id(dev->of_node, "gpio");
+ chip->gc.base = i * PL061_GPIO_NR;
+ }
+
+ if (chip->gc.base < 0)
+ chip->gc.base = -1;
+#else
chip->gc.base = -1;
+#endif
irq_base = 0;
}
@@ -353,8 +383,21 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
dev_info(&adev->dev, "could not add irqchip\n");
return ret;
}
+#ifdef CONFIG_ARCH_HISI_BVT
+ ret = devm_request_irq(dev, irq, pl061_irq_handler, IRQF_SHARED,
+ dev_name(dev), &chip->gc);
+ if (ret) {
+ dev_info(dev, "request irq failed: %d\n", ret);
+ return ret;
+ }
+
+ /* Set the parent IRQ for all affected IRQs */
+ for (i = 0; i < chip->gc.ngpio; i++)
+ irq_set_parent(irq_find_mapping(chip->gc.irqdomain, i), irq);
+#else
gpiochip_set_chained_irqchip(&chip->gc, &pl061_irqchip,
irq, pl061_irq_handler);
+#endif
for (i = 0; i < PL061_GPIO_NR; i++) {
if (pdata) {
diff --git a/drivers/hidmac/Kconfig b/drivers/hidmac/Kconfig
new file mode 100644
index 0000000..dcb3e08b
--- /dev/null
+++ b/drivers/hidmac/Kconfig
@@ -0,0 +1,21 @@
+#
+# Sensor device configuration
+#
+
+config HI_DMAC
+ tristate "Hisilicon DMAC Controller support"
+ depends on (ARCH_HISI_BVT)
+ help
+ The Direction Memory Access(DMA) is a high-speed data transfer
+ operation. It supports data read/write between peripherals and
+ memories without using the CPU.
+ Hisilicon DMA Controller(DMAC) directly transfers data between
+ a memory and a peripheral, between peripherals, or between memories.
+ This avoids the CPU intervention and reduces the interrupt handling
+ overhead of the CPU.
+
+if HI_DMAC
+config HI_DMAC_CHANNEL_NUM
+ int "hi dmac channel num"
+ default "4"
+endif
diff --git a/drivers/hidmac/Makefile b/drivers/hidmac/Makefile
new file mode 100644
index 0000000..7e41f4c
--- /dev/null
+++ b/drivers/hidmac/Makefile
@@ -0,0 +1,6 @@
+#
+# Makefile for the hi dmac drivers.
+#
+
+obj-$(CONFIG_HI_DMAC) += hi_pl08x.o
+
diff --git a/drivers/hidmac/hi_pl08x.c b/drivers/hidmac/hi_pl08x.c
new file mode 100644
index 0000000..397c882
--- /dev/null
+++ b/drivers/hidmac/hi_pl08x.c
@@ -0,0 +1,1267 @@
+/*
+ *
+ * Copyright (c) 2017 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "hi_pl08x.h"
+#include "hidmac_hi3536dv100.h"
+
+#define RX 0
+#define TX 1
+
+static int dmac_channel[CHANNEL_NUM] = {0, 1, 2, 3};
+
+int g_channel_status[CHANNEL_NUM];
+
+/* #define DEBUG */
+
+#define DEBUG
+#ifdef DEBUG
+#define dma_err printk
+#else
+#define dma_err(fmt, ...) do {} while (0)
+#endif
+
+/*
+ *Define Memory range
+ */
+mem_addr mem_num[MEM_MAX_NUM] = {
+ {DDRAM_ADRS, DDRAM_SIZE},
+ {FLASH_BASE, FLASH_SIZE}
+};
+
+typedef void REG_ISR(int *p_dma_chn, int *p_dma_status);
+REG_ISR *function[CHANNEL_NUM];
+
+struct hidmac_host {
+ struct clk *clk;
+ struct reset_control *rstc;
+ void __iomem *regbase;
+
+ int irq;
+};
+
+void __iomem *dma_regbase;
+unsigned int pllihead[2];
+
+#define CLR_INT(i) ((*(unsigned int *)(dma_regbase+0x008)) = (1 << i))
+
+/*
+ * memory address validity check
+ *
+static int mem_check_valid(unsigned int addr)
+{
+ unsigned int cnt;
+
+ for (cnt = 0; cnt < MEM_MAX_NUM; cnt++) {
+ if ((addr >= mem_num[cnt].addr_base) &&
+ (addr <= (mem_num[cnt].addr_base + mem_num[cnt].size)))
+ return 0;
+ }
+
+ return -1;
+} */
+
+/*
+ * dmac interrupt handle function
+ */
+irqreturn_t dmac_isr(int irq, void *dev_id)
+{
+ struct hidmac_host *dma = dev_id;
+ unsigned int channel_status;
+ unsigned int channel_tc_status, channel_err_status;
+ unsigned int i;
+
+ /*read the status of current interrupt */
+ dmac_readw(dma->regbase + DMAC_INTSTATUS, channel_status);
+
+ /*decide which channel has trigger the interrupt*/
+ for (i = 0; i < DMAC_MAX_CHANNELS; i++) {
+ if ((((channel_status >> i) & 0x1) == 0x01)) {
+ /* [HSCP201306240006],l00181524,20130625 */
+ /* The INT status should be read first then clear it */
+ /* CLR_INT(i); */
+ dmac_readw(dma->regbase + DMAC_INTTCSTATUS, channel_tc_status);
+ dmac_readw(dma->regbase + DMAC_INTERRORSTATUS, channel_err_status);
+ CLR_INT(i);
+ /*??HSCP201403110002?? l00183122 20140723*/
+ if (g_channel_status[i] == DMAC_CHN_VACANCY
+ && (function[i]) == NULL) {
+ if ((0x01 == ((channel_tc_status >> i) & 0x01)))
+ dmac_writew(dma->regbase + DMAC_INTTCCLEAR,
+ (0x01 << i));
+ else if ((0x01 == ((channel_err_status
+ >> i)&0x01)))
+ dmac_writew(dma->regbase + DMAC_INTERRCLR,
+ (0x01 << i));
+ continue;
+ }
+
+ /* save the current channel transfer */
+ /* status to g_channel_status[i] */
+ if ((0x01 == ((channel_tc_status >> i) & 0x01))) {
+ g_channel_status[i] = DMAC_CHN_SUCCESS;
+ dmac_writew(dma->regbase + DMAC_INTTCCLEAR, (0x01 << i));
+ } else if ((0x01 == ((channel_err_status >> i)&0x01))) {
+ g_channel_status[i] = -DMAC_CHN_ERROR;
+ dmac_writew(dma->regbase + DMAC_INTERRCLR, (0x01 << i));
+ } else {
+ pr_err("Isr Error in DMAC_IntHandeler");
+ pr_err("%d! channel\n", i);
+ }
+
+ if ((function[i]) != NULL)
+ function[i](&i, &g_channel_status[i]);
+ }
+ }
+
+ return IRQ_RETVAL(1);
+}
+
+/*
+ * update the state of channels
+ */
+#define HI_DMA_UPDATE_TIMEOUT 5000000
+static int dma_update_status(unsigned int channel)
+{
+
+ unsigned int channel_status;
+ unsigned int channel_tc_status[3];
+ unsigned int channel_err_status[3];
+ unsigned int i = channel, j, time = 0;
+
+
+ while (1) {
+ for (j = 0; j < 3; j++) {
+ dmac_readw(dma_regbase + DMAC_INTTCSTATUS, channel_status);
+ channel_tc_status[j] = (channel_status >> i) & 0x01;
+ dmac_readw(dma_regbase + DMAC_INTERRORSTATUS, channel_status);
+ channel_err_status[j] = (channel_status >> i) & 0x01;
+ }
+
+ if ((channel_tc_status[0] == 0x1) &&
+ (channel_tc_status[1] == 0x1) &&
+ (channel_tc_status[2] == 0x1)) {
+ g_channel_status[i] = DMAC_CHN_SUCCESS;
+ dmac_writew(dma_regbase + DMAC_INTTCCLEAR, (0x01 << i));
+ break;
+ } else if ((channel_err_status[0] == 0x1) &&
+ (channel_err_status[1] == 0x1) &&
+ (channel_err_status[2] == 0x1)) {
+ g_channel_status[i] = -DMAC_CHN_ERROR;
+ dma_err("Error in DMAC %d finish!\n", i);
+ dmac_writew(dma_regbase + DMAC_INTERRCLR, (0x01 << i));
+ break;
+ }
+
+ if (++time == HI_DMA_UPDATE_TIMEOUT) {
+ dma_err("Timeout in DMAC %d!\n", i);
+ g_channel_status[i] = -DMAC_CHN_TIMEOUT;
+ break;
+ }
+ }
+
+ return g_channel_status[i];
+}
+
+
+/*
+ * check the state of channels
+ */
+static int dmac_check_over(unsigned int channel)
+{
+ int status = 0;
+
+ if (-DMAC_CHN_ERROR == g_channel_status[channel]) {
+ dma_err("Error transfer %d finished\n", channel);
+ dmac_writew(dma_regbase + DMAC_CxCONFIG(channel), DMAC_CxDISABLE);
+ g_channel_status[channel] = DMAC_CHN_VACANCY;
+ status = -DMAC_CHN_ERROR;
+ } else if (DMAC_NOT_FINISHED == g_channel_status[channel])
+ status = DMAC_NOT_FINISHED;
+ else if (DMAC_CHN_ALLOCAT == g_channel_status[channel])
+ status = DMAC_CHN_ALLOCAT;
+ else if (DMAC_CHN_VACANCY == g_channel_status[channel])
+ status = DMAC_CHN_VACANCY;
+ else if (-DMAC_CHN_TIMEOUT == g_channel_status[channel]) {
+ dma_err("transfer %d timeout!\n", channel);
+ status = -DMAC_CHN_TIMEOUT;
+ } else if (DMAC_CHN_SUCCESS == g_channel_status[channel])
+ /*The transfer of Channel %d has finished successfully!*/
+ status = DMAC_CHN_SUCCESS;
+ else {
+ dmac_writew(dma_regbase + DMAC_CxCONFIG(channel), DMAC_CxDISABLE);
+ g_channel_status[channel] = DMAC_CHN_VACANCY;
+ status = -DMAC_CHN_ERROR;
+ }
+ return status;
+}
+
+spinlock_t my_lcok = __SPIN_LOCK_UNLOCKED(old_style_spin_init);
+unsigned long flags;
+
+/*
+ * allocate channel.
+ */
+int dmac_channel_allocate(void *pisr)
+{
+ unsigned int i, channelinfo, g_channelinfo;
+
+ for (i = 0; i < CHANNEL_NUM; i++)
+ dmac_check_over(dmac_channel[i]);
+
+ dmac_readw(dma_regbase + DMAC_ENBLDCHNS, g_channelinfo);
+ g_channelinfo = g_channelinfo & 0x00ff;
+
+ for (i = 0; i < CHANNEL_NUM; i++) {
+ if (g_channel_status[dmac_channel[i]] == DMAC_CHN_VACANCY) {
+ channelinfo = g_channelinfo >> dmac_channel[i];
+ if (0x00 == (channelinfo & 0x01)) {
+ /*clear the interrupt in this channel */
+ dmac_writew(dma_regbase + DMAC_INTERRCLR,
+ (0x01 << dmac_channel[i]));
+ dmac_writew(dma_regbase + DMAC_INTTCCLEAR,
+ (0x01 << dmac_channel[i]));
+
+ g_channel_status[dmac_channel[i]]
+ = DMAC_CHN_ALLOCAT;
+ return dmac_channel[i];
+ }
+ }
+ }
+
+ dma_err("no to alloc\n");
+ return -EINVAL;
+}
+EXPORT_SYMBOL(dmac_channel_allocate);
+
+int dmac_register_isr(unsigned int channel, void *pisr)
+{
+ if (channel > CHANNEL_NUM - 1) {
+ dma_err("channel which choosed %d is error !\n", channel);
+ return -1;
+ }
+
+ if (g_channel_status[channel] != DMAC_CHN_VACANCY) {
+ dma_err("dma chn %d is in used!\n", channel);
+ return -1;
+ }
+
+ /*clear the interrupt in this channel */
+ dmac_writew(dma_regbase + DMAC_INTERRCLR, (0x01 << channel));
+ dmac_writew(dma_regbase + DMAC_INTTCCLEAR, (0x01 << channel));
+
+ function[channel] = (void *)pisr;
+ g_channel_status[channel] = DMAC_CHN_ALLOCAT;
+
+ return 0;
+}
+EXPORT_SYMBOL(dmac_register_isr);
+
+/*
+ * free channel
+ */
+int dmac_channel_free(unsigned int channel)
+{
+ if (channel >= DMAC_MAX_CHANNELS) {
+ dma_err("channel larger than total.\n");
+ return -EINVAL;
+ }
+
+ g_channel_status[channel] = DMAC_CHN_VACANCY;
+ return 0;
+}
+EXPORT_SYMBOL(dmac_channel_free);
+
+static unsigned int dmac_check_request(unsigned int peripheral_addr,
+ int direction)
+{
+ int i;
+ /* check request pipe with peripheral_addr */
+ for (i = direction; i < DMAC_MAX_PERIPHERALS; i = i + 2) {
+ if (g_peripheral[i].peri_addr == peripheral_addr)
+ return i;
+ }
+
+ dma_err("Invalid devaddr\n");
+
+ return -1;
+}
+
+/*
+ * init dmac register
+ * clear interrupt flags
+ * called by dma_driver_init
+ */
+int dmac_init(struct hidmac_host *dma)
+{
+ unsigned int i, tempvalue;
+ int ret;
+
+ clk_prepare_enable(dma->clk);
+ reset_control_deassert(dma->rstc);
+
+ dmac_readw(dma->regbase + DMAC_CONFIG, tempvalue);
+ if (tempvalue == 0) {
+ dmac_writew(dma->regbase + DMAC_CONFIG,
+ DMAC_CONFIG_VAL);
+ dmac_writew(dma->regbase + DMAC_INTTCCLEAR, 0xFF);
+ dmac_writew(dma->regbase + DMAC_INTERRCLR, 0xFF);
+ for (i = 0; i < DMAC_MAX_CHANNELS; i++) {
+ dmac_writew(dma->regbase + DMAC_CxCONFIG(i),
+ DMAC_CxDISABLE);
+ function[i] = NULL;
+ }
+ }
+
+ /* creat LLI */
+ /* alloc space for dma lli, as the source is uncontinuous, so... */
+ ret = allocate_dmalli_space(pllihead, 1);
+ if (ret < 0)
+ return -1;
+
+ if (request_irq(dma->irq, dmac_isr, 0, "hi_dma", dma)) {
+ dma_err("DMA Irq %d request failed\n", dma->irq);
+ free_dmalli_space(pllihead, 1);
+ return -1;
+ }
+
+ return 0;
+}
+
+
+/*
+ * alloc_dma_lli_space
+ * output:
+ * ppheadlli[0]: memory physics address
+ * ppheadlli[1]: virtual address
+ *
+ */
+int allocate_dmalli_space(unsigned int *ppheadlli, unsigned int page_num)
+{
+ dma_addr_t dma_phys;
+ void *dma_virt;
+
+ dma_virt = dma_alloc_coherent(NULL, page_num*PAGE_SIZE,
+ &dma_phys, GFP_DMA | GFP_KERNEL);
+ if (NULL == dma_virt) {
+ dma_err("can't get dma mem from system\n");
+ return -1;
+ }
+
+ ppheadlli[0] = (unsigned int)(dma_phys);
+ ppheadlli[1] = (unsigned int)(dma_virt);
+
+ return 0;
+}
+EXPORT_SYMBOL(allocate_dmalli_space);
+
+/*
+ * free_dma_lli_space
+ */
+int free_dmalli_space(unsigned int *ppheadlli, unsigned int page_num)
+{
+ dma_addr_t dma_phys;
+ unsigned int dma_virt;
+
+ dma_phys = (dma_addr_t)(ppheadlli[0]);
+ dma_virt = ppheadlli[1];
+
+ dma_free_coherent(NULL, page_num*PAGE_SIZE,
+ (void *)dma_virt, dma_phys);
+
+ ppheadlli[0] = 0;
+ ppheadlli[1] = 0;
+ return 0;
+}
+EXPORT_SYMBOL(free_dmalli_space);
+
+/*
+ * config register for memory to memory DMA transfer without LLI
+ * note:
+ * it is necessary to call dmac_channelstart for channel enable
+ */
+int dmac_start_m2m(unsigned int channel, unsigned int psource,
+ unsigned int pdest, unsigned int uwnumtransfers)
+{
+ unsigned int uwchannel_num, tmp_trasnsfer;
+
+ if (uwnumtransfers > (MAXTRANSFERSIZE << 2)) {
+ dma_err("Invalidate transfer size,size=%x\n", uwnumtransfers);
+ return -EINVAL;
+ }
+
+ uwchannel_num = channel;
+
+ if ((uwchannel_num == DMAC_CHANNEL_INVALID)
+ || (uwchannel_num > CHANNEL_NUM)) {
+ pr_err("failure of DMAC channel allocation in M2M function!\n");
+ return -EFAULT;
+ }
+
+ /* dmac_writew (DMAC_CxCONFIG(uwchannel_num), DMAC_CxDISABLE); */
+ dmac_writew(dma_regbase + DMAC_CxSRCADDR(uwchannel_num), psource);
+ dmac_writew(dma_regbase + DMAC_CxDESTADDR(uwchannel_num), pdest);
+ dmac_writew(dma_regbase + DMAC_CxLLI(uwchannel_num), 0);
+ tmp_trasnsfer = (uwnumtransfers >> 2) & 0xfff;
+ tmp_trasnsfer = tmp_trasnsfer | (DMAC_CxCONTROL_M2M & (~0xfff));
+ dmac_writew(dma_regbase + DMAC_CxCONTROL(uwchannel_num), tmp_trasnsfer);
+ dmac_writew(dma_regbase + DMAC_CxCONFIG(uwchannel_num), DMAC_CxCONFIG_M2M);
+
+ return 0;
+}
+EXPORT_SYMBOL(dmac_start_m2m);
+
+/*
+ * channel enable
+ * start a dma transfer immediately
+ */
+int dmac_channelstart(unsigned int u32channel)
+{
+
+ unsigned int reg_value;
+
+ if (u32channel >= DMAC_MAX_CHANNELS) {
+ dma_err("channel larger %d\n", DMAC_MAX_CHANNELS);
+ return -EINVAL;
+ }
+
+ g_channel_status[u32channel] = DMAC_NOT_FINISHED;
+ dmac_readw(dma_regbase + DMAC_CxCONFIG(u32channel), reg_value);
+ dmac_writew(dma_regbase + DMAC_CxCONFIG(u32channel),
+ (reg_value | DMAC_CHANNEL_ENABLE));
+
+ return 0;
+}
+EXPORT_SYMBOL(dmac_channelstart);
+
+/*
+ * wait for transfer end
+ */
+int dmac_wait(int channel)
+{
+ int ret_result, ret = 0;
+
+ if (channel < 0)
+ return -1;
+
+ while (1) {
+ ret_result = dma_update_status(channel);
+ if (ret_result == -DMAC_CHN_ERROR) {
+ dma_err("Transfer Error.\n");
+ ret = -1;
+ goto end;
+ } else if (ret_result == DMAC_NOT_FINISHED)
+ udelay(10);
+ else if (ret_result == DMAC_CHN_SUCCESS) {
+ ret = DMAC_CHN_SUCCESS;
+ goto end;
+ }
+ else if (ret_result == DMAC_CHN_VACANCY) {
+ ret = DMAC_CHN_SUCCESS;
+ goto end;
+ } else if (ret_result == -DMAC_CHN_TIMEOUT) {
+ dma_err("Timeout.\n");
+ dmac_writew(dma_regbase + DMAC_CxCONFIG(channel), DMAC_CxDISABLE);
+ g_channel_status[channel] = DMAC_CHN_VACANCY;
+ ret = -1;
+ goto end;
+ }
+ }
+end:
+ dmac_channelclose(channel);
+ return ret;
+}
+EXPORT_SYMBOL(dmac_wait);
+
+/*
+ * buile LLI for memory to memory DMA transfer
+ */
+int dmac_buildllim2m_isp(unsigned int *ppheadlli, unsigned int *psource,
+ unsigned int *pdest, unsigned int *length,
+ unsigned int lli_num)
+{
+ unsigned int address, phy_address;
+ unsigned int j;
+
+ if (ppheadlli != NULL) {
+ phy_address = (unsigned int)(ppheadlli[0]);
+ dma_debug("phy_address: 0x%X\n",phy_address);
+ address = (unsigned int)(ppheadlli[1]);
+ dma_debug("address: 0x%X\n",address);
+ for (j = 0; j < lli_num; j++) {
+ dma_debug("psource[%d]: 0x%X\n", j, psource[j]);
+ dmac_writew(address, psource[j]);
+ address += 4;
+ phy_address += 4;
+ dma_debug("pdest[%d]: 0x%X\n", j, pdest[j]);
+ dmac_writew(address, pdest[j]);
+ address += 4;
+ phy_address += 4;
+
+ /* if the last node, next_lli_addr = 0*/
+ if (j == (lli_num - 1))
+ dmac_writew(address, 0);
+ else
+ dmac_writew(address,
+ (((phy_address + 8) & (~0x03))
+ | DMAC_CxLLI_LM));
+
+ address += 4;
+ phy_address += 4;
+
+ if (j == (lli_num - 1)) {
+ dmac_writew(address, ((DMAC_CxCONTROL_LLIM2M_ISP
+ &(~0xfff)) | (length[j])
+ | 0x80000000));
+ } else {
+ dmac_writew(address,
+ (((DMAC_CxCONTROL_LLIM2M_ISP&(~0xfff)) |
+ (length[j])) & 0x7fffffff));
+ }
+
+ address += 4;
+ phy_address += 4;
+ }
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL(dmac_buildllim2m_isp);
+
+/*
+ * buile LLI for memory to memory DMA transfer
+ */
+int dmac_buildllim2m(unsigned int *ppheadlli, unsigned int pdest,
+ unsigned int psource, unsigned int totaltransfersize,
+ unsigned int uwnumtransfers)
+{
+ unsigned int lli_num = 0;
+ unsigned int last_lli = 0;
+ unsigned int address , phy_address, srcaddr, denstaddr;
+ unsigned int j;
+
+ lli_num = (totaltransfersize / uwnumtransfers);
+
+ if ((totaltransfersize % uwnumtransfers) != 0)
+ last_lli = 1, ++lli_num;
+
+ if (ppheadlli != NULL) {
+ phy_address = (unsigned int)(ppheadlli[0]);
+ address = (unsigned int)(ppheadlli[1]);
+ for (j = 0; j < lli_num; j++) {
+ srcaddr = (psource + (j*uwnumtransfers));
+ dmac_writew(address, srcaddr);
+ address += 4;
+ phy_address += 4;
+ denstaddr = (pdest + (j*uwnumtransfers));
+ dmac_writew(address, denstaddr);
+ address += 4;
+ phy_address += 4;
+ if (j == (lli_num - 1))
+ dmac_writew(address, 0);
+ else
+ dmac_writew(address,
+ (((phy_address + 8) & (~0x03))
+ | DMAC_CxLLI_LM));
+
+ address += 4;
+ phy_address += 4;
+
+ if ((j == (lli_num - 1)) && (last_lli == 0))
+ dmac_writew(address, ((DMAC_CxCONTROL_LLIM2M
+ &(~0xfff)) | (uwnumtransfers >> 2)
+ | 0x80000000));
+ else if ((j == (lli_num - 1)) && (last_lli == 1))
+ dmac_writew(address, ((DMAC_CxCONTROL_LLIM2M
+ & (~0xfff)) | ((totaltransfersize
+ % uwnumtransfers) >> 2) | 0x80000000));
+ else
+ dmac_writew(address,
+ (((DMAC_CxCONTROL_LLIM2M&(~0xfff)) |
+ (uwnumtransfers >> 2)) & 0x7fffffff));
+
+ address += 4;
+ phy_address += 4;
+ }
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL(dmac_buildllim2m);
+
+/*
+ * disable channel
+ * used before the operation of register configuration
+ */
+int dmac_channelclose(unsigned int channel)
+{
+ unsigned int reg_value, count;
+
+ if (channel >= DMAC_MAX_CHANNELS) {
+ dma_err("channel larger than total.\n");
+ return -EINVAL;
+ }
+
+ dmac_readw(dma_regbase + DMAC_CxCONFIG(channel), reg_value);
+
+#define CHANNEL_CLOSE_IMMEDIATE
+#ifdef CHANNEL_CLOSE_IMMEDIATE
+ reg_value &= 0xFFFFFFFE;
+ dmac_writew(dma_regbase + DMAC_CxCONFIG(channel) , reg_value);
+#else
+ reg_value |= DMAC_CONFIGURATIONx_HALT_DMA_ENABLE;
+ /*ignore incoming dma request*/
+ dmac_writew(dma_regbase + DMAC_CxCONFIG(channel), reg_value);
+ dmac_readw(dma_regbase + DMAC_CxCONFIG(channel), reg_value);
+ /*if FIFO is empty*/
+ while ((reg_value & DMAC_CONFIGURATIONx_ACTIVE)
+ == DMAC_CONFIGURATIONx_ACTIVE)
+ dmac_readw(dma_regbase + DMAC_CxCONFIG(channel), reg_value);
+ reg_value &= 0xFFFFFFFE;
+ dmac_writew(dma_regbase + DMAC_CxCONFIG(channel), reg_value);
+#endif
+
+ dmac_readw(dma_regbase + DMAC_ENBLDCHNS, reg_value);
+ reg_value = reg_value & 0x00ff;
+ count = 0;
+ while (((reg_value >> channel) & 0x1) == 1) {
+ dmac_readw(dma_regbase + DMAC_ENBLDCHNS, reg_value);
+ reg_value = reg_value & 0x00ff;
+ if (count++ > 10000) {
+ dma_err("close failure.\n");
+ return -1;
+ }
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL(dmac_channelclose);
+
+/*
+ * load configuration from LLI for memory to memory
+ */
+int dmac_start_llim2m(unsigned int channel, unsigned int *pfirst_lli)
+{
+ unsigned int uwchannel_num;
+ dmac_lli plli;
+ unsigned int first_lli;
+
+ if (NULL == pfirst_lli) {
+ dma_err("Invalidate LLI head!\n");
+ return -EFAULT;
+ }
+
+ uwchannel_num = channel;
+ if ((uwchannel_num == DMAC_CHANNEL_INVALID) ||
+ (uwchannel_num > 7)) {
+ dma_err("failure of DMAC channel allocation in");
+ dma_err("LLIM2M function,channel=%x!\n ", uwchannel_num);
+ return -EINVAL;
+ }
+
+ memset(&plli, 0, sizeof(plli));
+ first_lli = (unsigned int)pfirst_lli[1];
+ dmac_readw(first_lli, plli.src_addr);
+ dmac_readw(first_lli+4, plli.dst_addr);
+ dmac_readw(first_lli+8, plli.next_lli);
+ dmac_readw(first_lli+12, plli.lli_transfer_ctrl);
+
+ dmac_channelclose(uwchannel_num);
+ dmac_writew(dma_regbase + DMAC_INTTCCLEAR, (0x1 << uwchannel_num));
+ dmac_writew(dma_regbase + DMAC_INTERRCLR, (0x1 << uwchannel_num));
+ dmac_writew(dma_regbase + DMAC_SYNC, 0x0);
+
+ dmac_writew(dma_regbase + DMAC_CxCONFIG(uwchannel_num),
+ DMAC_CxDISABLE);
+ dmac_writew(dma_regbase + DMAC_CxSRCADDR(uwchannel_num),
+ (unsigned int)(plli.src_addr));
+ dmac_writew(dma_regbase + DMAC_CxDESTADDR(uwchannel_num),
+ (unsigned int)(plli.dst_addr));
+ dmac_writew(dma_regbase + DMAC_CxLLI(uwchannel_num),
+ (unsigned int)(plli.next_lli));
+ dmac_writew(dma_regbase + DMAC_CxCONTROL(uwchannel_num),
+ (unsigned int)(plli.lli_transfer_ctrl));
+ dmac_writew(dma_regbase + DMAC_CxCONFIG(uwchannel_num),
+ DMAC_CxCONFIG_LLIM2M);
+
+ return 0;
+}
+EXPORT_SYMBOL(dmac_start_llim2m);
+
+/*
+ * load configuration from LLI for memory and peripheral
+ */
+int dmac_start_llim2p(unsigned int channel, unsigned int *pfirst_lli,
+ unsigned int uwperipheralid)
+{
+ unsigned int uwchannel_num;
+ dmac_lli plli;
+ unsigned int first_lli;
+ unsigned int temp = 0;
+
+ if (NULL == pfirst_lli) {
+ dma_err("Invalidate LLI head!\n");
+ return -EINVAL;
+ }
+ uwchannel_num = channel;
+ if ((uwchannel_num == DMAC_CHANNEL_INVALID) ||
+ (uwchannel_num > CHANNEL_NUM)) {
+ dma_err("failure of DMAC channel allocation in");
+ dma_err("LLIM2P function, channel=%x!\n ", uwchannel_num);
+ return -EINVAL;
+ }
+
+ memset(&plli, 0, sizeof(plli));
+ first_lli = (unsigned int)pfirst_lli[1];
+ dmac_readw(first_lli, plli.src_addr);
+ dmac_readw(first_lli+4, plli.dst_addr);
+ dmac_readw(first_lli+8, plli.next_lli);
+ dmac_readw(first_lli+12, plli.lli_transfer_ctrl);
+
+ dmac_channelclose(uwchannel_num);
+ dmac_writew(dma_regbase + DMAC_INTTCCLEAR, (0x1< 15)) {
+ dma_err("Invalid peripheral id%x\n", uwperipheralid);
+ return -EINVAL;
+ }
+
+ uwchannel_num = (int)channel;
+ if ((uwchannel_num == DMAC_CHANNEL_INVALID)
+ || (uwchannel_num > CHANNEL_NUM) || (uwchannel_num < 0)) {
+ dma_err("failure alloc\n");
+ return -EFAULT;
+ }
+
+ /* must modified with different peripheral */
+ uwwidth = g_peripheral[uwperipheralid].transfer_width;
+
+ /* check transfer direction *
+ * even number-->TX, odd number-->RX*/
+ uwsrc_addr = memaddr;
+ uwdst_addr = (unsigned int)(g_peripheral[uwperipheralid].peri_addr);
+
+ tmp = uwnumtransfers >> uwwidth;
+ if (tmp & (~0x0fff)) {
+ dma_err("Invalidate size%x\n", uwnumtransfers);
+ return -EINVAL;
+ }
+
+ tmp = tmp & 0xfff;
+ uwtrans_control = tmp |
+ (g_peripheral[uwperipheralid].transfer_ctrl & (~0xfff));
+ dmac_writew(dma_regbase + DMAC_INTTCCLEAR, (0x1<<(unsigned int)uwchannel_num));
+ dmac_writew(dma_regbase + DMAC_INTERRCLR, (0x1<<(unsigned int)uwchannel_num));
+ dmac_writew(dma_regbase + DMAC_CxSRCADDR(uwchannel_num), (unsigned int)uwsrc_addr);
+ dmac_writew(dma_regbase + DMAC_CxDESTADDR(uwchannel_num), (unsigned int)uwdst_addr);
+ dmac_writew(dma_regbase + DMAC_CxCONTROL(uwchannel_num),
+ (unsigned int)uwtrans_control);
+ dmac_writew(dma_regbase + DMAC_CxCONFIG(uwchannel_num),
+ (g_peripheral[uwperipheralid].transfer_cfg));
+
+ return 0;
+}
+
+/*
+ * enable memory and peripheral dma transfer
+ * note:
+ * it is necessary to call dmac_channelstart to enable channel
+ */
+int dmac_start_p2m(unsigned int channel, unsigned int memaddr,
+ unsigned int uwperipheralid, unsigned int uwnumtransfers,
+ unsigned int next_lli_addr)
+{
+ unsigned int uwtrans_control = 0;
+ unsigned int addtmp, tmp;
+ unsigned int uwdst_addr = 0, uwsrc_addr = 0;
+ unsigned int uwwidth;
+ int uwchannel_num;
+
+ addtmp = memaddr;
+
+ if ((uwperipheralid > 15)) {
+ dma_err("Invalid peripheral id%x\n", uwperipheralid);
+ return -EINVAL;
+ }
+
+ uwchannel_num = (int)channel;
+ if ((uwchannel_num == DMAC_CHANNEL_INVALID)
+ || (uwchannel_num > 3) || (uwchannel_num < 0)) {
+ dma_err("failure alloc\n");
+ return -EFAULT;
+ }
+
+ /* must modified with different peripheral */
+ uwwidth = g_peripheral[uwperipheralid].transfer_width;
+
+ /* check transfer direction *
+ * even number-->TX, odd number-->RX*/
+ uwsrc_addr = (unsigned int)(g_peripheral[uwperipheralid].peri_addr);
+ uwdst_addr = memaddr;
+
+ tmp = uwnumtransfers >> uwwidth;
+ if (tmp & (~0x0fff)) {
+ dma_err("Invalidate size%x\n", uwnumtransfers);
+ return -EINVAL;
+ }
+
+ tmp = tmp & 0xfff;
+ uwtrans_control = tmp |
+ (g_peripheral[uwperipheralid].transfer_ctrl & (~0xfff));
+ dmac_writew(dma_regbase + DMAC_INTTCCLEAR, (0x1<<(unsigned int)uwchannel_num));
+ dmac_writew(dma_regbase + DMAC_INTERRCLR, (0x1<<(unsigned int)uwchannel_num));
+ dmac_writew(dma_regbase + DMAC_CxSRCADDR(uwchannel_num),
+ (unsigned int)uwsrc_addr);
+ dmac_writew(dma_regbase + DMAC_CxDESTADDR(uwchannel_num),
+ (unsigned int)uwdst_addr);
+ dmac_writew(dma_regbase + DMAC_CxCONTROL(uwchannel_num),
+ (unsigned int)uwtrans_control);
+ dmac_writew(dma_regbase + DMAC_CxCONFIG(uwchannel_num),
+ (g_peripheral[uwperipheralid].transfer_cfg));
+
+ return 0;
+}
+
+/*
+ * execute memory to memory dma transfer without LLI
+ */
+int dmac_m2m_transfer(unsigned int source, unsigned int dest,
+ unsigned int length)
+{
+ unsigned int ulchnn, dma_size = 0;
+ unsigned int dma_count, left_size;
+
+ left_size = length;
+ dma_count = 0;
+ ulchnn = dmac_channel_allocate(NULL);
+
+ ulchnn = 2;
+
+ dma_err("use channel %d\n", ulchnn);
+
+ while ((left_size >> 2) >= 0xffc) {
+ dma_size = 0xffc;
+ left_size -= (dma_size << 2);
+ dma_err("left_size is %x.", left_size);
+ dmac_start_m2m(ulchnn, (unsigned int)(source
+ + dma_count * (dma_size << 2)),
+ (unsigned int)(dest + dma_count * (dma_size << 2)),
+ (dma_size << 2));
+ if (dmac_channelstart(ulchnn) != 0) {
+ dma_err("start channel error...\n");
+ return -1;
+ }
+
+ if (dmac_wait(ulchnn) != DMAC_CHN_SUCCESS) {
+ dma_err("dma transfer error...\n");
+ return -1;
+ }
+
+ dma_count++;
+ }
+
+ dmac_start_m2m(ulchnn, (source + dma_count * (dma_size << 2)),
+ (dest + dma_count * (dma_size << 2)), (left_size << 2));
+
+ if (dmac_channelstart(ulchnn) != 0)
+ return -1;
+
+ if (dmac_wait(ulchnn) != DMAC_CHN_SUCCESS)
+ return -1;
+
+ return 0;
+}
+EXPORT_SYMBOL(dmac_m2m_transfer);
+
+/*
+ * execute memory to peripheral dma transfer without LLI
+ */
+int dmac_m2p_transfer(unsigned int memaddr, unsigned int uwperipheralid,
+ unsigned int length)
+{
+ unsigned int ulchnn, dma_size = 0;
+ unsigned int dma_count, left_size;
+ unsigned int uwwidth;
+
+ left_size = length;
+ dma_count = 0;
+
+ ulchnn = dmac_channel_allocate(NULL);
+ if (DMAC_CHANNEL_INVALID == ulchnn)
+ return -1;
+
+ uwwidth = g_peripheral[uwperipheralid].transfer_width;
+
+ while ((left_size >> uwwidth) >= 0xffc) {
+ dma_size = 0xffc;
+ left_size -= (dma_size << uwwidth);
+
+ if (dmac_start_m2p(ulchnn,
+ (unsigned int)(memaddr + dma_count * dma_size),
+ uwperipheralid, (dma_size << uwwidth), 0) < 0)
+ return -1;
+
+ if (dmac_channelstart(ulchnn) != 0)
+ return -1;
+
+ if (dmac_wait(ulchnn) != DMAC_CHN_SUCCESS) {
+ dmac_channel_free(ulchnn);
+ return -1;
+ }
+
+ dma_count++;
+ }
+
+ pr_debug("memaddr=0x%x\n", (unsigned int)(memaddr
+ + dma_count * dma_size));
+
+ if (dmac_start_m2p(ulchnn,
+ (unsigned int)(memaddr + dma_count * dma_size),
+ uwperipheralid, left_size, 0) < 0)
+ return -1;
+
+ if (dmac_channelstart(ulchnn) != 0)
+ return -1;
+
+ return ulchnn;
+}
+
+/*
+ * execute memory to peripheral dma transfer without LLI
+ */
+int dmac_p2m_transfer(unsigned int memaddr, unsigned int uwperipheralid,
+ unsigned int length)
+{
+ unsigned int ulchnn, dma_size = 0;
+ unsigned int dma_count, left_size;
+ unsigned int uwwidth;
+
+ left_size = length;
+ dma_count = 0;
+
+ ulchnn = dmac_channel_allocate(NULL);
+ if (DMAC_CHANNEL_INVALID == ulchnn)
+ return -1;
+
+ uwwidth = g_peripheral[uwperipheralid].transfer_width;
+
+ while ((left_size >> uwwidth) >= 0xffc) {
+ dma_size = 0xffc;
+ left_size -= (dma_size << uwwidth);
+
+ if (dmac_start_p2m(ulchnn,
+ (unsigned int)(memaddr + dma_count * dma_size),
+ uwperipheralid, (dma_size << uwwidth), 0) < 0)
+ return -1;
+
+ if (dmac_channelstart(ulchnn) != 0)
+ return -1;
+
+ if (dmac_wait(ulchnn) != DMAC_CHN_SUCCESS) {
+ dmac_channel_free(ulchnn);
+ return -1;
+ }
+
+ dma_count++;
+ }
+
+ pr_debug("memaddr=0x%x\n", (unsigned int)(memaddr
+ + dma_count * dma_size));
+
+ if (dmac_start_p2m(ulchnn,
+ (unsigned int)(memaddr + dma_count * dma_size),
+ uwperipheralid, left_size, 0) < 0)
+ return -1;
+
+ if (dmac_channelstart(ulchnn) != 0)
+ return -1;
+
+ return ulchnn;
+}
+
+/*
+ * memory to memory dma transfer with LLI
+ *
+ * @source
+ * @dest
+ * @length
+ * @num
+ * */
+int do_dma_llim2m_isp(unsigned int *source,
+ unsigned int *dest,
+ unsigned int *length,
+ unsigned int num)
+{
+ unsigned int chnn;
+ int ret = 0;
+
+ /* the dma channel is default using 2 */
+ chnn = 2;
+
+ ret = dmac_buildllim2m_isp(pllihead, source, dest, length, num);
+
+ if (ret) {
+ dma_err("build lli error...\n");
+ return -1;
+ }
+
+ /* dmac_register_isr(chnn, dmac_channel_close); */
+ ret = dmac_start_llim2m(chnn, pllihead);
+ if (ret)
+ return -1;
+
+ if (dmac_channelstart(chnn) != 0) {
+ dma_err("start channel error...\n");
+ return -1;
+ }
+
+ return ret;
+}
+EXPORT_SYMBOL(do_dma_llim2m_isp);
+
+int do_dma_m2p(unsigned int memaddr, unsigned int peripheral_addr,
+ unsigned int length)
+{
+ int ret = 0;
+ int uwperipheralid;
+
+ uwperipheralid = dmac_check_request(peripheral_addr, TX);
+ if (uwperipheralid < 0) {
+ dma_err("m2p:Invalid devaddr\n");
+ return -1;
+ }
+
+ ret = dmac_m2p_transfer(memaddr, uwperipheralid, length);
+ if (ret == -1) {
+ dma_err("m2p:trans err\n");
+ return -1;
+ }
+
+ return ret;
+}
+
+int do_dma_p2m(unsigned int memaddr, unsigned int peripheral_addr,
+ unsigned int length)
+{
+ int ret = -1;
+ int uwperipheralid;
+
+ uwperipheralid = dmac_check_request(peripheral_addr, RX);
+ if (uwperipheralid < 0) {
+ dma_err("p2m:Invalid devaddr.\n");
+ return -1;
+ }
+
+ ret = dmac_p2m_transfer(memaddr, uwperipheralid, length);
+ if (ret == -1) {
+ dma_err("p2m:trans err\n");
+ return -1;
+ }
+
+ return ret;
+}
+
+/*
+ * Apply DMA interrupt resource
+ * init channel state
+ */
+static int hi_dmac_probe(struct platform_device *platdev)
+{
+ unsigned int i;
+ struct hidmac_host *dma;
+ struct resource *res;
+ int ret;
+
+ dma = devm_kzalloc(&platdev->dev, sizeof(*dma), GFP_KERNEL);
+ if (!dma)
+ return -ENOMEM;
+
+ res = platform_get_resource(platdev, IORESOURCE_MEM, 0);
+ if (!res) {
+ dev_err(&platdev->dev, "no mmio resource\n");
+ return -ENODEV;
+ }
+
+ dma->regbase = devm_ioremap_resource(&platdev->dev, res);
+ if (IS_ERR(dma->regbase))
+ return PTR_ERR(dma->regbase);
+
+ dma->clk = devm_clk_get(&platdev->dev, NULL);
+ if (IS_ERR(dma->clk))
+ return PTR_ERR(dma->clk);
+
+ dma->rstc = devm_reset_control_get(&platdev->dev, "dma-reset");
+ if (IS_ERR(dma->rstc))
+ return PTR_ERR(dma->rstc);
+
+ dma->irq = platform_get_irq(platdev, 0);
+ if (unlikely(dma->irq < 0))
+ return -ENODEV;
+
+ dma_regbase = dma->regbase;
+
+ ret = dmac_init(dma);
+ if (ret)
+ return -ENODEV;
+
+ platform_set_drvdata(platdev, dma);
+
+ for (i = 0; i < DMAC_MAX_CHANNELS; i++)
+ g_channel_status[i] = DMAC_CHN_VACANCY;
+
+ dev_info(&platdev->dev, "hidmac probe!\n");
+ return ret;
+}
+
+static int hi_dmac_remove(struct platform_device *platdev)
+{
+ int i;
+ struct hidmac_host *dma = platform_get_drvdata(platdev);
+
+ clk_disable_unprepare(dma->clk);
+
+ for (i = 0; i < DMAC_MAX_CHANNELS; i++)
+ g_channel_status[i] = DMAC_CHN_VACANCY;
+
+ free_dmalli_space(pllihead, 1);
+
+ return 0;
+}
+
+static int hi_dmac_suspend(struct platform_device *platdev,
+ pm_message_t state)
+{
+ int i;
+ struct hidmac_host *dma = platform_get_drvdata(platdev);
+
+ clk_prepare_enable(dma->clk);
+
+ for (i = 0; i < DMAC_MAX_CHANNELS; i++)
+ g_channel_status[i] = DMAC_CHN_VACANCY;
+
+ clk_disable_unprepare(dma->clk);
+
+ return 0;
+}
+
+static int hi_dmac_resume(struct platform_device *platdev)
+{
+ int i;
+ struct hidmac_host *dma = platform_get_drvdata(platdev);
+ unsigned int tempvalue;
+
+ clk_prepare_enable(dma->clk);
+ reset_control_deassert(dma->rstc);
+
+ dmac_readw(dma->regbase + DMAC_CONFIG, tempvalue);
+ if (tempvalue == 0) {
+ dmac_writew(dma->regbase + DMAC_CONFIG,
+ DMAC_CONFIG_VAL);
+ dmac_writew(dma->regbase + DMAC_INTTCCLEAR, 0xFF);
+ dmac_writew(dma->regbase + DMAC_INTERRCLR, 0xFF);
+ for (i = 0; i < DMAC_MAX_CHANNELS; i++) {
+ dmac_writew(dma->regbase + DMAC_CxCONFIG(i),
+ DMAC_CxDISABLE);
+ function[i] = NULL;
+ }
+ }
+
+ for (i = 0; i < DMAC_MAX_CHANNELS; i++)
+ g_channel_status[i] = DMAC_CHN_VACANCY;
+
+ return 0;
+}
+
+static const struct of_device_id hisi_dmac_dt_ids[] = {
+ { .compatible = "hisilicon,hisi-dmac"},
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, hisi_dmac_dt_ids);
+
+static struct platform_driver hisi_dmac_driver = {
+ .driver = {
+ .name = "hisi-dmac",
+ .of_match_table = hisi_dmac_dt_ids,
+ },
+ .probe = hi_dmac_probe,
+ .remove = hi_dmac_remove,
+ .suspend = hi_dmac_suspend,
+ .resume = hi_dmac_resume,
+};
+
+module_platform_driver(hisi_dmac_driver);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Hisilicon");
+MODULE_DESCRIPTION("HiSilicon DMA Controller driver");
diff --git a/drivers/hidmac/hi_pl08x.h b/drivers/hidmac/hi_pl08x.h
new file mode 100644
index 0000000..2213e3a
--- /dev/null
+++ b/drivers/hidmac/hi_pl08x.h
@@ -0,0 +1,79 @@
+/* ./drivers/hidmac/hi_dmac.h
+ *
+ *
+ * History:
+ * 17-August-2006 create this file
+ */
+#ifndef __HI_DMAC_H__
+#define __HI_DMAC_H__
+
+#define dmac_writew(addr, value)\
+ writel(value, (void *)(addr))
+#define dmac_readw(addr, v)\
+ v = readl((void *)(addr))
+
+/*#define DMA_DEBUG*/
+#ifdef DMA_DEBUG
+#define dma_debug printk
+#else
+#define dma_debug(fmt, ...) do {} while (0);
+#endif
+
+#define DMAC_CONFIGURATIONx_HALT_DMA_ENABLE (0x01L<<18)
+#define DMAC_CONFIGURATIONx_ACTIVE (0x01L<<17)
+#define DMAC_CONFIGURATIONx_CHANNEL_ENABLE 1
+#define DMAC_CONFIGURATIONx_CHANNEL_DISABLE 0
+
+/*definition for the return value*/
+#define DMAC_ERROR_BASE 100
+#define DMAC_CHANNEL_INVALID (DMAC_ERROR_BASE+1)
+
+#define DMAC_TRXFERSIZE_INVALID (DMAC_ERROR_BASE+2)
+#define DMAC_SOURCE_ADDRESS_INVALID (DMAC_ERROR_BASE+3)
+#define DMAC_DESTINATION_ADDRESS_INVALID (DMAC_ERROR_BASE+4)
+#define DMAC_MEMORY_ADDRESS_INVALID (DMAC_ERROR_BASE+5)
+#define DMAC_PERIPHERAL_ID_INVALID (DMAC_ERROR_BASE+6)
+#define DMAC_DIRECTION_ERROR (DMAC_ERROR_BASE+7)
+#define DMAC_TRXFER_ERROR (DMAC_ERROR_BASE+8)
+#define DMAC_LLIHEAD_ERROR (DMAC_ERROR_BASE+9)
+#define DMAC_SWIDTH_ERROR (DMAC_ERROR_BASE+0xa)
+#define DMAC_LLI_ADDRESS_INVALID (DMAC_ERROR_BASE+0xb)
+#define DMAC_TRANS_CONTROL_INVALID (DMAC_ERROR_BASE+0xc)
+#define DMAC_MEMORY_ALLOCATE_ERROR (DMAC_ERROR_BASE+0xd)
+#define DMAC_NOT_FINISHED (DMAC_ERROR_BASE+0xe)
+
+#define DMAC_TIMEOUT (DMAC_ERROR_BASE+0xf)
+#define DMAC_CHN_SUCCESS (DMAC_ERROR_BASE+0x10)
+#define DMAC_CHN_ERROR (DMAC_ERROR_BASE+0x11)
+#define DMAC_CHN_TIMEOUT (DMAC_ERROR_BASE+0x12)
+#define DMAC_CHN_ALLOCAT (DMAC_ERROR_BASE+0x13)
+#define DMAC_CHN_VACANCY (DMAC_ERROR_BASE+0x14)
+
+#define DMAC_CONFIGURATIONx_ACTIVE_NOT 0
+
+/*the means the bit in the channel control register*/
+#define DMAC_TRANS_SIZE 0xff0
+
+/*DMAC peripheral structure*/
+typedef struct dmac_peripheral {
+ /* peripherial ID*/
+ unsigned int peri_id;
+ /*peripheral data register address*/
+ unsigned int peri_addr;
+ /*default channel control word*/
+ unsigned int transfer_ctrl;
+ /*default channel configuration word*/
+ unsigned int transfer_cfg;
+ /*default channel configuration word*/
+ unsigned int transfer_width;
+} dmac_peripheral;
+
+typedef struct mem_addr {
+ unsigned int addr_base;
+ unsigned int size;
+} mem_addr;
+
+typedef unsigned int dma_addr_t;
+/* #define PAGE_SIZE 0x1000 */
+
+#endif /* End of #ifndef __HI_INC_ECSDMACC_H__ */
diff --git a/drivers/hidmac/hidmac_hi3536dv100.h b/drivers/hidmac/hidmac_hi3536dv100.h
new file mode 100644
index 0000000..f6efcf5
--- /dev/null
+++ b/drivers/hidmac/hidmac_hi3536dv100.h
@@ -0,0 +1,114 @@
+#ifndef __HI_DMAC_HI3516CV300_H__
+#define __HI_DMAC_HI3516CV300_H__
+
+#define DDRAM_ADRS 0x80000000 /* fixed */
+#define DDRAM_SIZE 0x1FFFFFFF /* 512M DDR. */
+
+#define FLASH_BASE 0x10000000
+#define FLASH_SIZE 0x04000000 /* (32MB) */
+
+#define DMAC_INTSTATUS 0X00
+#define DMAC_INTTCSTATUS 0X04
+#define DMAC_INTTCCLEAR 0X08
+#define DMAC_INTERRORSTATUS 0X0C
+
+#define DMAC_INTERRCLR 0X10
+#define DMAC_RAWINTTCSTATUS 0X14
+#define DMAC_RAWINTERRORSTATUS 0X18
+#define DMAC_ENBLDCHNS 0X1C
+#define DMAC_CONFIG 0X30
+#define DMAC_SYNC 0X34
+
+#define DMAC_MAXTRANSFERSIZE 0x0fff /*the max length is denoted by 0-11bit*/
+#define MAXTRANSFERSIZE DMAC_MAXTRANSFERSIZE
+#define DMAC_CxDISABLE 0x00
+#define DMAC_CxENABLE 0x01
+
+/*the definition for DMAC channel register*/
+#define DMAC_CxBASE(i) (0x100+i*0x20)
+#define DMAC_CxSRCADDR(i) DMAC_CxBASE(i)
+#define DMAC_CxDESTADDR(i) (DMAC_CxBASE(i)+0x04)
+#define DMAC_CxLLI(i) (DMAC_CxBASE(i)+0x08)
+#define DMAC_CxCONTROL(i) (DMAC_CxBASE(i)+0x0C)
+#define DMAC_CxCONFIG(i) (DMAC_CxBASE(i)+0x10)
+
+/*the means the bit in the channel control register*/
+#define DMAC_CxCONTROL_M2M 0x9d480000 /* Dwidth=32,burst size=4 */
+#define DMAC_CxCONTROL_LLIM2M 0x0f480000 /* Dwidth=32,burst size=1 */
+#define DMAC_CxCONTROL_LLIM2M_ISP 0x0b489000 /* Dwidth=32,burst size=1 */
+#define DMAC_CxLLI_LM 0x01
+
+#define NUM_HAL_INTERRUPT_DMAC (14 + 16)
+
+#define DMAC_CxCONFIG_M2M 0xc000
+#define DMAC_CxCONFIG_LLIM2M 0xc000
+
+/*#define DMAC_CxCONFIG_M2M 0x4001*/
+#define DMAC_CHANNEL_ENABLE 1
+#define DMAC_CHANNEL_DISABLE 0xfffffffe
+
+#define DMAC_CxCONTROL_P2M 0x89409000
+#define DMAC_CxCONFIG_P2M 0xd000
+
+#define DMAC_CxCONTROL_M2P 0x86089000
+#define DMAC_CxCONFIG_M2P 0xc800
+
+#define DMAC_CxCONFIG_SIO_P2M 0x0000d000
+#define DMAC_CxCONFIG_SIO_M2P 0x0000c800
+
+/*default the config and sync regsiter for DMAC controller*/
+/*M1,M2 little endian, enable DMAC*/
+#define DMAC_CONFIG_VAL 0x01
+/*enable the sync logic for the 16 peripheral*/
+#define DMAC_SYNC_VAL 0x0
+
+#define DMAC_MAX_PERIPHERALS 16
+#define MEM_MAX_NUM 2
+#define CHANNEL_NUM CONFIG_HI_DMAC_CHANNEL_NUM
+#define DMAC_MAX_CHANNELS CHANNEL_NUM
+
+#define REG_BASE_I2C0 0x120c0000
+#define I2C0_DATA_RXF (REG_BASE_I2C0 + 0x24)
+#define I2C0_DATA_TXF (REG_BASE_I2C0 + 0x20)
+
+
+#define REG_BASE_UART0 0x12080000
+#define UART0_DATA_REG (REG_BASE_UART0 + 0x0)
+
+#define REG_BASE_UART1 0x12090000
+#define UART1_DATA_REG (REG_BASE_UART1 + 0x0)
+
+#define REG_BASE_UART2 0x120a0000
+#define UART2_DATA_REG (REG_BASE_UART2 + 0x0)
+
+/*the transfer control and configuration value for different peripheral*/
+
+extern int g_channel_status[CHANNEL_NUM];
+
+dmac_peripheral g_peripheral[DMAC_MAX_PERIPHERALS] = {
+ /*periphal 0: UART0 RX, 8bit width */
+ {0, UART0_DATA_REG, 0x99000000, 0xd000, 0},
+
+ /*periphal 1: UART0 TX, 8bit width */
+ {1, UART0_DATA_REG, 0x96000000, 0xc840, 0},
+
+ /*periphal 2: UART1 RX, 8bit width */
+ {2, UART1_DATA_REG, 0x99000000, 0xd004, 0},
+
+ /*periphal 3: UART1 TX, 8bit width */
+ {3, UART1_DATA_REG, 0x96000000, 0xc8c0, 0},
+
+ /*periphal 4: UART2 RX, 8bit width */
+ {4, UART2_DATA_REG, 0x99000000, 0xd008, 0},
+
+ /*periphal 5: UART2 TX, 8bit width */
+ {5, UART2_DATA_REG, 0x96000000, 0xc940, 0},
+
+ /*periphal 6: I2C0 RX, 8bit width */
+ {6, I2C0_DATA_RXF, 0x99000000, 0xd00c, 0},
+
+ /*periphal 7: I2C0 TX, 8bit width */
+ {7, I2C0_DATA_TXF, 0x96000000, 0xc9c0, 0},
+};
+
+#endif
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index d252276..fe3f48c 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -555,6 +555,16 @@ config I2C_GPIO
This is a very simple bitbanging I2C driver utilizing the
arch-neutral GPIO API to control the SCL and SDA lines.
+config I2C_HIBVT
+ tristate "Hisilicon BVT I2C Controller"
+ depends on ARCH_HISI_BVT
+ help
+ Say Y here to include support for Hisilicon BVT I2C controller in the
+ Hisilicon BVT SoCs.
+
+ This driver can also be built as a module. If so, the module
+ will be called i2c-hibvt.
+
config I2C_HIGHLANDER
tristate "Highlander FPGA SMBus interface"
depends on SH_HIGHLANDER
@@ -1214,4 +1224,20 @@ config I2C_OPAL
This driver can also be built as a module. If so, the module will be
called as i2c-opal.
+config I2C_HISI
+ tristate "Hisilicon I2C Controller support"
+ depends on ARCH_HI3516A
+ help
+ Hisilicon I2C controller has 3 buses.
+ We can access some sensors though it.
+ This IP is only used in HI3516A chip.
+
+config DMA_MSG_LEN
+ int "Hisilicon I2C support DMA minimum LEN"
+ depends on I2C_HIBVT
+ range 1 1024
+ default 5
+ help
+ The i2c_msg minimum LEN of i2c support DMA,range from 1 to 1024
+
endmenu
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
index 29764cc..f96cde3 100644
--- a/drivers/i2c/busses/Makefile
+++ b/drivers/i2c/busses/Makefile
@@ -51,6 +51,7 @@ obj-$(CONFIG_I2C_EG20T) += i2c-eg20t.o
obj-$(CONFIG_I2C_EMEV2) += i2c-emev2.o
obj-$(CONFIG_I2C_EXYNOS5) += i2c-exynos5.o
obj-$(CONFIG_I2C_GPIO) += i2c-gpio.o
+obj-$(CONFIG_I2C_HIBVT) += i2c-hibvt.o
obj-$(CONFIG_I2C_HIGHLANDER) += i2c-highlander.o
obj-$(CONFIG_I2C_HIX5HD2) += i2c-hix5hd2.o
obj-$(CONFIG_I2C_IBM_IIC) += i2c-ibm_iic.o
@@ -122,4 +123,6 @@ obj-$(CONFIG_I2C_SIBYTE) += i2c-sibyte.o
obj-$(CONFIG_I2C_XGENE_SLIMPRO) += i2c-xgene-slimpro.o
obj-$(CONFIG_SCx200_ACB) += scx200_acb.o
+obj-$(CONFIG_I2C_HISI) += i2c-hisilicon.o
+
ccflags-$(CONFIG_I2C_DEBUG_BUS) := -DDEBUG
diff --git a/drivers/i2c/busses/i2c-hibvt.c b/drivers/i2c/busses/i2c-hibvt.c
new file mode 100644
index 0000000..83ec012
--- /dev/null
+++ b/drivers/i2c/busses/i2c-hibvt.c
@@ -0,0 +1,890 @@
+/*
+ * Hisilicon BVT I2C Controller Driver
+ *
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * Authors: wenpan@hisilicon.com
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#ifdef CONFIG_HI_DMAC
+#include
+#endif
+/*
+ * I2C Registers offsets
+ */
+#define HIBVT_I2C_GLB 0x0
+#define HIBVT_I2C_SCL_H 0x4
+#define HIBVT_I2C_SCL_L 0x8
+#define HIBVT_I2C_DEV_ADDR 0x10
+#define HIBVT_I2C_DATA1 0x14
+#define HIBVT_I2C_TXF 0x20
+#define HIBVT_I2C_RXF 0x24
+#define HIBVT_I2C_CMD_BASE 0x30
+#define HIBVT_I2C_LOOP1 0xb0
+#define HIBVT_I2C_DST1 0xb4
+#define HIBVT_I2C_TX_WATER 0xc8
+#define HIBVT_I2C_RX_WATER 0xcc
+#define HIBVT_I2C_CTRL1 0xd0
+#define HIBVT_I2C_STAT 0xd8
+#define HIBVT_I2C_INTR_RAW 0xe0
+#define HIBVT_I2C_INTR_EN 0xe4
+#define HIBVT_I2C_INTR_STAT 0xe8
+
+/*
+ * I2C Global Config Register -- HIBVT_I2C_GLB
+ */
+#define GLB_EN_MASK BIT(0)
+#define GLB_SDA_HOLD_MASK GENMASK(23, 8)
+#define GLB_SDA_HOLD_SHIFT (8)
+
+/*
+ * I2C Timing CMD Register -- HIBVT_I2C_CMD_BASE + n * 4 (n = 0, 1, 2, ... 31)
+ */
+#define CMD_EXIT 0x0
+#define CMD_TX_S 0x1
+#define CMD_TX_D1_2 0x4
+#define CMD_TX_D1_1 0x5
+#define CMD_TX_FIFO 0x9
+#define CMD_RX_FIFO 0x12
+#define CMD_RX_ACK 0x13
+#define CMD_IGN_ACK 0x15
+#define CMD_TX_ACK 0x16
+#define CMD_TX_NACK 0x17
+#define CMD_JMP1 0x18
+#define CMD_UP_TXF 0x1d
+#define CMD_TX_RS 0x1e
+#define CMD_TX_P 0x1f
+
+/*
+ * I2C Control Register 1 -- HIBVT_I2C_CTRL1
+ */
+#define CTRL1_CMD_START_MASK BIT(0)
+#define CTRL1_DMA_OP_MASK (0x3 << 8)
+#define CTRL1_DMA_R (0x3 << 8)
+#define CTRL1_DMA_W (0x2 << 8)
+
+/*
+ * I2C Status Register -- HIBVT_I2C_STAT
+ */
+#define STAT_RXF_NOE_MASK BIT(16) /* RX FIFO not empty flag */
+#define STAT_TXF_NOF_MASK BIT(19) /* TX FIFO not full flag */
+
+
+/*
+ * I2C Interrupt status and mask Register --
+ * HIBVT_I2C_INTR_RAW, HIBVT_I2C_STAT, HIBVT_I2C_INTR_STAT
+ */
+#define INTR_ABORT_MASK (BIT(0) | BIT(11))
+#define INTR_RX_MASK BIT(2)
+#define INTR_TX_MASK BIT(4)
+#define INTR_CMD_DONE_MASK BIT(12)
+#define INTR_USE_MASK (INTR_ABORT_MASK \
+ |INTR_RX_MASK \
+ | INTR_TX_MASK \
+ | INTR_CMD_DONE_MASK)
+#define INTR_ALL_MASK GENMASK(31, 0)
+
+#define I2C_DEFAULT_FREQUENCY 100000
+#define I2C_TXF_DEPTH 64
+#define I2C_RXF_DEPTH 64
+#define I2C_TXF_WATER 32
+#define I2C_RXF_WATER 32
+#define I2C_WAIT_TIMEOUT 0x10000
+#define I2C_IRQ_TIMEOUT (msecs_to_jiffies(1000))
+
+
+struct hibvt_i2c_dev {
+ struct device *dev;
+ struct i2c_adapter adap;
+ resource_size_t phybase;
+ void __iomem *base;
+ struct clk *clk;
+ int irq;
+
+ unsigned int freq;
+ struct i2c_msg *msg;
+ unsigned int msg_num;
+ unsigned int msg_idx;
+ unsigned int msg_buf_ptr;
+ struct completion msg_complete;
+
+ spinlock_t lock;
+ int status;
+};
+
+static inline void hibvt_i2c_disable(struct hibvt_i2c_dev *i2c)
+{
+ unsigned int val;
+
+ val = readl(i2c->base + HIBVT_I2C_GLB);
+ val &= ~GLB_EN_MASK;
+ writel(val, i2c->base + HIBVT_I2C_GLB);
+}
+
+static inline void hibvt_i2c_enable(struct hibvt_i2c_dev *i2c)
+{
+ unsigned int val;
+
+ val = readl(i2c->base + HIBVT_I2C_GLB);
+ val |= GLB_EN_MASK;
+ writel(val, i2c->base + HIBVT_I2C_GLB);
+}
+
+static inline void hibvt_i2c_cfg_irq(struct hibvt_i2c_dev *i2c,
+ unsigned int flag)
+{
+ writel(flag, i2c->base + HIBVT_I2C_INTR_EN);
+}
+
+static inline void hibvt_i2c_disable_irq(struct hibvt_i2c_dev *i2c,
+ unsigned int flag)
+{
+ unsigned int val;
+
+ val = readl(i2c->base + HIBVT_I2C_INTR_EN);
+ val &= ~flag;
+ writel(val, i2c->base + HIBVT_I2C_INTR_EN);
+}
+
+static inline unsigned int hibvt_i2c_clr_irq(struct hibvt_i2c_dev *i2c)
+{
+ unsigned int val;
+
+ val = readl(i2c->base + HIBVT_I2C_INTR_STAT);
+ writel(INTR_ALL_MASK, i2c->base + HIBVT_I2C_INTR_RAW);
+
+ return val;
+}
+
+static inline void hibvt_i2c_cmdreg_set(struct hibvt_i2c_dev *i2c,
+ unsigned int cmd, unsigned int *offset)
+{
+ dev_dbg(i2c->dev, "hii2c reg: offset=0x%x, cmd=0x%x...\n",
+ *offset * 4, cmd);
+ writel(cmd, i2c->base + HIBVT_I2C_CMD_BASE + *offset * 4);
+ (*offset)++;
+}
+
+/*
+ * config i2c slave addr
+ */
+static inline void hibvt_i2c_set_addr(struct hibvt_i2c_dev *i2c)
+{
+ struct i2c_msg *msg = i2c->msg;
+ u16 addr;
+
+ if (msg->flags & I2C_M_TEN) {
+ /* First byte is 11110XX0 where XX is upper 2 bits */
+ addr = ((msg->addr & 0x300) << 1) | 0xf000;
+ if (msg->flags & I2C_M_RD)
+ addr |= 1 << 8;
+
+ /* Second byte is the remaining 8 bits */
+ addr |= msg->addr & 0xff;
+ } else {
+ addr = (msg->addr & 0x7f) << 1;
+ if (msg->flags & I2C_M_RD)
+ addr |= 1;
+ }
+
+ writel(addr, i2c->base + HIBVT_I2C_DEV_ADDR);
+}
+
+/*
+ * Start command sequence
+ */
+static inline void hibvt_i2c_start_cmd(struct hibvt_i2c_dev *i2c)
+{
+ unsigned int val;
+
+ val = readl(i2c->base + HIBVT_I2C_CTRL1);
+ val |= CTRL1_CMD_START_MASK;
+ writel(val, i2c->base + HIBVT_I2C_CTRL1);
+}
+
+static int hibvt_i2c_wait_rx_noempty(struct hibvt_i2c_dev *i2c)
+{
+ unsigned int time_cnt = 0;
+ unsigned int val;
+
+ do {
+ val = readl(i2c->base + HIBVT_I2C_STAT);
+ if (val & STAT_RXF_NOE_MASK)
+ return 0;
+
+ udelay(50);
+ } while (time_cnt++ < I2C_WAIT_TIMEOUT);
+
+ dev_err(i2c->dev, "wait rx no empty timeout, RIS: 0x%x, SR: 0x%x\n",
+ readl(i2c->base + HIBVT_I2C_INTR_RAW), val);
+ return -EIO;
+}
+
+static int hibvt_i2c_wait_tx_nofull(struct hibvt_i2c_dev *i2c)
+{
+ unsigned int time_cnt = 0;
+ unsigned int val;
+
+ do {
+ val = readl(i2c->base + HIBVT_I2C_STAT);
+ if (val & STAT_TXF_NOF_MASK)
+ return 0;
+
+ udelay(50);
+ } while (time_cnt++ < I2C_WAIT_TIMEOUT);
+
+ dev_err(i2c->dev, "wait rx no empty timeout, RIS: 0x%x, SR: 0x%x\n",
+ readl(i2c->base + HIBVT_I2C_INTR_RAW), val);
+ return -EIO;
+}
+
+static int hibvt_i2c_wait_idle(struct hibvt_i2c_dev *i2c)
+{
+ unsigned int time_cnt = 0;
+ unsigned int val;
+
+ do {
+ val = readl(i2c->base + HIBVT_I2C_INTR_RAW);
+ if (val & (INTR_ABORT_MASK)) {
+ dev_err(i2c->dev, "wait idle abort!, RIS: 0x%x\n",
+ val);
+ return -EIO;
+ }
+
+ if (val & INTR_CMD_DONE_MASK)
+ return 0;
+
+ udelay(50);
+ } while (time_cnt++ < I2C_WAIT_TIMEOUT);
+
+ dev_err(i2c->dev, "wait idle timeout, RIS: 0x%x, SR: 0x%x\n",
+ val, readl(i2c->base + HIBVT_I2C_STAT));
+
+ return -EIO;
+}
+
+static void hibvt_i2c_set_freq(struct hibvt_i2c_dev *i2c)
+{
+ unsigned int max_freq, freq;
+ unsigned int clk_rate;
+ unsigned int val, sda_hold;
+
+ freq = i2c->freq;
+ clk_rate = clk_get_rate(i2c->clk);
+ max_freq = clk_rate >> 1;
+
+ if (freq > max_freq) {
+ i2c->freq = max_freq;
+ freq = i2c->freq;
+ }
+
+ if (freq <= 100000) {
+ val = clk_rate / (freq * 2) - 1;
+ writel(val, i2c->base + HIBVT_I2C_SCL_H);
+ writel(val, i2c->base + HIBVT_I2C_SCL_L);
+ } else {
+ val = (clk_rate * 36) / (freq * 100);
+ writel(val, i2c->base + HIBVT_I2C_SCL_H);
+ val = (clk_rate * 64) / (freq * 100);
+ writel(val, i2c->base + HIBVT_I2C_SCL_L);
+ }
+
+ sda_hold = (0xa << GLB_SDA_HOLD_SHIFT) & GLB_SDA_HOLD_MASK;
+ val = readl(i2c->base + HIBVT_I2C_GLB);
+ val &= ~GLB_SDA_HOLD_MASK;
+ val |= sda_hold;
+ writel(val, i2c->base + HIBVT_I2C_GLB);
+}
+
+/*
+ * set i2c controller TX and RX FIFO water
+ */
+static inline void hibvt_i2c_set_water(struct hibvt_i2c_dev *i2c)
+{
+ writel(I2C_TXF_WATER, i2c->base + HIBVT_I2C_TX_WATER);
+ writel(I2C_RXF_WATER, i2c->base + HIBVT_I2C_RX_WATER);
+}
+
+/*
+ * initialise the controller, set i2c bus interface freq
+ */
+static void hibvt_i2c_hw_init(struct hibvt_i2c_dev *i2c)
+{
+ hibvt_i2c_disable(i2c);
+ hibvt_i2c_disable_irq(i2c, INTR_ALL_MASK);
+ hibvt_i2c_set_freq(i2c);
+ hibvt_i2c_set_water(i2c);
+}
+
+/*
+ * hibvt_i2c_cfg_cmd - config i2c controller command sequence
+ *
+ * After all the timing command is configured,
+ * and then start the command, you can i2c communication,
+ * and then only need to read and write i2c fifo.
+ */
+static void hibvt_i2c_cfg_cmd(struct hibvt_i2c_dev *i2c)
+{
+ struct i2c_msg *msg = i2c->msg;
+ int offset = 0;
+
+ if (i2c->msg_idx == 0)
+ hibvt_i2c_cmdreg_set(i2c, CMD_TX_S, &offset);
+ else
+ hibvt_i2c_cmdreg_set(i2c, CMD_TX_RS, &offset);
+
+ if (msg->flags & I2C_M_TEN) {
+ if (i2c->msg_idx == 0) {
+ hibvt_i2c_cmdreg_set(i2c, CMD_TX_D1_2, &offset);
+ hibvt_i2c_cmdreg_set(i2c, CMD_TX_D1_1, &offset);
+ } else {
+ hibvt_i2c_cmdreg_set(i2c, CMD_TX_D1_2, &offset);
+ }
+ } else {
+ hibvt_i2c_cmdreg_set(i2c, CMD_TX_D1_1, &offset);
+ }
+
+ if (msg->flags & I2C_M_IGNORE_NAK)
+ hibvt_i2c_cmdreg_set(i2c, CMD_IGN_ACK, &offset);
+ else
+ hibvt_i2c_cmdreg_set(i2c, CMD_RX_ACK, &offset);
+
+ if (msg->flags & I2C_M_RD) {
+ if (msg->len >= 2) {
+ writel(offset, i2c->base + HIBVT_I2C_DST1);
+ writel(msg->len - 2, i2c->base + HIBVT_I2C_LOOP1);
+ hibvt_i2c_cmdreg_set(i2c, CMD_RX_FIFO, &offset);
+ hibvt_i2c_cmdreg_set(i2c, CMD_TX_ACK, &offset);
+ hibvt_i2c_cmdreg_set(i2c, CMD_JMP1, &offset);
+ }
+ hibvt_i2c_cmdreg_set(i2c, CMD_RX_FIFO, &offset);
+ hibvt_i2c_cmdreg_set(i2c, CMD_TX_NACK, &offset);
+ } else {
+ writel(offset, i2c->base + HIBVT_I2C_DST1);
+ writel(msg->len - 1, i2c->base + HIBVT_I2C_LOOP1);
+ hibvt_i2c_cmdreg_set(i2c, CMD_UP_TXF, &offset);
+ hibvt_i2c_cmdreg_set(i2c, CMD_TX_FIFO, &offset);
+
+ if (msg->flags & I2C_M_IGNORE_NAK)
+ hibvt_i2c_cmdreg_set(i2c, CMD_IGN_ACK, &offset);
+ else
+ hibvt_i2c_cmdreg_set(i2c, CMD_RX_ACK, &offset);
+
+ hibvt_i2c_cmdreg_set(i2c, CMD_JMP1, &offset);
+ }
+
+ if ((i2c->msg_idx == (i2c->msg_num - 1)) || (msg->flags & I2C_M_STOP)) {
+ dev_dbg(i2c->dev, "run to %s %d...TX STOP\n",
+ __func__, __LINE__);
+ hibvt_i2c_cmdreg_set(i2c, CMD_TX_P, &offset);
+ }
+
+ hibvt_i2c_cmdreg_set(i2c, CMD_EXIT, &offset);
+}
+
+#ifdef CONFIG_HI_DMAC
+int dma_to_i2c(unsigned long src, unsigned int dst, unsigned int length)
+{
+ int chan;
+
+ chan = do_dma_m2p(src, dst, length);
+ if (chan == -1)
+ pr_err("dma_to_i2c error\n");
+
+ return chan;
+}
+
+int i2c_to_dma(unsigned int src, unsigned long dst,
+ unsigned int length)
+{
+ int chan;
+
+ chan = do_dma_p2m(dst, src, length);
+ if (chan == -1)
+ pr_err("dma_p2m error...\n");
+
+ return chan;
+}
+
+static int hibvt_i2c_do_dma_write(struct hibvt_i2c_dev *i2c,
+ unsigned long dma_dst_addr)
+{
+ int chan, val, status = 0;
+ struct i2c_msg *msg = i2c->msg;
+
+ hibvt_i2c_set_freq(i2c);
+ writel(0x1, i2c->base + HIBVT_I2C_TX_WATER);
+ hibvt_i2c_enable(i2c);
+ hibvt_i2c_clr_irq(i2c);
+ hibvt_i2c_set_addr(i2c);
+ hibvt_i2c_cfg_cmd(i2c);
+
+ val = readl(i2c->base + HIBVT_I2C_CTRL1);
+ val &= ~CTRL1_DMA_OP_MASK;
+ val |= CTRL1_DMA_W | CTRL1_CMD_START_MASK;
+ writel(val, i2c->base + HIBVT_I2C_CTRL1);
+
+ /* transmit DATA from DMAC to I2C in DMA mode */
+ chan = dma_to_i2c(dma_dst_addr, (i2c->phybase + HIBVT_I2C_TXF),
+ msg->len);
+ if (chan == -1) {
+ status = -1;
+ goto end;
+ }
+ status = hibvt_i2c_wait_idle(i2c);
+end:
+ dmac_channelclose(chan);
+ dmac_channel_free(chan);
+ hibvt_i2c_disable(i2c);
+
+ return status;
+}
+
+static int hibvt_i2c_do_dma_read(struct hibvt_i2c_dev *i2c,
+ unsigned long dma_dst_addr)
+{
+ unsigned int val, chan, status = 0;
+ struct i2c_msg *msg = i2c->msg;
+
+ hibvt_i2c_set_freq(i2c);
+ writel(0x0, i2c->base + HIBVT_I2C_RX_WATER);
+ hibvt_i2c_enable(i2c);
+ hibvt_i2c_clr_irq(i2c);
+ hibvt_i2c_set_addr(i2c);
+ hibvt_i2c_cfg_cmd(i2c);
+
+ val = readl(i2c->base + HIBVT_I2C_CTRL1);
+ val &= ~CTRL1_DMA_OP_MASK;
+ val |= CTRL1_CMD_START_MASK | CTRL1_DMA_R;
+ writel(val, i2c->base + HIBVT_I2C_CTRL1);
+ /* transmit DATA from I2C to DMAC in DMA mode */
+ chan = i2c_to_dma((i2c->phybase + HIBVT_I2C_RXF),
+ dma_dst_addr, msg->len);
+ if (chan == -1) {
+ status = -1;
+ goto end;
+ }
+ status = hibvt_i2c_wait_idle(i2c);
+end:
+ dmac_channelclose(chan);
+ dmac_channel_free(chan);
+ hibvt_i2c_disable(i2c);
+
+ return status;
+}
+#else
+static int hibvt_i2c_do_dma_write(struct hibvt_i2c_dev *i2c,
+ unsigned int dma_dst_addr)
+{
+ dev_err(i2c->dev, "DMA is not enabled!");
+ return -1;
+}
+
+static int hibvt_i2c_do_dma_read(struct hibvt_i2c_dev *i2c,
+ unsigned int dma_dst_addr)
+{
+ dev_err(i2c->dev, "DMA is not enabled!");
+ return -1;
+}
+#endif
+static int hibvt_i2c_dma_xfer_one_msg(struct hibvt_i2c_dev *i2c)
+{
+ unsigned int status;
+ struct i2c_msg *msg = i2c->msg;
+ dma_addr_t dma_dst_addr;
+
+
+ dev_dbg(i2c->dev, "[%s,%d]msg->flags=0x%x, len=0x%x\n",
+ __func__, __LINE__, msg->flags, msg->len);
+
+ if (msg->flags & I2C_M_RD){
+ dma_dst_addr = dma_map_single(i2c->dev, msg->buf,
+ msg->len, DMA_FROM_DEVICE);
+ if (dma_mapping_error(i2c->dev, dma_dst_addr)) {
+ dev_err(i2c->dev, "DMA mapping failed\n");
+ return -EINVAL;
+ }
+
+ status = hibvt_i2c_do_dma_read(i2c, dma_dst_addr);
+
+ dma_unmap_single(i2c->dev, dma_dst_addr, msg->len, DMA_FROM_DEVICE);
+
+ } else {
+ dma_dst_addr = dma_map_single(i2c->dev, msg->buf,
+ msg->len, DMA_TO_DEVICE);
+
+ if (dma_mapping_error(i2c->dev, dma_dst_addr)){
+ dev_err(i2c->dev, "DMA mapping failed\n");
+ return -EINVAL;
+ }
+
+ status = hibvt_i2c_do_dma_write(i2c, dma_dst_addr);
+ dma_unmap_single(i2c->dev, dma_dst_addr, msg->len, DMA_TO_DEVICE);
+ }
+ status = hibvt_i2c_wait_idle(i2c);
+ hibvt_i2c_disable(i2c);
+
+ return status;
+}
+static int hibvt_i2c_polling_xfer_one_msg(struct hibvt_i2c_dev *i2c)
+{
+ int status;
+ unsigned int val;
+ struct i2c_msg *msg = i2c->msg;
+
+ dev_dbg(i2c->dev, "[%s,%d]msg->flags=0x%x, len=0x%x\n",
+ __func__, __LINE__, msg->flags, msg->len);
+
+ hibvt_i2c_enable(i2c);
+ hibvt_i2c_clr_irq(i2c);
+ hibvt_i2c_set_addr(i2c);
+ hibvt_i2c_cfg_cmd(i2c);
+ hibvt_i2c_start_cmd(i2c);
+
+ i2c->msg_buf_ptr = 0;
+
+ if (msg->flags & I2C_M_RD) {
+ while (i2c->msg_buf_ptr < msg->len) {
+ status = hibvt_i2c_wait_rx_noempty(i2c);
+ if (status)
+ goto end;
+
+ val = readl(i2c->base + HIBVT_I2C_RXF);
+ msg->buf[i2c->msg_buf_ptr] = val;
+ i2c->msg_buf_ptr++;
+
+ }
+ } else {
+ while (i2c->msg_buf_ptr < msg->len) {
+ status = hibvt_i2c_wait_tx_nofull(i2c);
+ if (status)
+ goto end;
+
+ val = msg->buf[i2c->msg_buf_ptr];
+ writel(val, i2c->base + HIBVT_I2C_TXF);
+ i2c->msg_buf_ptr++;
+ }
+ }
+
+ status = hibvt_i2c_wait_idle(i2c);
+end:
+ hibvt_i2c_disable(i2c);
+
+ return status;
+}
+
+static irqreturn_t hibvt_i2c_isr(int irq, void *dev_id)
+{
+ struct hibvt_i2c_dev *i2c = dev_id;
+ unsigned int irq_status;
+ struct i2c_msg *msg = i2c->msg;
+
+ spin_lock(&i2c->lock);
+
+ irq_status = hibvt_i2c_clr_irq(i2c);
+ dev_dbg(i2c->dev, "%s RIS: 0x%x\n", __func__, irq_status);
+
+ if (!irq_status) {
+ dev_dbg(i2c->dev, "no irq\n");
+ goto end;
+ }
+
+ if (irq_status & INTR_ABORT_MASK) {
+ dev_err(i2c->dev, "irq handle abort, RIS: 0x%x\n",
+ irq_status);
+ i2c->status = -EIO;
+ hibvt_i2c_disable_irq(i2c, INTR_ALL_MASK);
+
+ complete(&i2c->msg_complete);
+ goto end;
+ }
+
+ if (msg->flags & I2C_M_RD) {
+ while ((readl(i2c->base + HIBVT_I2C_STAT) & STAT_RXF_NOE_MASK)
+ && (i2c->msg_buf_ptr < msg->len)) {
+ msg->buf[i2c->msg_buf_ptr] =
+ readl(i2c->base + HIBVT_I2C_RXF);
+ i2c->msg_buf_ptr++;
+ }
+ } else {
+ while ((readl(i2c->base + HIBVT_I2C_STAT) & STAT_TXF_NOF_MASK)
+ && (i2c->msg_buf_ptr < msg->len)) {
+ writel(msg->buf[i2c->msg_buf_ptr],
+ i2c->base + HIBVT_I2C_TXF);
+ i2c->msg_buf_ptr++;
+ }
+ }
+
+ if (i2c->msg_buf_ptr >= msg->len)
+ hibvt_i2c_disable_irq(i2c, INTR_TX_MASK | INTR_RX_MASK);
+
+ if (irq_status & INTR_CMD_DONE_MASK) {
+ dev_dbg(i2c->dev, "cmd done\n");
+ i2c->status = 0;
+ hibvt_i2c_disable_irq(i2c, INTR_ALL_MASK);
+
+ complete(&i2c->msg_complete);
+ }
+
+end:
+ spin_unlock(&i2c->lock);
+
+ return IRQ_HANDLED;
+}
+
+static int hibvt_i2c_interrupt_xfer_one_msg(struct hibvt_i2c_dev *i2c)
+{
+ int status;
+ struct i2c_msg *msg = i2c->msg;
+ unsigned long timeout;
+ unsigned long flags;
+
+ dev_dbg(i2c->dev, "[%s,%d]msg->flags=0x%x, len=0x%x\n",
+ __func__, __LINE__, msg->flags, msg->len);
+
+ reinit_completion(&i2c->msg_complete);
+ i2c->msg_buf_ptr = 0;
+ i2c->status = -EIO;
+
+ spin_lock_irqsave(&i2c->lock, flags);
+ hibvt_i2c_enable(i2c);
+ hibvt_i2c_clr_irq(i2c);
+ if (msg->flags & I2C_M_RD)
+ hibvt_i2c_cfg_irq(i2c, INTR_USE_MASK & ~INTR_TX_MASK);
+ else
+ hibvt_i2c_cfg_irq(i2c, INTR_USE_MASK & ~INTR_RX_MASK);
+
+ hibvt_i2c_set_addr(i2c);
+ hibvt_i2c_cfg_cmd(i2c);
+ hibvt_i2c_start_cmd(i2c);
+ spin_unlock_irqrestore(&i2c->lock, flags);
+
+ timeout = wait_for_completion_timeout(&i2c->msg_complete,
+ I2C_IRQ_TIMEOUT);
+
+ if (timeout == 0) {
+ hibvt_i2c_disable_irq(i2c, INTR_ALL_MASK);
+ status = -EIO;
+ dev_err(i2c->dev, "%s timeout\n",
+ msg->flags & I2C_M_RD ? "rx" : "tx");
+ } else {
+ status = i2c->status;
+ }
+
+ hibvt_i2c_disable(i2c);
+
+ return status;
+}
+
+/*
+ * Master transfer function
+ */
+static int hibvt_i2c_xfer(struct i2c_adapter *adap,
+ struct i2c_msg *msgs, int num)
+{
+ struct hibvt_i2c_dev *i2c = i2c_get_adapdata(adap);
+ int status;
+
+ if (!msgs) {
+ dev_err(i2c->dev, "msgs == NULL\n");
+ return -EIO;
+ }
+
+ i2c->msg = msgs;
+ i2c->msg_num = num;
+ i2c->msg_idx = 0;
+
+ while (i2c->msg_idx < i2c->msg_num) {
+ if (i2c->msg->len > CONFIG_DMA_MSG_LEN ) {
+ status = hibvt_i2c_dma_xfer_one_msg(i2c);
+ if (status)
+ break;
+ }else if (i2c->irq >= 0) {
+ status = hibvt_i2c_interrupt_xfer_one_msg(i2c);
+
+ if (status)
+ break;
+ }else {
+ status = hibvt_i2c_polling_xfer_one_msg(i2c);
+ if (status)
+ break;
+ }
+ i2c->msg++;
+ i2c->msg_idx++;
+ }
+
+ if (!status || i2c->msg_idx > 0)
+ status = i2c->msg_idx;
+
+ return status;
+}
+
+static u32 hibvt_i2c_func(struct i2c_adapter *adap)
+{
+ return I2C_FUNC_I2C | I2C_FUNC_10BIT_ADDR
+ | I2C_FUNC_PROTOCOL_MANGLING;
+}
+
+static const struct i2c_algorithm hibvt_i2c_algo = {
+ .master_xfer = hibvt_i2c_xfer,
+ .functionality = hibvt_i2c_func,
+};
+
+static int hibvt_i2c_probe(struct platform_device *pdev)
+{
+ int status;
+ struct hibvt_i2c_dev *i2c;
+ struct i2c_adapter *adap;
+ struct resource *res;
+
+ i2c = devm_kzalloc(&pdev->dev, sizeof(*i2c), GFP_KERNEL);
+ if (!i2c)
+ return -ENOMEM;
+
+ platform_set_drvdata(pdev, i2c);
+ i2c->dev = &pdev->dev;
+ spin_lock_init(&i2c->lock);
+ init_completion(&i2c->msg_complete);
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ i2c->phybase = res->start;
+ i2c->base = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(i2c->base)) {
+ dev_err(i2c->dev, "cannot ioremap resource\n");
+ return -ENOMEM;
+ }
+
+ i2c->clk = devm_clk_get(&pdev->dev, NULL);
+ if (IS_ERR(i2c->clk)) {
+ dev_err(i2c->dev, "cannot get clock\n");
+ return -ENOENT;
+ }
+ clk_prepare_enable(i2c->clk);
+
+ if (of_property_read_u32(pdev->dev.of_node, "clock-frequency",
+ &i2c->freq)) {
+ dev_warn(i2c->dev, "setting default clock-frequency@%dHz\n",
+ I2C_DEFAULT_FREQUENCY);
+ i2c->freq = I2C_DEFAULT_FREQUENCY;
+ }
+
+ /* i2c controller initialization, disable interrupt */
+ hibvt_i2c_hw_init(i2c);
+
+ i2c->irq = platform_get_irq(pdev, 0);
+ status = devm_request_irq(&pdev->dev, i2c->irq, hibvt_i2c_isr,
+ IRQF_SHARED, dev_name(&pdev->dev), i2c);
+ if (status) {
+ dev_dbg(i2c->dev, "falling back to polling mode");
+ i2c->irq = -1;
+ }
+
+ adap = &i2c->adap;
+ i2c_set_adapdata(adap, i2c);
+ adap->owner = THIS_MODULE;
+ strlcpy(adap->name, "hibvt-i2c", sizeof(adap->name));
+ adap->dev.parent = &pdev->dev;
+ adap->dev.of_node = pdev->dev.of_node;
+ adap->algo = &hibvt_i2c_algo;
+
+ /* Add the i2c adapter */
+ status = i2c_add_adapter(adap);
+ if (status) {
+ dev_err(i2c->dev, "failed to add bus to i2c core\n");
+ goto err_add_adapter;
+ }
+
+ dev_info(i2c->dev, "%s%d@%dhz registered\n",
+ adap->name, adap->nr, i2c->freq);
+
+ return 0;
+
+err_add_adapter:
+ clk_disable_unprepare(i2c->clk);
+ return status;
+}
+
+static int hibvt_i2c_remove(struct platform_device *pdev)
+{
+ struct hibvt_i2c_dev *i2c = platform_get_drvdata(pdev);
+
+ clk_disable_unprepare(i2c->clk);
+ i2c_del_adapter(&i2c->adap);
+
+ return 0;
+}
+
+#ifdef CONFIG_PM_SLEEP
+static int hibvt_i2c_suspend(struct device *dev)
+{
+ struct hibvt_i2c_dev *i2c = dev_get_drvdata(dev);
+
+ i2c_lock_adapter(&i2c->adap);
+ clk_disable_unprepare(i2c->clk);
+ i2c_unlock_adapter(&i2c->adap);
+
+ return 0;
+}
+
+static int hibvt_i2c_resume(struct device *dev)
+{
+ struct hibvt_i2c_dev *i2c = dev_get_drvdata(dev);
+
+ i2c_lock_adapter(&i2c->adap);
+ clk_prepare_enable(i2c->clk);
+ hibvt_i2c_hw_init(i2c);
+ i2c_unlock_adapter(&i2c->adap);
+
+ return 0;
+}
+#endif
+
+static SIMPLE_DEV_PM_OPS(hibvt_i2c_dev_pm, hibvt_i2c_suspend,
+ hibvt_i2c_resume);
+
+static const struct of_device_id hibvt_i2c_match[] = {
+ { .compatible = "hisilicon,hibvt-i2c"},
+ { .compatible = "hisilicon,hi3516cv300-i2c"},
+ { .compatible = "hisilicon,hi3536dv100-i2c"},
+ {},
+};
+MODULE_DEVICE_TABLE(of, hibvt_i2c_match);
+
+static struct platform_driver hibvt_i2c_driver = {
+ .driver = {
+ .name = "hibvt-i2c",
+ .of_match_table = hibvt_i2c_match,
+ .pm = &hibvt_i2c_dev_pm,
+ },
+ .probe = hibvt_i2c_probe,
+ .remove = hibvt_i2c_remove,
+};
+
+module_platform_driver(hibvt_i2c_driver);
+
+MODULE_AUTHOR("Pan Wen, ");
+MODULE_DESCRIPTION("HISILICON BVT I2C Bus driver");
+MODULE_LICENSE("GPL v2");
diff --git a/drivers/i2c/busses/i2c-hisilicon.c b/drivers/i2c/busses/i2c-hisilicon.c
new file mode 100644
index 0000000..71424e8
--- /dev/null
+++ b/drivers/i2c/busses/i2c-hisilicon.c
@@ -0,0 +1,1001 @@
+/*
+ * HiSilicon I2C-HISI-V100 Controller Driver
+ *
+ * Copyright (c) 2016-2017 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include "i2c-hisilicon.h"
+#include
+#include
+
+#ifdef CONFIG_HI_DMAC
+#include
+#endif
+
+#define I2C_HISI "hisi_i2c"
+
+#ifdef CONFIG_ARCH_HI3516A
+#include
+#endif
+
+#define hi_err(x...) \
+ do { \
+ pr_alert("%s->%d: ", __func__, __LINE__); \
+ pr_alert(x); \
+ pr_alert("\n"); \
+ } while (0)
+
+/* #define HI_I2C_DEBUG */
+
+#ifdef HI_I2C_DEBUG
+
+#define hi_msg(x...) \
+ do { \
+ pr_alert("%s (line:%d) ", __func__, __LINE__); \
+ pr_alert(x); \
+ } while (0)
+#else
+#define hi_msg(args...) do { } while (0)
+#endif
+
+#define I2C_WAIT_TIME_OUT 20000
+
+#define I2C_DFT_RATE (100000)
+
+struct hi_i2c {
+ unsigned char __iomem *regbase;
+ struct device *dev;
+ struct resource *mem;
+ struct clk *clk;
+ unsigned int irq;
+ struct i2c_adapter adap;
+ struct i2c_msg *msg;
+ struct hi_platform_i2c *pdata;
+ unsigned int g_last_dev_addr;
+ unsigned int g_last_mode;
+};
+
+static int hi_i2c_abortprocess(struct hi_i2c *pinfo)
+{
+ unsigned int auto_status;
+ unsigned int tx_src;
+
+ tx_src = readl(pinfo->regbase + I2C_TX_ABRT_SRC);
+ hi_err("tx_abrt_src is %x.\n", tx_src);
+
+ auto_status = readl(pinfo->regbase + I2C_AUTO_REG);
+
+ /* clear 0xB0 err status */
+ /* auto_mst_tx_abrt_clr
+ auto_tx_cmd_fifo_over_clr
+ auto_rx_cmd_fifo_under_clr
+ auto_rx_cmd_fifo_over_clr
+ */
+ auto_status |= 0x0f000000;
+ writel(auto_status, pinfo->regbase + I2C_AUTO_REG);
+ writel(0x1, pinfo->regbase + I2C_CLR_INTR_REG);
+
+ /* disable i2c */
+ writel(0, pinfo->regbase + I2C_ENABLE_REG);
+
+ /* enable i2c */
+ writel(0x1, pinfo->regbase + I2C_ENABLE_REG);
+
+ return 0;
+}
+
+void hi_i2c_set_rate(struct hi_i2c *pinfo)
+{
+ unsigned int apb_clk, scl_h, scl_l, hold;
+
+ /* get apb bus clk for diff plat */
+ apb_clk = clk_get_rate(pinfo->clk);
+
+ /* set SCLH and SCLL depend on apb_clk and def_rate */
+ if (pinfo->pdata->clk_limit <= I2C_DFT_RATE) {
+ /* in normal mode F_scl: def_rate
+ i2c_scl_hcnt = (F_i2c / F_scl) * 0.5
+ i2c_scl_hcnt = (F_i2c / F_scl) * 0.5
+ */
+ scl_h = (apb_clk / I2C_DFT_RATE) / 2;
+ scl_l = scl_h;
+ } else {
+ /* in fast mode F_scl: def_rate
+ i2c_scl_hcnt = (F_i2c / F_scl) * 0.36
+ i2c_scl_hcnt = (F_i2c / F_scl) * 0.64
+ */
+ scl_h = ((apb_clk / 100) * 36) / pinfo->pdata->clk_limit;
+ scl_l = ((apb_clk / 100) * 64) / pinfo->pdata->clk_limit;
+ }
+
+ writel(scl_h, pinfo->regbase + I2C_SCL_H_REG);
+ writel(scl_l, pinfo->regbase + I2C_SCL_L_REG);
+
+ /* set hi_i2c hold time */
+ hold = scl_h / 2;
+ writel(hold, pinfo->regbase + I2C_SDA_HOLD_REG);
+}
+
+void hi_i2c_hw_init(struct hi_i2c *pinfo)
+{
+ unsigned int temp, rx_fifo, tx_fifo;
+
+ /* unlock hi_i2c controller to access */
+ writel(HI_I2C_UNLOCK_VALUE, pinfo->regbase + I2C_LOCK_REG);
+
+ /* disable hi_i2c controller */
+ temp = readl(pinfo->regbase + I2C_ENABLE_REG);
+ writel((temp & ~HI_I2C_ENABLE), pinfo->regbase + I2C_ENABLE_REG);
+
+ /* disable hi_i2c auto_mode */
+ writel(HI_I2C_AUTO_MODE_OFF, pinfo->regbase + I2C_AUTO_REG);
+
+ /* set hi_i2c in fast mode */
+ writel(HI_I2C_FAST_MODE, pinfo->regbase + I2C_CON_REG);
+
+ /* set hi_i2c rate */
+ hi_i2c_set_rate(pinfo);
+
+ rx_fifo = HI_I2C_RX_FIFO;
+ tx_fifo = HI_I2C_TX_FIFO;
+
+ /* set hi_i2c fifo */
+ writel(rx_fifo, pinfo->regbase + I2C_RX_TL_REG);
+ writel(tx_fifo, pinfo->regbase + I2C_TX_TL_REG);
+
+ /* enable interrupt mask */
+ writel(DISABLE_ALL_INTERRUPTS, pinfo->regbase + I2C_INTR_MASK_REG);
+
+ /* enable hi_i2c controller */
+ temp = readl(pinfo->regbase + I2C_ENABLE_REG);
+ writel((temp | HI_I2C_ENABLE), pinfo->regbase + I2C_ENABLE_REG);
+
+ pinfo->g_last_dev_addr = 0;
+ pinfo->g_last_mode = I2C_MODE_NONE;
+
+ pinfo->msg = NULL;
+}
+
+int hi_i2c_wait_idle(struct hi_i2c *pinfo)
+{
+ unsigned int val;
+ unsigned int time_cnt;
+
+ time_cnt = 0;
+ do {
+ val = readl(pinfo->regbase + I2C_INTR_RAW_REG);
+ if (val & I2C_RAW_TX_ABORT) {
+ hi_err("wait last i2c fifo is empty abort! "\
+ "int_raw_status: %#x!\n", val);
+ return hi_i2c_abortprocess(pinfo);
+ }
+
+ val = readl(pinfo->regbase + I2C_AUTO_REG);
+ if (!IS_RX_FIFO_EMPTY(val))
+ readl(pinfo->regbase + I2C_TX_RX_REG);
+
+ if (IS_FIFO_EMPTY(val))
+ break;
+
+ if (time_cnt > I2C_WAIT_TIME_OUT) {
+ hi_err("wait last i2c fifo is empty timeout! "\
+ "auto_status: %#x\n", val);
+ return -EBUSY;
+ }
+ time_cnt++;
+ udelay(50);
+ } while (1);
+
+ udelay(10);
+
+ time_cnt = 0;
+ do {
+ val = readl(pinfo->regbase + I2C_INTR_RAW_REG);
+ if (val & I2C_RAW_TX_ABORT) {
+ hi_err("wait last i2c is idle abort! "\
+ "int_raw_status: %#x!\n", val);
+ return hi_i2c_abortprocess(pinfo);
+ }
+
+ val = readl(pinfo->regbase + I2C_STATUS_REG);
+ if (IS_I2C_IDLE(val))
+ break;
+
+ if (time_cnt > I2C_WAIT_TIME_OUT) {
+ hi_err("wait last i2c is idle timeout! "\
+ "auto_status: %#x\n", val);
+ return -EBUSY;
+ }
+ time_cnt++;
+ udelay(50);
+ } while (1);
+
+ return 0;
+}
+
+/* wait until tx fifo is not full */
+int hi_i2c_wait_txfifo_notfull(struct hi_i2c *pinfo)
+{
+ unsigned int val;
+ unsigned int time_cnt;
+
+ time_cnt = 0;
+ do {
+ val = readl(pinfo->regbase + I2C_INTR_RAW_REG);
+ if (val & I2C_RAW_TX_ABORT) {
+ hi_err("abort! last int_raw_status: %#x!\n", val);
+ return hi_i2c_abortprocess(pinfo);
+ }
+
+ val = readl(pinfo->regbase + I2C_AUTO_REG);
+ if (!IS_RX_FIFO_EMPTY(val))
+ readl(pinfo->regbase + I2C_TX_RX_REG);
+
+ if (val & I2c_AUTO_TX_FIFO_NOT_FULL)
+ break;
+
+ if (time_cnt > I2C_WAIT_TIME_OUT) {
+ hi_err("timeout! last auto_status: %#x\n", val);
+ return -EBUSY;
+ }
+ time_cnt++;
+ udelay(50);
+ } while (1);
+
+ return 0;
+}
+
+/* wait until tx fifo is not empty */
+int hi_i2c_wait_rxfifo_notempty(struct hi_i2c *pinfo)
+{
+ unsigned int val;
+ unsigned int time_cnt;
+
+ time_cnt = 0;
+ do {
+ val = readl(pinfo->regbase + I2C_INTR_RAW_REG);
+ if ((val & I2C_RAW_TX_ABORT) == I2C_RAW_TX_ABORT) {
+ hi_err("abort! int_raw_status: %#x!\n", val);
+ hi_i2c_abortprocess(pinfo);
+ return -EIO;
+ }
+
+ val = readl(pinfo->regbase + I2C_AUTO_REG);
+ if (!IS_RX_FIFO_EMPTY(val))
+ break;
+
+ if (time_cnt > I2C_WAIT_TIME_OUT) {
+ hi_err("timeout! auto_status: %#x\n", val);
+ hi_i2c_abortprocess(pinfo);
+ return -EBUSY;
+ }
+ time_cnt++;
+ udelay(50);
+ } while (1);
+
+ return 0;
+}
+
+static inline int hi_i2c_set_dev_addr_and_mode(struct hi_i2c *pinfo,
+ unsigned int work_mode)
+{
+ unsigned int dev_addr = pinfo->msg->addr;
+
+ if ((pinfo->g_last_dev_addr == dev_addr)
+ && (pinfo->g_last_mode == work_mode))
+ return 0;
+
+ /* wait until all cmd in fifo is finished and i2c is idle */
+ if (hi_i2c_wait_idle(pinfo) < 0)
+ return -1;
+
+ /* disable i2c */
+ writel(0x0, pinfo->regbase + I2C_ENABLE_REG);
+ /* clear interrupt */
+ writel(0x1, pinfo->regbase + I2C_CLR_INTR_REG);
+ /* enable interrupt mask */
+ writel(DISABLE_ALL_INTERRUPTS, pinfo->regbase + I2C_INTR_MASK_REG);
+ /* clear err status */
+ writel(0x0f000000, pinfo->regbase + I2C_AUTO_REG);
+
+ /* different device, need to reinit i2c ctrl */
+ if ((pinfo->g_last_dev_addr) != dev_addr) {
+ /* set slave dev addr */
+ writel((dev_addr & 0xff)>>1, pinfo->regbase + I2C_TAR_REG);
+ pinfo->g_last_dev_addr = dev_addr;
+ }
+
+ if (pinfo->g_last_mode != work_mode) {
+
+ /* set auto mode */
+ if (work_mode == I2C_MODE_AUTO) {
+ writel(0x0, pinfo->regbase + I2C_DMA_CMD0);
+ writel(0x80000000, pinfo->regbase + I2C_AUTO_REG);
+ pinfo->g_last_mode = work_mode;
+ } else if (work_mode == I2C_MODE_DMA) {
+ writel(0x0, pinfo->regbase + I2C_AUTO_REG);
+ pinfo->g_last_mode = work_mode;
+ } else {
+ hi_err("invalid i2c mode\n");
+ return -1;
+ }
+ }
+
+ /* enable i2c */
+ writel(0x1, pinfo->regbase + I2C_ENABLE_REG);
+
+ hi_msg("\n@@@@@@@@@@\n");
+
+ return 0;
+}
+
+int hi_i2c_write(struct hi_i2c *pinfo)
+{
+ unsigned int reg_val;
+ unsigned int temp_reg;
+ unsigned int temp_data;
+ unsigned int temp_auto_reg;
+ unsigned int min_msgs_len = 0;
+ struct i2c_msg *msg = pinfo->msg;
+ unsigned int msg_buf_ptr = 0;
+
+ min_msgs_len = (msg->flags & I2C_M_16BIT_REG) ? 2 : 1;
+ min_msgs_len += (msg->flags & I2C_M_16BIT_DATA) ? 2 : 1;
+ if (msg->len < min_msgs_len){
+ hi_err("Unsupported this length: %d!\n", msg->len);
+ return -1;
+ }
+
+ if (hi_i2c_set_dev_addr_and_mode(pinfo, I2C_MODE_AUTO) < 0)
+ return -1;
+
+ temp_auto_reg = HI_I2C_WRITE;
+
+ if (msg->flags & I2C_M_16BIT_REG) {
+ /* 16bit reg addr */
+ temp_auto_reg |= I2C_AUTO_ADDR;
+
+ /* switch high byte and low byte */
+ temp_reg = msg->buf[msg_buf_ptr] << 8;
+
+ msg_buf_ptr++;
+
+ temp_reg |= msg->buf[msg_buf_ptr];
+
+ msg_buf_ptr++;
+ } else {
+ temp_reg = msg->buf[msg_buf_ptr];
+ msg_buf_ptr++;
+ }
+
+ if (msg->flags & I2C_M_16BIT_DATA) {
+ /* 16bit data */
+ temp_auto_reg |= I2C_AUTO_DATA;
+
+ /* switch high byte and low byte */
+ temp_data = msg->buf[msg_buf_ptr] << 8;
+
+ msg_buf_ptr++;
+
+ temp_data |= msg->buf[msg_buf_ptr];
+
+ msg_buf_ptr++;
+ } else {
+ temp_data = msg->buf[msg_buf_ptr];
+ msg_buf_ptr++;
+ }
+
+ writel(temp_auto_reg, pinfo->regbase + I2C_AUTO_REG);
+ hi_msg("temp_auto_reg: 0x%x\n", temp_auto_reg);
+
+ /* set write reg&data */
+ reg_val = (temp_reg << REG_SHIFT) | temp_data;
+
+ /* wait until tx fifo not full */
+ if (hi_i2c_wait_txfifo_notfull(pinfo) < 0)
+ return -1;
+
+ hi_msg("reg_val = %x\n", reg_val);
+
+ writel(reg_val, pinfo->regbase + I2C_TX_RX_REG);
+
+ hi_msg("dev_addr =%x, reg_addr = %x, Data = %x\n",
+ pinfo->msg->addr, pinfo->msg->buf[0], pinfo->msg->buf[1]);
+
+ return 0;
+}
+
+unsigned int hi_i2c_read(struct hi_i2c *pinfo)
+{
+ unsigned int reg_val;
+ unsigned int temp_reg;
+ unsigned int ret_data = 0xffff;
+ unsigned int temp_auto_reg;
+ unsigned int min_msgs_len = 0;
+ struct i2c_msg *msg = pinfo->msg;
+
+ min_msgs_len = (msg->flags & I2C_M_16BIT_REG) ? 2 : 1;
+ if (msg->len < min_msgs_len){
+ hi_err("Unsupported this length: %d!\n", msg->len);
+ return -1;
+ }
+
+ if (hi_i2c_set_dev_addr_and_mode(pinfo, I2C_MODE_AUTO) < 0)
+ return -1;
+
+ temp_auto_reg = HI_I2C_READ;
+
+ if (msg->flags & I2C_M_16BIT_REG) {
+ /* 16bit reg addr */
+ temp_auto_reg |= I2C_AUTO_ADDR;
+
+ /* switch high byte and low byte */
+ temp_reg = msg->buf[0] << 8;
+ temp_reg |= msg->buf[1];
+ } else {
+ temp_reg = msg->buf[0];
+ }
+
+ if (msg->flags & I2C_M_16BIT_DATA)
+ /* 16bit data */
+ temp_auto_reg |= I2C_AUTO_DATA;
+
+ writel(temp_auto_reg, pinfo->regbase + I2C_AUTO_REG);
+ hi_msg("temp_auto_reg: 0x%x\n", temp_auto_reg);
+
+ /* 1. write addr */
+ reg_val = temp_reg << REG_SHIFT;
+ hi_msg("reg_val %x\n", reg_val);
+
+ /* wait until tx fifo not full */
+ if (hi_i2c_wait_txfifo_notfull(pinfo) < 0)
+ return -1;
+
+ /* regaddr */
+ writel(reg_val, pinfo->regbase + I2C_TX_RX_REG);
+
+ /* 2. read return data */
+ /* wait until rx fifo not empty */
+ if (hi_i2c_wait_rxfifo_notempty(pinfo) < 0)
+ return -1;
+
+ ret_data = readl(pinfo->regbase + I2C_TX_RX_REG) & DATA_16BIT_MASK;
+ hi_msg("ret_data = %x\n", ret_data);
+
+ if (msg->flags & I2C_M_16BIT_DATA) {
+ pinfo->msg->buf[0] = ret_data & DATA_8BIT_MASK;
+ pinfo->msg->buf[1] = (ret_data >> 8) & DATA_8BIT_MASK;
+ } else {
+ pinfo->msg->buf[0] = ret_data & DATA_8BIT_MASK;
+ }
+
+ writel(0x1, pinfo->regbase + I2C_CLR_INTR_REG);
+
+ return 0;
+}
+
+/************************************
+ * dma functions *
+************************************/
+#ifdef CONFIG_HI_DMAC
+void hi_i2c_dma_start(struct hi_i2c *pinfo, unsigned int dir)
+{
+ writel((1 << dir), pinfo->regbase + I2C_DMA_CTRL_REG);
+}
+
+void hi_i2c_dmac_config(struct hi_i2c *pinfo, unsigned int dir)
+{
+ /* 1. enable RX(0) or TX(1) in DMA mode */
+ hi_i2c_dma_start(pinfo, dir);
+
+ /* 2. set dma fifo */
+ writel(4, pinfo->regbase + I2C_DMA_TDLR);
+ writel(4, pinfo->regbase + I2C_DMA_RDLR);
+}
+
+void hi_i2c_start_rx(struct hi_i2c *pinfo, unsigned int reg_addr,
+ unsigned int length)
+{
+ unsigned int reg;
+
+ writel(reg_addr, pinfo->regbase + I2C_DMA_CMD1);
+ writel(length, pinfo->regbase + I2C_DMA_CMD2);
+
+ reg = readl(pinfo->regbase + I2C_DMA_CMD0);
+
+ /*start tx*/
+ reg &= ~0x40000000;
+ writel((0x80000000 | reg), pinfo->regbase + I2C_DMA_CMD0);
+}
+
+void hi_i2c_start_tx(struct hi_i2c *pinfo, unsigned int reg_addr,
+ unsigned int length)
+{
+ unsigned int reg;
+
+ writel(reg_addr, pinfo->regbase + I2C_DMA_CMD1);
+ writel(length, pinfo->regbase + I2C_DMA_CMD2);
+
+ reg = readl(pinfo->regbase + I2C_DMA_CMD0);
+
+ /*start rx*/
+ writel((0xc0000000 | reg), pinfo->regbase + I2C_DMA_CMD0);
+}
+
+int dma_to_i2c(unsigned int src, unsigned int dst, unsigned int length)
+{
+ int chan;
+
+ chan = do_dma_m2p(src, dst, length);
+ if (chan == -1)
+ hi_err("dma_to_i2c error\n");
+
+ return chan;
+}
+
+
+int i2c_to_dma(unsigned int src, unsigned int dst, unsigned int length)
+{
+ int chan;
+
+ chan = do_dma_p2m(dst, src, length);
+ if (chan == -1)
+ hi_err("dma_p2m error...\n");
+
+ return chan;
+}
+
+static int hi_i2c_do_dma_write(struct hi_i2c *pinfo,
+ unsigned int reg_addr, unsigned int reg_addr_num,
+ unsigned int dma_buf, unsigned int length)
+{
+ unsigned int temp_reg = reg_addr;
+ int chan;
+
+ /* 1. switch i2c devaddr and dma mode*/
+ if (hi_i2c_set_dev_addr_and_mode(pinfo, I2C_MODE_DMA) < 0)
+ return -1;
+
+ if (2 == reg_addr_num) {
+ /* switch high byte and low byte */
+ temp_reg = REVERT_HL_BYTE(reg_addr);
+ writel(0x10000000, pinfo->regbase + I2C_DMA_CMD0);
+ } else {
+ writel(0x0, pinfo->regbase + I2C_DMA_CMD0);
+ }
+
+ /* 2. config i2c into DMA mode */
+ hi_i2c_dmac_config(pinfo, 0x1);
+
+ /* 3. start i2c logic to write */
+ hi_i2c_start_tx(pinfo, temp_reg, length - 1);
+
+ /* 4. transmit DATA from DMAC to I2C in DMA mode */
+ chan = dma_to_i2c(dma_buf, (pinfo->mem->start + I2C_DATA_CMD_REG),
+ length);
+
+ if (dmac_wait(chan) != DMAC_CHN_SUCCESS) {
+ hi_err("dma wait failed\n");
+ dmac_channel_free(chan);
+ return -1;
+ }
+
+ dmac_channel_free(chan);
+
+ return 0;
+}
+
+static int hi_i2c_do_dma_read(struct hi_i2c *pinfo,
+ unsigned int reg_addr, unsigned int reg_addr_num,
+ unsigned int dma_buf, unsigned int length)
+{
+ unsigned int temp_reg = reg_addr;
+ int chan;
+
+ /* 1. switch i2c devaddr and dma mode*/
+ if (hi_i2c_set_dev_addr_and_mode(pinfo, I2C_MODE_DMA) < 0)
+ return -1;
+
+ if (2 == reg_addr_num) {
+ /* switch high byte and low byte */
+ temp_reg = REVERT_HL_BYTE(reg_addr);
+ writel(0x10000000, pinfo->regbase + I2C_DMA_CMD0);
+ } else {
+ writel(0x0, pinfo->regbase + I2C_DMA_CMD0);
+ }
+
+ /* 2. config i2c into DMA mode */
+ hi_i2c_dmac_config(pinfo, 0x0);
+
+ /* 3. transmit DATA from I2C to DMAC in DMA mode */
+ chan = i2c_to_dma((pinfo->mem->start + I2C_DATA_CMD_REG),
+ dma_buf, length);
+
+ /* 4. start i2c logic to read */
+ hi_i2c_start_rx(pinfo, temp_reg, length - 1);
+
+ if (dmac_wait(chan) != DMAC_CHN_SUCCESS) {
+ hi_err("dma wait failed\n");
+ dmac_channel_free(chan);
+ return -1;
+ }
+
+ dmac_channel_free(chan);
+
+ return 0;
+}
+
+#else
+static int hi_i2c_do_dma_write(struct hi_i2c *pinfo,
+ unsigned int reg_addr, unsigned int reg_addr_num,
+ unsigned int dma_buf, unsigned int length)
+{
+ hi_err("DMA is not enabled!");
+ return -1;
+}
+
+static int hi_i2c_do_dma_read(struct hi_i2c *pinfo,
+ unsigned int reg_addr, unsigned int reg_addr_num,
+ unsigned int dma_buf, unsigned int length)
+{
+ hi_err("DMA is not enabled!");
+ return -1;
+}
+#endif
+
+int hi_i2c_dma_write(const struct i2c_client *client, unsigned int dma_buf,
+ unsigned int reg_addr, unsigned int reg_addr_num,
+ unsigned int length)
+{
+ struct i2c_adapter *adap = client->adapter;
+ struct hi_i2c *pinfo = (struct hi_i2c *)i2c_get_adapdata(adap);
+ struct i2c_msg msg;
+ int ret;
+ unsigned long flags;
+
+ spin_lock_irqsave(&adap->spinlock, flags);
+
+ memset(&msg, 0x0, sizeof(struct i2c_msg));
+ msg.addr = client->addr;
+ msg.flags = client->flags;
+ msg.len = length;
+
+ pinfo->msg = &msg;
+
+ ret = hi_i2c_do_dma_write(pinfo, reg_addr, reg_addr_num, dma_buf,
+ length);
+
+ spin_unlock_irqrestore(&adap->spinlock, flags);
+
+ return ret;
+}
+EXPORT_SYMBOL(hi_i2c_dma_write);
+
+int hi_i2c_dma_read(const struct i2c_client *client, unsigned int dma_buf,
+ unsigned int reg_addr, unsigned int reg_addr_num,
+ unsigned int length)
+{
+ struct i2c_adapter *adap = client->adapter;
+ struct hi_i2c *pinfo = (struct hi_i2c *)i2c_get_adapdata(adap);
+ struct i2c_msg msg;
+ int ret;
+ unsigned long flags;
+
+ spin_lock_irqsave(&adap->spinlock, flags);
+
+ memset(&msg, 0x0, sizeof(struct i2c_msg));
+ msg.addr = client->addr;
+ msg.flags = client->flags;
+ msg.flags |= I2C_M_RD;
+ msg.len = length;
+
+ pinfo->msg = &msg;
+
+ ret = hi_i2c_do_dma_read(pinfo, reg_addr, reg_addr_num, dma_buf,
+ length);
+
+ spin_unlock_irqrestore(&adap->spinlock, flags);
+
+ return ret;
+}
+EXPORT_SYMBOL(hi_i2c_dma_read);
+
+static int hi_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
+ int num)
+{
+ struct hi_i2c *pinfo;
+ unsigned int msg_idx;
+ dma_addr_t dma_buf;
+ __u16 len;
+ unsigned int reg_addr;
+ unsigned int reg_width;
+ int ret;
+
+ if (!msgs || (num <= 0)) {
+ hi_err("msgs == NULL || num <= 0, Invalid argument!\n");
+ return -EINVAL;
+ }
+
+ pinfo = (struct hi_i2c *)i2c_get_adapdata(adap);
+ pinfo->msg = msgs;
+
+ for (msg_idx = 0; msg_idx < num; msg_idx++) {
+ len = pinfo->msg->len;
+ if (pinfo->msg->flags & I2C_M_16BIT_REG) {
+ reg_addr = pinfo->msg->buf[0];
+ reg_addr |= pinfo->msg->buf[1] << 8;
+ reg_width = 2;
+ } else {
+ reg_addr = pinfo->msg->buf[0];
+ reg_width = 1;
+ }
+
+ if (pinfo->msg->flags & I2C_M_DMA) {
+ if (pinfo->msg->flags & I2C_M_16BIT_DATA) {
+ hi_err("I2C DMA no support I2C_M_16BIT_DATA\n");
+ return -EINVAL;
+ }
+
+ if (((pinfo->msg->flags & I2C_M_RD) && (len <= 0)) ||
+ (!(pinfo->msg->flags & I2C_M_RD) &&
+ (len <= reg_width))) {
+ hi_err("msg->len == %d, Invalid argument!\n",
+ len);
+ return -EINVAL;
+ }
+
+ dma_buf = dma_map_single(pinfo->dev,
+ pinfo->msg->buf, len,
+ DMA_BIDIRECTIONAL);
+ if (dma_mapping_error(pinfo->dev, dma_buf)) {
+ hi_err("DMA mapping failed\n");
+ return -EINVAL;
+ }
+
+ if (pinfo->msg->flags & I2C_M_RD)
+ ret = hi_i2c_do_dma_read(pinfo, reg_addr,
+ reg_width, dma_buf, len);
+ else
+ ret = hi_i2c_do_dma_write(pinfo, reg_addr,
+ reg_width, dma_buf + reg_width,
+ len - reg_width);
+
+ dma_unmap_single(pinfo->dev, dma_buf, len,
+ DMA_BIDIRECTIONAL);
+
+ if (ret)
+ break;
+ } else {
+ if (pinfo->msg->flags & I2C_M_RD)
+ ret = hi_i2c_read(pinfo);
+ else
+ ret = hi_i2c_write(pinfo);
+
+ if (ret)
+ break;
+ }
+ pinfo->msg++;
+ }
+
+ if (!ret || msg_idx > 0)
+ ret = msg_idx;
+ else
+ ret = -EIO;
+
+ return ret;
+}
+
+/**************************************************************/
+
+static u32 hi_i2c_func(struct i2c_adapter *adap)
+{
+ return I2C_FUNC_I2C;
+}
+
+static const struct i2c_algorithm hi_i2c_algo = {
+ .master_xfer = hi_i2c_xfer,
+ .functionality = hi_i2c_func,
+};
+
+static int hi_i2c_probe(struct platform_device *pdev)
+{
+ int errorcode;
+ struct hi_i2c *pinfo;
+ struct i2c_adapter *adap;
+ struct resource *mem;
+ struct hi_platform_i2c *platform_info;
+ int tmp = 0;
+ struct device *dev = &pdev->dev;
+ struct device_node *np = pdev->dev.of_node;
+
+ pdev->name = I2C_HISI;
+ tmp = of_property_read_u32(np, "id", &pdev->id);
+ if (tmp) {
+ dev_err(&pdev->dev, "Get id failed!\n");
+ errorcode = -EBADF;
+ goto i2c_errorcode_na;
+ }
+
+ platform_info = devm_kzalloc(dev, sizeof(*platform_info), GFP_KERNEL);
+ if (!platform_info)
+ return -ENOMEM;
+
+ mem = devm_kzalloc(dev, sizeof(*mem), GFP_KERNEL);
+ if (!mem)
+ return -ENOMEM;
+
+ tmp = of_property_read_u32(np, "clock-frequency", &platform_info->clk_limit);
+ if (tmp) {
+ dev_err(&pdev->dev, "Get clock-frequency failed!\n");
+ errorcode = -EBADF;
+ goto i2c_errorcode_na;
+ }
+ platform_info->i2c_class = I2C_CLASS_DDC;
+
+ dev->platform_data = platform_info;
+
+ pinfo = kzalloc(sizeof(struct hi_i2c), GFP_KERNEL);
+ if (pinfo == NULL) {
+ dev_err(&pdev->dev, "Out of memory!\n");
+ errorcode = -ENOMEM;
+ goto i2c_errorcode_na;
+ }
+
+ tmp = of_property_read_u32(np, "reg", &mem->start);
+ if (tmp) {
+ dev_err(&pdev->dev, "Get reg failed!\n");
+ errorcode = -ENXIO;
+ goto i2c_errorcode_na;
+ }
+
+ tmp = of_property_read_u32(np, "io-size", &mem->end);
+ if (tmp) {
+ dev_err(&pdev->dev, "Get io-size failed!\n");
+ errorcode = -EBADF;
+ goto i2c_errorcode_na;
+ }
+ mem->end = mem->start + mem->end -1;
+ mem->flags = IORESOURCE_MEM;
+ pdev->resource = mem;
+ pinfo->regbase = (unsigned char __iomem *)IO_ADDRESS(mem->start);
+ pinfo->mem = mem;
+ /* find the clock and enable it */
+ pinfo->clk = devm_clk_get(&pdev->dev, NULL);
+ pinfo->dev = &pdev->dev;
+ pinfo->pdata = platform_info;
+ pinfo->g_last_dev_addr = 0;
+
+ hi_i2c_hw_init(pinfo);
+
+ platform_set_drvdata(pdev, pinfo);
+
+ adap = &pinfo->adap;
+ i2c_set_adapdata(adap, pinfo);
+ adap->owner = THIS_MODULE;
+ adap->class = platform_info->i2c_class;
+ strlcpy(adap->name, pdev->name, sizeof(adap->name));
+ adap->algo = &hi_i2c_algo;
+ adap->dev.parent = &pdev->dev;
+ adap->nr = pdev->id;
+ adap->retries = HI_I2C_RETRIES;
+ errorcode = i2c_add_numbered_adapter(adap);
+ if (errorcode) {
+ dev_err(&pdev->dev,
+ "%s: Adding I2C adapter failed!\n", __func__);
+ goto i2c_errorcode_free_irq;
+ }
+ dev_notice(&pdev->dev,
+ "Hisilicon [%s] probed!\n",
+ dev_name(&pinfo->adap.dev));
+
+ goto i2c_errorcode_na;
+
+i2c_errorcode_free_irq:
+ free_irq(pinfo->irq, pinfo);
+ kfree(pinfo);
+
+i2c_errorcode_na:
+ return errorcode;
+}
+
+static int hi_i2c_remove(struct platform_device *pdev)
+{
+ struct hi_i2c *pinfo = NULL;
+ int errorcode = 0;
+
+ pinfo = platform_get_drvdata(pdev);
+
+ if (pinfo) {
+ i2c_del_adapter(&pinfo->adap);
+
+ free_irq(pinfo->irq, pinfo);
+
+ kfree(pinfo);
+ }
+
+ dev_notice(&pdev->dev,
+ "Remove Hisilicon Media Processor"
+ "I2C adapter [%d].\n", errorcode);
+
+ return errorcode;
+}
+
+#ifdef CONFIG_PM
+static int hi_i2c_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ struct hi_i2c *pinfo;
+
+ pinfo = platform_get_drvdata(pdev);
+
+ hi_i2c_abortprocess(pinfo);
+
+ return 0;
+}
+
+static int hi_i2c_resume(struct platform_device *pdev)
+{
+ struct hi_i2c *pinfo;
+
+ pinfo = platform_get_drvdata(pdev);
+
+ hi_i2c_hw_init(pinfo);
+
+ return 0;
+}
+#else
+#define hi_i2c_suspend NULL
+#define hi_i2c_resume NULL
+#endif
+
+/******************************************************************************/
+static const struct of_device_id hi_i2c_match[] = {
+ { .compatible = "hisilicon,hisi-i2c-hisilicon"},
+ {}
+};
+MODULE_DEVICE_TABLE(of, hi_i2c_match);
+/******************************************************************************/
+
+static struct platform_driver hi_i2c_driver = {
+ .driver = {
+ .owner = THIS_MODULE,
+ .name = "hisi-i2c-hisilicon",
+ .of_match_table = of_match_ptr(hi_i2c_match),
+ },
+ .probe = hi_i2c_probe,
+ .remove = hi_i2c_remove,
+#ifdef CONFIG_PM
+ .suspend = hi_i2c_suspend,
+ .resume = hi_i2c_resume,
+#endif
+};
+
+module_platform_driver(hi_i2c_driver);
+
+MODULE_DESCRIPTION("HISILICON I2C Bus driver");
+MODULE_AUTHOR("BVT OSDRV");
+MODULE_LICENSE("GPL");
diff --git a/drivers/i2c/busses/i2c-hisilicon.h b/drivers/i2c/busses/i2c-hisilicon.h
new file mode 100644
index 0000000..bb49513
--- /dev/null
+++ b/drivers/i2c/busses/i2c-hisilicon.h
@@ -0,0 +1,112 @@
+#ifndef __HI_I2C_H__
+#define __HI_I2C_H__
+
+#define HI_I2C_RX_FIFO 0x8
+#define HI_I2C_TX_FIFO 0x8
+#define HI_I2C_RETRIES 0x1
+
+#define I2C_CON_REG 0x000
+#define I2C_TAR_REG 0x004
+#define I2C_DATA_CMD_REG 0x010
+#define I2C_SCL_H_REG 0x01C
+#define I2C_SCL_L_REG 0x020
+#define I2C_INTR_STAT_REG 0x02C
+#define I2C_INTR_MASK_REG 0x030
+#define I2C_INTR_RAW_REG 0x034
+#define I2C_RX_TL_REG 0x038
+#define I2C_TX_TL_REG 0x03C
+#define I2C_CLR_INTR_REG 0x040
+#define I2C_CLR_RX_OVER_REG 0x048
+#define I2C_CLR_TX_OVER_REG 0x04C
+#define I2C_ENABLE_REG 0x06C
+#define I2C_STATUS_REG 0x070
+#define I2C_TXFLR_REG 0x074
+#define I2C_RXFLR_REG 0x078
+#define I2C_SDA_HOLD_REG 0x07C
+#define I2C_TX_ABRT_SRC 0x080
+#define I2C_DMA_CTRL_REG 0x088
+#define I2C_DMA_TDLR 0x08C
+#define I2C_DMA_RDLR 0x090
+#define I2C_LPIF_STATE 0x0A8
+#define I2C_LOCK_REG 0x0AC
+#define I2C_AUTO_REG 0x0B0
+#define I2C_TX_RX_REG 0x0B4
+#define I2C_DMA_CMD0 0x0B8
+#define I2C_DMA_CMD1 0x0BC
+#define I2C_DMA_CMD2 0x0C0
+#define I2C_ENABLE_STATUS_REG 0x09C
+
+#define HI_I2C_FAST_MODE 0x65
+
+#define HI_I2C_UNLOCK_VALUE 0x1ACCE551
+
+#define HI_I2C_ENABLE (1 << 0)
+
+#define HI_I2C_AUTO_MODE_OFF 0x0f000000
+
+#define HI_I2C_WRITE 0x80000000
+#define HI_I2C_READ 0xc0000000
+
+#define READ_OPERATION (1)
+#define WRITE_OPERATION 0xfe
+
+#define CMD_I2C_WRITE 0x01
+#define CMD_I2C_READ 0x03
+
+/* I2C_COM_REG */
+#define I2C_SEND_ACK (~(1 << 4))
+#define I2C_START (1 << 3)
+#define I2C_READ (1 << 2)
+#define I2C_WRITE (1 << 1)
+#define I2C_STOP (1 << 0)
+
+/* I2C_ENABLE_REG */
+#define I2C_ENABLE (1 << 0)
+
+#define I2C_RAW_TX_ABORT (1 << 6)
+
+/*I2C_INTR_STAT_REG */
+#define I2C_AUTO_RX_FIFO_NOT_EMPTY (1 << 8)
+#define I2C_AUTO_TX_FIFO_EMPTRY (1 << 20)
+#define I2c_AUTO_TX_FIFO_NOT_FULL (1 << 21)
+#define I2C_TX_ABRT (1 << 23)
+#define I2C_AUTO_DATA (1 << 28)
+#define I2C_AUTO_ADDR (1 << 29)
+
+/* I2C_STATUS */
+#define I2C_STATUS_WORKING (1 << 0)
+
+#define IS_TX_FIFO_EMPTY(status) (((status) &\
+ I2C_AUTO_TX_FIFO_EMPTRY) == I2C_AUTO_TX_FIFO_EMPTRY)
+#define IS_RX_FIFO_EMPTY(status) (((status) &\
+ I2C_AUTO_RX_FIFO_NOT_EMPTY) == 0)
+#define IS_FIFO_EMPTY(status) (IS_RX_FIFO_EMPTY(status) &&\
+ IS_TX_FIFO_EMPTY(status))
+#define IS_I2C_IDLE(status) (((status) & I2C_STATUS_WORKING) == 0)
+
+#define REG_SHIFT 16
+#define DATA_16BIT_MASK 0xFFFF
+#define DATA_8BIT_MASK 0xFFFF
+
+#define REVERT_HL_BYTE(value) ((value >> 8) | ((value & 0xFF) << 8))
+
+/*
+ * I2C Interrupt related Macros
+ */
+#define DEFAULT_I2C_REG_IMSC 0x0UL
+#define DISABLE_ALL_INTERRUPTS ((~DEFAULT_I2C_REG_IMSC) & 0xfff)
+#define ENABLE_ALL_INTERRUPTS DEFAULT_I2C_REG_IMSC
+
+typedef enum i2c_mode_e {
+ I2C_MODE_AUTO,
+ I2C_MODE_DMA,
+ I2C_MODE_NONE,
+} i2c_mode_e;
+
+struct hi_platform_i2c {
+ int clk_limit;
+ unsigned int i2c_class;
+ unsigned int clk_rate;
+};
+
+#endif
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 7484aac..5951ac1 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1098,8 +1098,13 @@ static int i2c_check_addr_validity(unsigned addr, unsigned short flags)
if (addr > 0x3ff)
return -EINVAL;
} else {
+ /* we always use dev+RD bit */
/* 7-bit address, reject the general call address */
+#ifdef CONFIG_I2C_HISI
+ if (addr == 0x00 || addr > 0xfe)
+#else
if (addr == 0x00 || addr > 0x7f)
+#endif
return -EINVAL;
}
return 0;
@@ -1824,6 +1829,9 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
rt_mutex_init(&adap->bus_lock);
rt_mutex_init(&adap->mux_lock);
+#ifdef CONFIG_ARCH_HISI_BVT
+ spin_lock_init(&adap->spinlock);
+#endif
mutex_init(&adap->userspace_clients_lock);
INIT_LIST_HEAD(&adap->userspace_clients);
@@ -2537,6 +2545,9 @@ EXPORT_SYMBOL(__i2c_transfer);
int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
{
int ret;
+#ifdef CONFIG_ARCH_HISI_BVT
+ unsigned long flags;
+#endif
/* REVISIT the fault reporting model here is weak:
*
@@ -2566,6 +2577,9 @@ int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
}
#endif
+#ifdef CONFIG_ARCH_HISI_BVT
+ spin_lock_irqsave(&adap->spinlock, flags);
+#else
if (in_atomic() || irqs_disabled()) {
ret = i2c_trylock_bus(adap, I2C_LOCK_SEGMENT);
if (!ret)
@@ -2574,10 +2588,13 @@ int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
} else {
i2c_lock_bus(adap, I2C_LOCK_SEGMENT);
}
-
+#endif
ret = __i2c_transfer(adap, msgs, num);
+#ifdef CONFIG_ARCH_HISI_BVT
+ spin_unlock_irqrestore(&adap->spinlock, flags);
+#else
i2c_unlock_bus(adap, I2C_LOCK_SEGMENT);
-
+#endif
return ret;
} else {
dev_dbg(&adap->dev, "I2C level transfers not supported\n");
@@ -2601,7 +2618,11 @@ int i2c_master_send(const struct i2c_client *client, const char *buf, int count)
struct i2c_msg msg;
msg.addr = client->addr;
+#ifdef CONFIG_I2C_HISI
+ msg.flags = client->flags;
+#else
msg.flags = client->flags & I2C_M_TEN;
+#endif
msg.len = count;
msg.buf = (char *)buf;
@@ -2630,7 +2651,11 @@ int i2c_master_recv(const struct i2c_client *client, char *buf, int count)
int ret;
msg.addr = client->addr;
+#ifdef CONFIG_I2C_HISI
+ msg.flags = client->flags;
+#else
msg.flags = client->flags & I2C_M_TEN;
+#endif
msg.flags |= I2C_M_RD;
msg.len = count;
msg.buf = buf;
diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c
index 6f638bb..c1bb3fc 100644
--- a/drivers/i2c/i2c-dev.c
+++ b/drivers/i2c/i2c-dev.c
@@ -146,16 +146,59 @@ static ssize_t i2cdev_read(struct file *file, char __user *buf, size_t count,
if (count > 8192)
count = 8192;
+#ifdef CONFIG_I2C_HISI
+ {
+ unsigned reg_width;
+ unsigned data_width;
+
+ if (client->flags & I2C_M_16BIT_REG)
+ reg_width = 2;
+ else
+ reg_width = 1;
+
+ if (client->flags & I2C_M_16BIT_DATA)
+ data_width = 2;
+ else
+ data_width = 1;
+
+ if (client->flags & I2C_M_DMA)
+ tmp = kmalloc(max_t(size_t, reg_width, count),
+ GFP_KERNEL);
+ else
+ tmp = kmalloc(max_t(size_t, reg_width, data_width),
+ GFP_KERNEL);
+
+ if (tmp == NULL)
+ return -ENOMEM;
+
+ if (copy_from_user(tmp, buf, reg_width))
+ return -EFAULT;
+ }
+#else
tmp = kmalloc(count, GFP_KERNEL);
if (tmp == NULL)
return -ENOMEM;
+#endif
pr_debug("i2c-dev: i2c-%d reading %zu bytes.\n",
iminor(file_inode(file)), count);
ret = i2c_master_recv(client, tmp, count);
+#ifdef CONFIG_I2C_HISI
+ if (ret >= 0) {
+ if (client->flags & I2C_M_DMA) {
+ ret = copy_to_user(buf, tmp, count) ? -EFAULT : ret;
+ } else {
+ if (client->flags & I2C_M_16BIT_DATA)
+ ret = copy_to_user(buf, tmp, 2) ? -EFAULT : ret;
+ else
+ ret = copy_to_user(buf, tmp, 1) ? -EFAULT : ret;
+ }
+ }
+#else
if (ret >= 0)
ret = copy_to_user(buf, tmp, count) ? -EFAULT : ret;
+#endif
kfree(tmp);
return ret;
}
@@ -424,7 +467,11 @@ static long i2cdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
case I2C_SLAVE:
case I2C_SLAVE_FORCE:
if ((arg > 0x3ff) ||
+#ifdef CONFIG_I2C_HISI
+ (((client->flags & I2C_M_TEN) == 0) && arg > 0xfe))
+#else
(((client->flags & I2C_M_TEN) == 0) && arg > 0x7f))
+#endif
return -EINVAL;
if (cmd == I2C_SLAVE && i2cdev_check_addr(client->adapter, arg))
return -EBUSY;
@@ -450,6 +497,26 @@ static long i2cdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
else
client->flags &= ~I2C_CLIENT_PEC;
return 0;
+#ifdef CONFIG_I2C_HISI
+ case I2C_16BIT_REG:
+ if (arg)
+ client->flags |= I2C_M_16BIT_REG;
+ else
+ client->flags &= ~I2C_M_16BIT_REG;
+ return 0;
+ case I2C_16BIT_DATA:
+ if (arg)
+ client->flags |= I2C_M_16BIT_DATA;
+ else
+ client->flags &= ~I2C_M_16BIT_DATA;
+ return 0;
+ case I2C_DMA:
+ if (arg)
+ client->flags |= I2C_M_DMA;
+ else
+ client->flags &= ~I2C_M_DMA;
+ return 0;
+#endif
case I2C_FUNCS:
funcs = i2c_get_functionality(client->adapter);
return put_user(funcs, (unsigned long __user *)arg);
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index c6df644..327bb5b 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -358,6 +358,17 @@ config MFD_HI655X_PMIC
help
Select this option to enable Hisilicon hi655x series pmic driver.
+config MFD_HISI_FMC
+ tristate "HiSilicon Flash Memory Controller"
+ depends on OF
+ depends on ARCH_HISI_BVT
+ select MFD_CORE
+ select REGMAP_MMIO
+ help
+ Select this option to enable the HiSilicon Flash Memory
+ Controller(FMC) driver.
+
+
config HTC_PASIC3
tristate "HTC PASIC3 LED/DS1WM chip support"
select MFD_CORE
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 9834e66..9c6d6ea 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -180,6 +180,7 @@ obj-$(CONFIG_MFD_TPS65090) += tps65090.o
obj-$(CONFIG_MFD_AAT2870_CORE) += aat2870-core.o
obj-$(CONFIG_MFD_ATMEL_FLEXCOM) += atmel-flexcom.o
obj-$(CONFIG_MFD_ATMEL_HLCDC) += atmel-hlcdc.o
+obj-$(CONFIG_MFD_HISI_FMC) += hisi_fmc.o
obj-$(CONFIG_MFD_INTEL_LPSS) += intel-lpss.o
obj-$(CONFIG_MFD_INTEL_LPSS_PCI) += intel-lpss-pci.o
obj-$(CONFIG_MFD_INTEL_LPSS_ACPI) += intel-lpss-acpi.o
diff --git a/drivers/mfd/hisi_fmc.c b/drivers/mfd/hisi_fmc.c
new file mode 100644
index 0000000..ef5eab3
--- /dev/null
+++ b/drivers/mfd/hisi_fmc.c
@@ -0,0 +1,110 @@
+/* HiSilicon Flash Memory Controller Driver
+ *
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+unsigned char hifmc_cs_user[HIFMC_MAX_CHIP_NUM];
+/* ------------------------------------------------------------------------ */
+static const struct mfd_cell hisi_fmc_devs[] = {
+ {
+ .name = "hisi_spi_nor",
+ .of_compatible = "hisilicon,fmc-spi-nor",
+ },
+ {
+ .name = "hisi_spi_nand",
+ .of_compatible = "hisilicon,fmc-spi-nand",
+ },
+ {
+ .name = "hisi_nand",
+ .of_compatible = "hisilicon,fmc-nand",
+ },
+};
+
+static int hisi_fmc_probe(struct platform_device *pdev)
+{
+ struct hisi_fmc *fmc;
+ struct resource *res;
+ int ret;
+
+ fmc = devm_kzalloc(&pdev->dev, sizeof(*fmc), GFP_KERNEL);
+ if (!fmc)
+ return -ENOMEM;
+
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "control");
+ fmc->regbase = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(fmc->regbase))
+ return PTR_ERR(fmc->regbase);
+
+ res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "memory");
+ fmc->iobase = devm_ioremap_resource(&pdev->dev, res);
+ if (IS_ERR(fmc->iobase))
+ return PTR_ERR(fmc->iobase);
+
+ fmc->clk = devm_clk_get(&pdev->dev, NULL);
+ if (IS_ERR(fmc->clk))
+ return PTR_ERR(fmc->clk);
+
+ mutex_init(&fmc->lock);
+
+ platform_set_drvdata(pdev, fmc);
+
+ ret = mfd_add_devices(&pdev->dev, 0, hisi_fmc_devs,
+ ARRAY_SIZE(hisi_fmc_devs), NULL, 0, NULL);
+ if (ret) {
+ dev_err(&pdev->dev, "add mfd devices failed: %d\n", ret);
+ return ret;
+ }
+
+ return 0;
+}
+
+static int hisi_fmc_remove(struct platform_device *pdev)
+{
+ struct hisi_fmc *fmc = platform_get_drvdata(pdev);
+
+ mfd_remove_devices(&pdev->dev);
+ mutex_destroy(&fmc->lock);
+
+ return 0;
+}
+
+static const struct of_device_id hisi_fmc_of_match_tbl[] = {
+ { .compatible = "hisilicon,hisi-fmc"},
+ { }
+};
+MODULE_DEVICE_TABLE(of, hisi_fmc_of_match_tbl);
+
+static struct platform_driver hisi_fmc_driver = {
+ .driver = {
+ .name = "hifmc",
+ .of_match_table = hisi_fmc_of_match_tbl,
+ },
+ .probe = hisi_fmc_probe,
+ .remove = hisi_fmc_remove,
+};
+module_platform_driver(hisi_fmc_driver);
+
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("HiSilicon Flash Memory Controller Driver");
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index bd44ba8..61ef3ea 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -28,6 +28,10 @@
#include "sdio_ops.h"
#include "sdio_cis.h"
+#ifdef CONFIG_ARCH_HISI_BVT
+#include "host.h"
+#endif
+
static int sdio_read_fbr(struct sdio_func *func)
{
int ret;
@@ -1173,3 +1177,40 @@ int mmc_attach_sdio(struct mmc_host *host)
return err;
}
+#ifdef CONFIG_ARCH_HISI_BVT
+/* sdio_reset_comm has been fixed in latest kernel/msm.git for Linux
+ * 2.6.27. The implementation prior to that buggy, and needs broadcom's
+ * patch for it*/
+int sdio_reset_comm(struct mmc_card *card)
+{
+ struct mmc_host *host = card->host;
+ u32 ocr;
+ u32 rocr;
+ int err;
+
+ mmc_claim_host(host);
+ mmc_retune_disable(host);
+ mmc_go_idle(host);
+ mmc_set_clock(host, host->f_min);
+ err = mmc_send_io_op_cond(host, 0, &ocr);
+ if (err)
+ goto err;
+ rocr = mmc_select_voltage(host, ocr);
+ if (!rocr) {
+ err = -EINVAL;
+ goto err;
+ }
+ err = mmc_sdio_init_card(host, rocr, card, 0);
+ if (err)
+ goto err;
+ mmc_release_host(host);
+ return 0;
+err:
+ printk("%s: Error resetting SDIO communications (%d)\n",
+ mmc_hostname(host), err);
+ mmc_release_host(host);
+ return err;
+}
+EXPORT_SYMBOL(sdio_reset_comm);
+#endif
+
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index 5274f50..a230288 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -798,3 +798,5 @@ config MMC_SDHCI_BRCMSTB
Broadcom STB SoCs.
If unsure, say Y.
+
+source "drivers/mmc/host/himci/Kconfig"
diff --git a/drivers/mmc/host/Makefile b/drivers/mmc/host/Makefile
index e2bdaaf..246f354 100644
--- a/drivers/mmc/host/Makefile
+++ b/drivers/mmc/host/Makefile
@@ -80,3 +80,5 @@ obj-$(CONFIG_MMC_SDHCI_BRCMSTB) += sdhci-brcmstb.o
ifeq ($(CONFIG_CB710_DEBUG),y)
CFLAGS-cb710-mmc += -DDEBUG
endif
+
+obj-$(CONFIG_HIMCI) += himci/
diff --git a/drivers/mmc/host/himci/Kconfig b/drivers/mmc/host/himci/Kconfig
new file mode 100644
index 0000000..b14241a
--- /dev/null
+++ b/drivers/mmc/host/himci/Kconfig
@@ -0,0 +1,23 @@
+#
+# himci family SD/MMC device configuration
+#
+menuconfig HIMCI
+ tristate "himciv100 driver support"
+ depends on ARCH_HI3516A
+ default y if ARCH_HI3516A
+ select MMC_UNSAFE_RESUME
+ select MMC_EMBEDDED_SDIO
+ select MMC_BLOCK
+ select MMC_BLOCK_BOUNCE
+ help
+ This selects the Hisilicon Synopsys MultiMedia Card Driver
+ support. If you want use SD/MMC/SDIO driver,
+ Say Y or M here.
+
+ default is Y.
+
+config SEND_AUTO_STOP
+ bool "Send Auto Stop to terminate data transfer between host and SD card"
+ depends on ARCH_HI3516A && HIMCI
+ default y
+
diff --git a/drivers/mmc/host/himci/Makefile b/drivers/mmc/host/himci/Makefile
new file mode 100644
index 0000000..6858bfce
--- /dev/null
+++ b/drivers/mmc/host/himci/Makefile
@@ -0,0 +1,2 @@
+obj-$(CONFIG_HIMCI) += hisi_mci.o
+hisi_mci-y := himci.o himci_proc.o
diff --git a/drivers/mmc/host/himci/himci.c b/drivers/mmc/host/himci/himci.c
new file mode 100644
index 0000000..5f9b036
--- /dev/null
+++ b/drivers/mmc/host/himci/himci.c
@@ -0,0 +1,1652 @@
+/*
+ * himci.c - hisilicon MMC Host driver
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#define pr_fmt(fmt) "himci: " fmt
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+#include "himci_reg.h"
+#include "himci.h"
+#include "himci_proc.h"
+
+#ifdef CONFIG_ARCH_HI3516A
+#include "himci_hi3516a.c"
+#endif
+
+#define DRIVER_NAME "himci"
+#define CMD_DES_PAGE_SIZE (2 * PAGE_SIZE)
+
+static unsigned int detect_time = HI_MCI_DETECT_TIMEOUT;
+static unsigned int retry_count = MAX_RETRY_COUNT;
+static unsigned int request_timeout = HI_MCI_REQUEST_TIMEOUT;
+int trace_level = HIMCI_TRACE_LEVEL;
+unsigned int slot_index = 0;
+struct himci_host *mci_host[HIMCI_SLOT_NUM] = {NULL};
+
+#ifdef MODULE
+
+module_param(detect_time, uint, 0600);
+MODULE_PARM_DESC(detect_timer, "card detect time (default:500ms))");
+
+module_param(retry_count, uint, 0600);
+MODULE_PARM_DESC(retry_count, "retry count times (default:100))");
+
+module_param(request_timeout, uint, 0600);
+MODULE_PARM_DESC(request_timeout, "Request timeout time (default:3s))");
+
+module_param(trace_level, int, 0600);
+MODULE_PARM_DESC(trace_level, "HIMCI_TRACE_LEVEL");
+
+#endif
+
+/* reset MMC host controller */
+static void himci_sys_reset(struct himci_host *host)
+{
+ unsigned int reg_value;
+ unsigned long flags;
+
+ himci_trace(2, "reset");
+
+ local_irq_save(flags);
+
+ reg_value = himci_readl(host->base + MCI_BMOD);
+ reg_value |= BMOD_SWR;
+ himci_writel(reg_value, host->base + MCI_BMOD);
+ mdelay(10);
+
+ reg_value = himci_readl(host->base + MCI_BMOD);
+ reg_value |= BURST_16 | BURST_INCR;
+ himci_writel(reg_value, host->base + MCI_BMOD);
+
+ reg_value = himci_readl(host->base + MCI_CTRL);
+ reg_value |= CTRL_RESET | FIFO_RESET | DMA_RESET;
+ himci_writel(reg_value, host->base + MCI_CTRL);
+
+ local_irq_restore(flags);
+}
+
+static void himci_ctrl_power(struct himci_host *host, unsigned int flag)
+{
+ himci_trace(2, "begin");
+
+ himci_writel(flag, host->base + MCI_PWREN);
+}
+
+/**********************************************
+ *1: card off
+ *0: card on
+ ***********************************************/
+static unsigned int himci_sys_card_detect(struct himci_host *host)
+{
+ unsigned int card_status;
+
+ card_status = readl(host->base + MCI_CDETECT);
+
+ return card_status & HIMCI_CARD0;
+}
+
+/**********************************************
+ *1: card readonly
+ *0: card read/write
+ ***********************************************/
+static unsigned int himci_ctrl_card_readonly(struct himci_host *host)
+{
+ unsigned int card_value = himci_readl(host->base + MCI_WRTPRT);
+ return card_value & HIMCI_CARD0;
+}
+
+static int himci_wait_cmd(struct himci_host *host)
+{
+ int wait_retry_count = 0;
+ unsigned int reg_data = 0;
+ unsigned long flags;
+
+ himci_trace(2, "begin");
+ himci_assert(host);
+
+ while (1) {
+ /*
+ * Check if CMD::start_cmd bit is clear.
+ * start_cmd = 0 means MMC Host controller has loaded registers
+ * and next command can be loaded in.
+ */
+ reg_data = himci_readl(host->base + MCI_CMD);
+ if ((reg_data & START_CMD) == 0)
+ return 0;
+
+ /* Check if Raw_Intr_Status::HLE bit is set. */
+ spin_lock_irqsave(&host->lock, flags);
+ reg_data = himci_readl(host->base + MCI_RINTSTS);
+ if (reg_data & HLE_INT_STATUS) {
+ reg_data |= HLE_INT_STATUS;
+ himci_writel(reg_data, host->base + MCI_RINTSTS);
+ spin_unlock_irqrestore(&host->lock, flags);
+
+ himci_trace(5, "Other CMD is running,"
+ "please operate cmd again!");
+ return 1;
+ }
+
+ spin_unlock_irqrestore(&host->lock, flags);
+ udelay(100);
+
+ /* Check if number of retries for this are over. */
+ wait_retry_count++;
+ if (wait_retry_count >= retry_count) {
+ himci_trace(5, "send cmd is timeout!");
+ return -1;
+ }
+ }
+}
+
+static void himci_control_cclk(struct himci_host *host, unsigned int flag)
+{
+ unsigned int reg;
+ union cmd_arg_u cmd_reg;
+
+ himci_trace(2, "begin");
+ himci_assert(host);
+
+ reg = himci_readl(host->base + MCI_CLKENA);
+ if (flag == ENABLE)
+ reg |= CCLK_ENABLE;
+ else
+ reg &= 0xffff0000;
+ himci_writel(reg, host->base + MCI_CLKENA);
+
+ cmd_reg.cmd_arg = himci_readl(host->base + MCI_CMD);
+ cmd_reg.bits.start_cmd = 1;
+ cmd_reg.bits.card_number = 0;
+ cmd_reg.bits.cmd_index = 0;
+ cmd_reg.bits.data_transfer_expected = 0;
+ cmd_reg.bits.update_clk_reg_only = 1;
+ cmd_reg.bits.response_expect = 0;
+ cmd_reg.bits.send_auto_stop = 0;
+ cmd_reg.bits.wait_prvdata_complete = 0;
+ cmd_reg.bits.check_response_crc = 0;
+ himci_writel(cmd_reg.cmd_arg, host->base + MCI_CMD);
+ if (himci_wait_cmd(host) != 0)
+ himci_trace(5, "disable or enable clk is timeout!");
+}
+
+static void himci_set_cclk(struct himci_host *host, unsigned int cclk)
+{
+ unsigned int reg_value;
+ union cmd_arg_u clk_cmd;
+ unsigned int hclk;
+
+ himci_trace(2, "begin");
+ himci_assert(host);
+ himci_assert(cclk);
+
+ clk_set_rate(host->clk, host->mmc->f_max);
+
+ hclk = clk_get_rate(host->clk);
+
+ /*
+ * set card clk divider value,
+ * clk_divider = Fmmcclk/(Fmmc_cclk * 2)
+ */
+ reg_value = hclk / (cclk * 2);
+ if ((hclk % (cclk * 2)) && (hclk > cclk))
+ reg_value++;
+ if (reg_value > 0xFF)
+ reg_value = 0xFF;
+
+ host->hclk = hclk;
+ host->cclk = reg_value ? (hclk / (reg_value * 2)) : hclk;
+ himci_writel(reg_value, host->base + MCI_CLKDIV);
+
+ clk_cmd.cmd_arg = himci_readl(host->base + MCI_CMD);
+ clk_cmd.bits.start_cmd = 1;
+ clk_cmd.bits.update_clk_reg_only = 1;
+ clk_cmd.bits.cmd_index = 0;
+ clk_cmd.bits.data_transfer_expected = 0;
+ clk_cmd.bits.response_expect = 0;
+ himci_writel(clk_cmd.cmd_arg, host->base + MCI_CMD);
+ if (himci_wait_cmd(host) != 0)
+ himci_trace(5, "set card clk divider is failed!");
+}
+
+static void himci_init_host(struct himci_host *host)
+{
+ unsigned int tmp_reg = 0;
+ unsigned long flags;
+
+ himci_trace(2, "begin");
+ himci_assert(host);
+
+ himci_sys_reset(host);
+
+ /* set drv/smpl phase shift */
+ tmp_reg |= SMPL_PHASE_DFLT | DRV_PHASE_DFLT;
+ himci_writel(tmp_reg, host->base + MCI_UHS_REG_EXT);
+
+ /* set card read threshold */
+ himci_writel(RW_THRESHOLD_SIZE, host->base + MCI_CARDTHRCTL);
+
+ /* clear MMC host intr */
+ himci_writel(ALL_INT_CLR, host->base + MCI_RINTSTS);
+
+ spin_lock_irqsave(&host->lock, flags);
+ host->pending_events = 0;
+ spin_unlock_irqrestore(&host->lock, flags);
+
+ /* MASK MMC all host intr */
+ tmp_reg = himci_readl(host->base + MCI_INTMASK);
+ tmp_reg &= ~ALL_INT_MASK;
+ tmp_reg |= DATA_INT_MASK;
+ himci_writel(tmp_reg, host->base + MCI_INTMASK);
+
+ /* enable inner DMA mode and close intr of MMC host controler */
+ tmp_reg = himci_readl(host->base + MCI_CTRL);
+ tmp_reg &= ~INTR_EN;
+ tmp_reg |= USE_INTERNAL_DMA | INTR_EN;
+ himci_writel(tmp_reg, host->base + MCI_CTRL);
+
+ /* set timeout param */
+ himci_writel(DATA_TIMEOUT | RESPONSE_TIMEOUT, host->base + MCI_TIMEOUT);
+
+ /* set FIFO param */
+ tmp_reg = 0;
+ tmp_reg |= BURST_SIZE | RX_WMARK | TX_WMARK;
+ himci_writel(tmp_reg, host->base + MCI_FIFOTH);
+}
+
+static void himci_detect_card(unsigned long arg)
+{
+ struct himci_host *host = (struct himci_host *)arg;
+ unsigned int i, curr_status, status[5], detect_retry_count = 0;
+
+ himci_assert(host);
+
+ while (1) {
+ for (i = 0; i < 5; i++) {
+ status[i] = himci_sys_card_detect(host);
+ udelay(10);
+ }
+ if ((status[0] == status[1])
+ && (status[0] == status[2])
+ && (status[0] == status[3])
+ && (status[0] == status[4]))
+ break;
+
+ detect_retry_count++;
+ if (detect_retry_count >= retry_count) {
+ himci_error("this is a dithering, card detect error!");
+ goto err;
+ }
+ }
+ curr_status = status[0];
+ if (curr_status != host->card_status) {
+ himci_trace(2, "begin card_status = %d\n", host->card_status);
+ host->card_status = curr_status;
+ if (curr_status != CARD_UNPLUGED) {
+ himci_init_host(host);
+ pr_info("card connected!\n");
+ } else {
+ pr_info("card disconnected!\n");
+ }
+
+ mmc_detect_change(host->mmc, 0);
+ }
+err:
+ mod_timer(&host->timer, jiffies + detect_time);
+}
+
+static void himci_idma_start(struct himci_host *host)
+{
+ unsigned int tmp;
+
+ himci_trace(2, "begin");
+ himci_writel(host->dma_paddr, host->base + MCI_DBADDR);
+ tmp = himci_readl(host->base + MCI_BMOD);
+ tmp |= BMOD_DMA_EN;
+ himci_writel(tmp, host->base + MCI_BMOD);
+}
+
+static void himci_idma_stop(struct himci_host *host)
+{
+ unsigned int tmp_reg;
+
+ himci_trace(2, "begin");
+ tmp_reg = himci_readl(host->base + MCI_BMOD);
+ tmp_reg &= ~BMOD_DMA_EN;
+ himci_writel(tmp_reg, host->base + MCI_BMOD);
+}
+
+static int himci_setup_data(struct himci_host *host, struct mmc_data *data)
+{
+ unsigned int sg_phyaddr, sg_length;
+ unsigned int i, ret = 0;
+ unsigned int data_size;
+ unsigned int max_des, des_cnt;
+ struct himci_des *des;
+
+ himci_trace(2, "begin");
+ himci_assert(host);
+ himci_assert(data);
+
+ host->data = data;
+
+ if (data->flags & MMC_DATA_READ)
+ host->dma_dir = DMA_FROM_DEVICE;
+ else
+ host->dma_dir = DMA_TO_DEVICE;
+
+ host->dma_sg = data->sg;
+ host->dma_sg_num = dma_map_sg(mmc_dev(host->mmc),
+ data->sg, data->sg_len, host->dma_dir);
+ himci_assert(host->dma_sg_num);
+ himci_trace(2, "host->dma_sg_num is %d\n", host->dma_sg_num);
+ data_size = data->blksz * data->blocks;
+
+ if (data_size > (DMA_BUFFER * MAX_DMA_DES)) {
+ himci_error("mci request data_size is too big!\n");
+ ret = -1;
+ goto out;
+ }
+
+ himci_trace(2, "host->dma_paddr is 0x%08X,host->dma_vaddr is 0x%08X\n",
+ (unsigned int)host->dma_paddr,
+ (unsigned int)host->dma_vaddr);
+
+ max_des = (CMD_DES_PAGE_SIZE/sizeof(struct himci_des));
+ des = (struct himci_des *)host->dma_vaddr;
+ des_cnt = 0;
+
+ for (i = 0; i < host->dma_sg_num; i++) {
+ sg_length = sg_dma_len(&data->sg[i]);
+ sg_phyaddr = sg_dma_address(&data->sg[i]);
+ himci_trace(2, "sg[%d] sg_length is 0x%08X, " \
+ "sg_phyaddr is 0x%08X\n", \
+ i, (unsigned int)sg_length, \
+ (unsigned int)sg_phyaddr);
+ while (sg_length) {
+ des[des_cnt].idmac_des_ctrl = DMA_DES_OWN
+ | DMA_DES_NEXT_DES;
+ des[des_cnt].idmac_des_buf_addr = sg_phyaddr;
+ /* idmac_des_next_addr is paddr for dma */
+ des[des_cnt].idmac_des_next_addr = host->dma_paddr
+ + (des_cnt + 1) * sizeof(struct himci_des);
+
+ if (sg_length >= 0x1F00) {
+ des[des_cnt].idmac_des_buf_size = 0x1F00;
+ sg_length -= 0x1F00;
+ sg_phyaddr += 0x1F00;
+ } else {
+ /* FIXME:data alignment */
+ des[des_cnt].idmac_des_buf_size = sg_length;
+ sg_length = 0;
+ }
+
+ himci_trace(2, "des[%d] vaddr is 0x%08X", i,
+ (unsigned int)&des[i]);
+ himci_trace(2, "des[%d].idmac_des_ctrl is 0x%08X",
+ i, (unsigned int)des[i].idmac_des_ctrl);
+ himci_trace(2, "des[%d].idmac_des_buf_size is 0x%08X",
+ i, (unsigned int)des[i].idmac_des_buf_size);
+ himci_trace(2, "des[%d].idmac_des_buf_addr 0x%08X",
+ i, (unsigned int)des[i].idmac_des_buf_addr);
+ himci_trace(2, "des[%d].idmac_des_next_addr is 0x%08X",
+ i, (unsigned int)des[i].idmac_des_next_addr);
+ des_cnt++;
+ }
+
+ himci_assert(des_cnt < max_des);
+ }
+ des[0].idmac_des_ctrl |= DMA_DES_FIRST_DES;
+ des[des_cnt - 1].idmac_des_ctrl |= DMA_DES_LAST_DES;
+ des[des_cnt - 1].idmac_des_next_addr = 0;
+out:
+ return ret;
+}
+
+static int himci_exec_cmd(struct himci_host *host,
+ struct mmc_command *cmd, struct mmc_data *data)
+{
+ volatile union cmd_arg_u cmd_regs;
+
+ himci_trace(2, "begin");
+ himci_assert(host);
+ himci_assert(cmd);
+
+ host->cmd = cmd;
+
+ himci_writel(cmd->arg, host->base + MCI_CMDARG);
+ himci_trace(4, "arg_reg 0x%x, val 0x%x", MCI_CMDARG, cmd->arg);
+ cmd_regs.cmd_arg = himci_readl(host->base + MCI_CMD);
+ if (data) {
+ cmd_regs.bits.data_transfer_expected = 1;
+ if (data->flags & (MMC_DATA_WRITE | MMC_DATA_READ))
+ cmd_regs.bits.transfer_mode = 0;
+
+ if (data->flags & MMC_DATA_WRITE)
+ cmd_regs.bits.read_write = 1;
+ else if (data->flags & MMC_DATA_READ)
+ cmd_regs.bits.read_write = 0;
+ } else {
+ cmd_regs.bits.data_transfer_expected = 0;
+ cmd_regs.bits.transfer_mode = 0;
+ cmd_regs.bits.read_write = 0;
+ }
+
+ cmd_regs.bits.send_auto_stop = 0;
+#ifdef CONFIG_SEND_AUTO_STOP
+ if ((host->mrq->stop) && (!(host->is_tuning)))
+ cmd_regs.bits.send_auto_stop = 1;
+#endif
+
+ if (cmd == host->mrq->stop ||
+ cmd->opcode == MMC_STOP_TRANSMISSION) {
+ cmd_regs.bits.stop_abort_cmd = 1;
+ cmd_regs.bits.wait_prvdata_complete = 0;
+ } else {
+ cmd_regs.bits.stop_abort_cmd = 0;
+ cmd_regs.bits.wait_prvdata_complete = 1;
+ }
+
+ switch (mmc_resp_type(cmd)) {
+ case MMC_RSP_NONE:
+ cmd_regs.bits.response_expect = 0;
+ cmd_regs.bits.response_length = 0;
+ cmd_regs.bits.check_response_crc = 0;
+ break;
+ case MMC_RSP_R1:
+ case MMC_RSP_R1B:
+ cmd_regs.bits.response_expect = 1;
+ cmd_regs.bits.response_length = 0;
+ cmd_regs.bits.check_response_crc = 1;
+ break;
+ case MMC_RSP_R2:
+ cmd_regs.bits.response_expect = 1;
+ cmd_regs.bits.response_length = 1;
+ cmd_regs.bits.check_response_crc = 1;
+ break;
+ case MMC_RSP_R3:
+ case MMC_RSP_R1 & (~MMC_RSP_CRC):
+ cmd_regs.bits.response_expect = 1;
+ cmd_regs.bits.response_length = 0;
+ cmd_regs.bits.check_response_crc = 0;
+ break;
+ default:
+ host->cmd->error = -EINVAL;
+ himci_error("himci: unhandled response type %02x\n",
+ mmc_resp_type(cmd));
+ return -EINVAL;
+ }
+
+ himci_trace(3, "cmd->opcode = %d cmd->arg = 0x%X\n",
+ cmd->opcode, cmd->arg);
+ if (cmd->opcode == MMC_GO_IDLE_STATE)
+ cmd_regs.bits.send_initialization = 1;
+ else
+ cmd_regs.bits.send_initialization = 0;
+ /* CMD 11 check switch voltage */
+ if (cmd->opcode == SD_SWITCH_VOLTAGE)
+ cmd_regs.bits.volt_switch = 1;
+ else
+ cmd_regs.bits.volt_switch = 0;
+
+ cmd_regs.bits.card_number = 0;
+ cmd_regs.bits.cmd_index = cmd->opcode;
+ cmd_regs.bits.start_cmd = 1;
+ cmd_regs.bits.update_clk_reg_only = 0;
+
+ himci_writel(DATA_INT_MASK, host->base + MCI_RINTSTS);
+ himci_writel(cmd_regs.cmd_arg, host->base + MCI_CMD);
+ himci_trace(4, "cmd_reg 0x%x, val 0x%x\n", MCI_CMD, cmd_regs.cmd_arg);
+
+ if (himci_wait_cmd(host) != 0) {
+ himci_trace(3, "send card cmd is failed!");
+ return -EINVAL;
+ }
+ return 0;
+}
+
+static void himci_finish_request(struct himci_host *host,
+ struct mmc_request *mrq)
+{
+ himci_trace(2, "begin");
+ himci_assert(host);
+ himci_assert(mrq);
+
+ host->mrq = NULL;
+ host->cmd = NULL;
+ host->data = NULL;
+ mmc_request_done(host->mmc, mrq);
+}
+
+static void himci_cmd_done(struct himci_host *host, unsigned int stat)
+{
+ unsigned int i;
+ struct mmc_command *cmd = host->cmd;
+
+ himci_trace(2, "begin");
+ himci_assert(host);
+ himci_assert(cmd);
+
+ for (i = 0; i < 4; i++) {
+ if (mmc_resp_type(cmd) == MMC_RSP_R2) {
+ cmd->resp[i] = himci_readl(host->base +
+ MCI_RESP3 - i * 0x4);
+ /* R2 must delay some time here ,when use UHI card,
+ need check why */
+ udelay(1000);
+ } else
+ cmd->resp[i] = himci_readl(host->base +
+ MCI_RESP0 + i * 0x4);
+ }
+
+ if (stat & RTO_INT_STATUS) {
+ cmd->error = -ETIMEDOUT;
+ himci_trace(3, "irq cmd status stat = 0x%x is timeout error!",
+ stat);
+ } else if (stat & (RCRC_INT_STATUS | RE_INT_STATUS)) {
+ cmd->error = -EILSEQ;
+ himci_trace(3, "irq cmd status stat = 0x%x is response error!",
+ stat);
+ }
+
+ host->cmd = NULL;
+}
+
+static void himci_data_done(struct himci_host *host, unsigned int stat)
+{
+ struct mmc_data *data = host->data;
+
+ himci_trace(2, "begin");
+ himci_assert(host);
+ himci_assert(data);
+
+ dma_unmap_sg(mmc_dev(host->mmc), data->sg, data->sg_len, host->dma_dir);
+
+ if (stat & (HTO_INT_STATUS | DRTO_INT_STATUS)) {
+ data->error = -ETIMEDOUT;
+ himci_trace(3, "irq data status stat = 0x%x is timeout error!",
+ stat);
+ } else if (stat & (EBE_INT_STATUS | SBE_INT_STATUS |
+ FRUN_INT_STATUS | DCRC_INT_STATUS)) {
+ data->error = -EILSEQ;
+ himci_trace(3, "irq data status stat = 0x%x is data error!",
+ stat);
+ }
+
+ if (!data->error)
+ data->bytes_xfered = data->blocks * data->blksz;
+ else
+ data->bytes_xfered = 0;
+
+ host->data = NULL;
+}
+
+static int himci_wait_cmd_complete(struct himci_host *host)
+{
+ unsigned int cmd_retry_count = 0;
+ unsigned long cmd_jiffies_timeout;
+ unsigned int cmd_irq_reg = 0;
+ struct mmc_command *cmd = host->cmd;
+ unsigned long flags;
+
+ himci_trace(2, "begin");
+ himci_assert(host);
+ himci_assert(cmd);
+
+ cmd_jiffies_timeout = jiffies + request_timeout;
+ while (1) {
+
+ do {
+ spin_lock_irqsave(&host->lock, flags);
+ cmd_irq_reg = readl(host->base + MCI_RINTSTS);
+
+ if (cmd_irq_reg & CD_INT_STATUS) {
+ himci_writel((CD_INT_STATUS | RTO_INT_STATUS
+ | RCRC_INT_STATUS | RE_INT_STATUS),
+ host->base + MCI_RINTSTS);
+ spin_unlock_irqrestore(&host->lock, flags);
+ himci_cmd_done(host, cmd_irq_reg);
+ return 0;
+ } else if (cmd_irq_reg & VOLT_SWITCH_INT_STATUS) {
+ himci_writel(VOLT_SWITCH_INT_STATUS,
+ host->base + MCI_RINTSTS);
+ spin_unlock_irqrestore(&host->lock, flags);
+ himci_cmd_done(host, cmd_irq_reg);
+ return 0;
+ }
+ spin_unlock_irqrestore(&host->lock, flags);
+ cmd_retry_count++;
+ } while (cmd_retry_count < retry_count);
+
+ cmd_retry_count = 0;
+
+ if (host->card_status == CARD_UNPLUGED) {
+ cmd->error = -ETIMEDOUT;
+ return -1;
+ }
+
+ if (!time_before(jiffies, cmd_jiffies_timeout)) {
+ unsigned int i = 0;
+ for (i = 0; i < 4; i++) {
+ cmd->resp[i] = himci_readl(host->base
+ + MCI_RESP0 + i * 0x4);
+ pr_err("voltage switch read MCI_RESP");
+ pr_err("%d : 0x%x\n", i, cmd->resp[i]);
+ }
+ cmd->error = -ETIMEDOUT;
+ himci_trace(3, "wait cmd request complete is timeout!");
+ return -1;
+ }
+
+ schedule();
+ }
+}
+/*
+ * designware support send stop command automatically when
+ * read or wirte multi blocks
+ */
+#ifdef CONFIG_SEND_AUTO_STOP
+static int himci_wait_auto_stop_complete(struct himci_host *host)
+{
+ unsigned int cmd_retry_count = 0;
+ unsigned long cmd_jiffies_timeout;
+ unsigned int cmd_irq_reg = 0;
+ unsigned long flags;
+
+ himci_trace(2, "begin");
+ himci_assert(host);
+
+ cmd_jiffies_timeout = jiffies + request_timeout;
+ while (1) {
+
+ do {
+ spin_lock_irqsave(&host->lock, flags);
+ cmd_irq_reg = readl(host->base + MCI_RINTSTS);
+ if (cmd_irq_reg & ACD_INT_STATUS) {
+ himci_writel((ACD_INT_STATUS | RTO_INT_STATUS
+ | RCRC_INT_STATUS | RE_INT_STATUS),
+ host->base + MCI_RINTSTS);
+ spin_unlock_irqrestore(&host->lock, flags);
+ return 0;
+ }
+ spin_unlock_irqrestore(&host->lock, flags);
+ cmd_retry_count++;
+ } while (cmd_retry_count < retry_count);
+
+ cmd_retry_count = 0;
+ if (host->card_status == CARD_UNPLUGED)
+ return -1;
+ if (!time_before(jiffies, cmd_jiffies_timeout)) {
+ himci_trace(3, "wait auto stop complete is timeout!");
+ return -1;
+ }
+
+ schedule();
+ }
+
+}
+#endif
+
+static int himci_wait_data_complete(struct himci_host *host)
+{
+ unsigned int tmp_reg;
+ struct mmc_data *data = host->data;
+ long time = request_timeout;
+ unsigned long flags;
+
+ himci_trace(2, "begin");
+ himci_assert(host);
+ himci_assert(data);
+
+ time = wait_event_timeout(host->intr_wait,
+ test_bit(HIMCI_PEND_DTO_B,
+ &host->pending_events), time);
+
+ /* Mask MMC host data intr */
+ spin_lock_irqsave(&host->lock, flags);
+ tmp_reg = himci_readl(host->base + MCI_INTMASK);
+ tmp_reg &= ~DATA_INT_MASK;
+ himci_writel(tmp_reg, host->base + MCI_INTMASK);
+ host->pending_events &= ~HIMCI_PEND_DTO_M;
+ spin_unlock_irqrestore(&host->lock, flags);
+
+ if (((time <= 0)
+ && (!test_bit(HIMCI_PEND_DTO_B, &host->pending_events)))
+ || (host->card_status == CARD_UNPLUGED)) {
+
+ data->error = -ETIMEDOUT;
+ himci_trace(5, "wait data request complete is timeout! 0x%08X",
+ host->irq_status);
+ himci_idma_stop(host);
+ himci_data_done(host, host->irq_status);
+ return -1;
+ }
+
+ himci_idma_stop(host);
+ himci_data_done(host, host->irq_status);
+ return 0;
+}
+
+static int himci_wait_card_complete(struct himci_host *host,
+ struct mmc_data *data)
+{
+ unsigned int card_retry_count = 0;
+ unsigned long card_jiffies_timeout;
+ unsigned int card_status_reg = 0;
+
+ himci_trace(2, "begin");
+ himci_assert(host);
+
+ card_jiffies_timeout = jiffies + request_timeout;
+ while (1) {
+ do {
+ card_status_reg = readl(host->base + MCI_STATUS);
+ if (!(card_status_reg & DATA_BUSY)) {
+ himci_trace(2, "end");
+ return 0;
+ }
+ card_retry_count++;
+ } while (card_retry_count < retry_count);
+
+ card_retry_count = 0;
+
+ if (host->card_status == CARD_UNPLUGED) {
+ host->mrq->cmd->error = -ETIMEDOUT;
+ himci_trace(3, "card is unpluged!");
+ return -1;
+ }
+
+ if (!time_before(jiffies, card_jiffies_timeout)) {
+ host->mrq->cmd->error = -ETIMEDOUT;
+ himci_trace(3, "wait card ready complete is timeout!");
+ return -1;
+ }
+
+ schedule();
+ }
+}
+
+static void himci_request(struct mmc_host *mmc, struct mmc_request *mrq)
+{
+ struct himci_host *host = mmc_priv(mmc);
+ int byte_cnt = 0, trans_cnt;
+ int fifo_count = 0, tmp_reg;
+ int ret = 0;
+ unsigned long flags;
+
+ himci_trace(2, "begin");
+ himci_assert(mmc);
+ himci_assert(mrq);
+ himci_assert(host);
+
+ host->mrq = mrq;
+ host->irq_status = 0;
+
+ if (host->card_status == CARD_UNPLUGED) {
+ mrq->cmd->error = -ENODEV;
+ goto request_end;
+ }
+
+ ret = himci_wait_card_complete(host, mrq->data);
+ if (ret) {
+ mrq->cmd->error = ret;
+ goto request_end;
+ }
+
+ /* prepare data */
+ if (mrq->data) {
+ ret = himci_setup_data(host, mrq->data);
+ if (ret) {
+ mrq->data->error = ret;
+ himci_trace(3, "data setup is error!");
+ goto request_end;
+ }
+
+ byte_cnt = mrq->data->blksz * mrq->data->blocks;
+ himci_writel(byte_cnt, host->base + MCI_BYTCNT);
+ himci_writel(mrq->data->blksz, host->base + MCI_BLKSIZ);
+
+ /* reset fifo */
+ tmp_reg = himci_readl(host->base + MCI_CTRL);
+ tmp_reg |= FIFO_RESET;
+ himci_writel(tmp_reg, host->base + MCI_CTRL);
+
+ do {
+ tmp_reg = himci_readl(host->base + MCI_CTRL);
+ fifo_count++;
+ if (fifo_count >= retry_count) {
+ pr_info("fifo reset is timeout!");
+ return;
+ }
+ } while (tmp_reg & FIFO_RESET);
+
+ /* start DMA */
+ himci_idma_start(host);
+ } else {
+ himci_writel(0, host->base + MCI_BYTCNT);
+ himci_writel(0, host->base + MCI_BLKSIZ);
+ }
+
+ /* send command */
+ ret = himci_exec_cmd(host, mrq->cmd, mrq->data);
+ if (ret) {
+ mrq->cmd->error = ret;
+ himci_idma_stop(host);
+ himci_trace(3, "can't send card cmd! ret = %d", ret);
+ goto request_end;
+ }
+
+ /* wait command send complete */
+ himci_wait_cmd_complete(host);
+
+ /* start data transfer */
+ if (mrq->data) {
+ if (!(mrq->cmd->error)) {
+ /* Open MMC host data intr */
+ spin_lock_irqsave(&host->lock, flags);
+ tmp_reg = himci_readl(host->base + MCI_INTMASK);
+ tmp_reg |= DATA_INT_MASK;
+ himci_writel(tmp_reg, host->base + MCI_INTMASK);
+ spin_unlock_irqrestore(&host->lock, flags);
+
+ /* wait data transfer complete */
+ himci_wait_data_complete(host);
+ } else {
+ /* CMD error in data command */
+ himci_idma_stop(host);
+ }
+
+ if (mrq->stop) {
+#ifdef CONFIG_SEND_AUTO_STOP
+ trans_cnt = himci_readl(host->base + MCI_TCBCNT);
+ /* send auto stop */
+ if ((trans_cnt == byte_cnt) && (!(host->is_tuning))) {
+ himci_trace(3, "byte_cnt = %d, trans_cnt = %d",
+ byte_cnt, trans_cnt);
+ ret = himci_wait_auto_stop_complete(host);
+ if (ret) {
+ mrq->stop->error = -ETIMEDOUT;
+ goto request_end;
+ }
+ } else {
+#endif
+ /* send soft stop command */
+ himci_trace(3, "this time, send soft stop");
+ ret = himci_exec_cmd(host, host->mrq->stop,
+ host->data);
+ if (ret) {
+ mrq->stop->error = ret;
+ goto request_end;
+ }
+ ret = himci_wait_cmd_complete(host);
+ if (ret)
+ goto request_end;
+#ifdef CONFIG_SEND_AUTO_STOP
+ }
+#endif
+ }
+ }
+
+request_end:
+ /* clear MMC host intr */
+ spin_lock_irqsave(&host->lock, flags);
+ himci_writel(ALL_SD_INT_CLR, host->base + MCI_RINTSTS);
+ spin_unlock_irqrestore(&host->lock, flags);
+
+ himci_finish_request(host, mrq);
+}
+
+static int himci_do_voltage_switch(struct himci_host *host,
+ struct mmc_ios *ios)
+{
+ u32 ctrl;
+
+ /*
+ * We first check whether the request is to set signalling voltage
+ * to 3.3V. If so, we change the voltage to 3.3V and return quickly.
+ */
+ ctrl = himci_readl(host->base + MCI_UHS_REG);
+ if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_330) {
+ /* Set 1.8V Signal Enable in the MCI_UHS_REG to 1 */
+ himci_trace(3, "switch voltage 330");
+ ctrl &= ~HI_SDXC_CTRL_VDD_180;
+ himci_writel(ctrl, host->base + MCI_UHS_REG);
+
+ /* Wait for 5ms */
+ usleep_range(5000, 5500);
+
+ /* 3.3V regulator output should be stable within 5 ms */
+ ctrl = himci_readl(host->base + MCI_UHS_REG);
+ if (!(ctrl & HI_SDXC_CTRL_VDD_180)) {
+ /* config Pin drive capability */
+ himci_set_drv_cap(host, 1);
+ return 0;
+ } else {
+ himci_error(": Switching to 3.3V ");
+ himci_error("signalling voltage failed\n");
+ return -EIO;
+ }
+ } else if (!(ctrl & HI_SDXC_CTRL_VDD_180) &&
+ (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_180)) {
+ /* Stop SDCLK */
+ himci_trace(3, "switch voltage 180");
+ himci_control_cclk(host, DISABLE);
+
+
+ /*
+ * Enable 1.8V Signal Enable in the MCI_UHS_REG
+ */
+ ctrl |= HI_SDXC_CTRL_VDD_180;
+ himci_writel(ctrl, host->base + MCI_UHS_REG);
+
+ /* Wait for 5ms */
+ usleep_range(8000, 8500);
+
+ ctrl = himci_readl(host->base + MCI_UHS_REG);
+ if (ctrl & HI_SDXC_CTRL_VDD_180) {
+ /* Provide SDCLK again and wait for 1ms */
+ himci_control_cclk(host, ENABLE);
+ usleep_range(1000, 1500);
+
+ /*
+ * If CMD11 return CMD down, then the card
+ * was successfully switched to 1.8V signaling.
+ */
+ ctrl = himci_readl(host->base + MCI_RINTSTS);
+ if ((ctrl & VOLT_SWITCH_INT_STATUS)
+ && (ctrl & CD_INT_STATUS)) {
+ /* config Pin drive capability */
+ himci_set_drv_cap(host, 0);
+ return 0;
+ }
+ }
+
+ /*
+ * If we are here, that means the switch to 1.8V signaling
+ * failed. We power cycle the card, and retry initialization
+ * sequence by setting S18R to 0.
+ */
+ himci_control_cclk(host, DISABLE);
+
+ /* Wait for 1ms as per the spec */
+ usleep_range(1000, 1500);
+ himci_control_cclk(host, ENABLE);
+
+ himci_error(": Switching to 1.8V signalling ");
+ himci_error("voltage failed, retrying with S18R set to 0\n");
+ return -EAGAIN;
+ } else
+ /* No signal voltage switch required */
+ return 0;
+}
+
+static int himci_start_signal_voltage_switch(struct mmc_host *mmc,
+ struct mmc_ios *ios)
+{
+ struct himci_host *host = mmc_priv(mmc);
+ int err;
+
+ err = himci_do_voltage_switch(host, ios);
+ return err;
+}
+
+static int himci_send_stop(struct mmc_host *host)
+{
+ struct mmc_command cmd = {0};
+ int err;
+
+ cmd.opcode = MMC_STOP_TRANSMISSION;
+ cmd.flags = MMC_RSP_SPI_R1B | MMC_RSP_R1B | MMC_CMD_AC;
+ err = mmc_wait_for_cmd(host, &cmd, 0);
+ return err;
+}
+
+static void himci_set_sap_phase(struct himci_host *host, u32 phase)
+{
+ unsigned int reg_value;
+ unsigned long flags;
+
+ spin_lock_irqsave(&host->lock, flags);
+
+ reg_value = himci_readl(host->base + MCI_UHS_REG_EXT);
+ reg_value &= ~CLK_SMPL_PHS_MASK;
+ reg_value |= (phase << CLK_SMPL_PHS_SHIFT);
+ himci_writel(reg_value, host->base + MCI_UHS_REG_EXT);
+
+ spin_unlock_irqrestore(&host->lock, flags);
+}
+
+/*
+ * The procedure of tuning the phase shift of sampling clock
+ *
+ * 1.Set a phase shift of 0° on cclk_in_sample
+ * 2.Send the Tuning command to the card
+ * 3.increase the phase shift value of cclk_in_sample until the
+ * correct sampling point is received such that the host does not
+ * see any of the errors.
+ * 4.Mark this phase shift value as the starting point of the sampling
+ * window.
+ * 5.increase the phase shift value of cclk_in_sample until the host
+ * sees the errors starting to come again or the phase shift value
+ * reaches 360°.
+ * 6.Mark the last successful phase shift value as the ending
+ * point of the sampling window.
+ *
+ * A window is established where the tuning block is matched.
+ * For example, for a scenario where the tuning block is received
+ * correctly for a phase shift window of 90°and 180°, then an appropriate
+ * sampling point is established as 135°. Once a sampling point is
+ * established, no errors should be visible in the tuning block.
+ *
+ */
+static int himci_execute_tuning(struct mmc_host *mmc, u32 opcode)
+{
+ struct himci_host *host;
+ unsigned int index, count;
+ unsigned int err = 0;
+ unsigned int found = 0; /* identify if we have found a valid phase */
+ unsigned int start_point;
+ unsigned int end_point;
+ unsigned int prev_err = NOT_FOUND;
+ unsigned int raise_point = NOT_FOUND;
+ unsigned int fall_point = NOT_FOUND;
+ int phase, ret;
+
+
+ start_point = TUNING_START_PHASE;
+ end_point = TUNING_END_PHASE;
+
+ host = mmc_priv(mmc);
+
+ himci_writel(0x1, host->base + MCI_CARDTHRCTL);
+
+ himci_trace(3, "start sd3.0 phase tuning...");
+ host->is_tuning = 1;
+ for (index = start_point; index <= end_point; index++) {
+ /* set sample clk phase shift */
+ himci_set_sap_phase(host, index);
+
+ count = 0;
+ do {
+ ret = mmc_send_tuning(mmc, opcode, NULL);
+ himci_send_stop(mmc); /* send soft_stop tail */
+
+ if (ret) {
+ himci_trace(3, "send tuning CMD%u fail! phase:%d err:%d\n",
+ opcode, index, ret);
+ err = 1;
+ break;
+ }
+ count++;
+ } while (count < 1);
+
+ if (!err)
+ found = 1; /* found a valid phase */
+
+ if (index > start_point) {
+ if (err && !prev_err)
+ fall_point = index - 1;
+
+ if (!err && prev_err)
+ raise_point = index;
+ }
+
+ if ((raise_point != NOT_FOUND) && (fall_point != NOT_FOUND))
+ goto tuning_out;
+
+ prev_err = err;
+ err = 0;
+ }
+
+tuning_out:
+ host->is_tuning = 0;
+ if (!found) {
+ himci_trace(5, "%s: no valid phase shift! use default",
+ mmc_hostname(mmc));
+ himci_writel(DEFAULT_PHASE, host->base + MCI_UHS_REG_EXT);
+ } else {
+ himci_trace(3, "Tuning finished!!");
+
+ if (NOT_FOUND == raise_point)
+ raise_point = start_point;
+ if (NOT_FOUND == fall_point)
+ fall_point = end_point;
+
+ if (fall_point < raise_point) {
+ phase = (raise_point + fall_point) / 2;
+ phase = phase - (HIMCI_PHASE_SCALE / 2);
+ phase = (phase < 0) ? (HIMCI_PHASE_SCALE + phase) : phase;
+ } else
+ phase = (raise_point + fall_point) / 2;
+
+ himci_set_sap_phase(host, phase);
+
+ pr_info("tuning %s: valid phase shift [%d, %d] Final Phase %d\n",
+ mmc_hostname(mmc), raise_point, fall_point, phase);
+ }
+
+ himci_writel(RW_THRESHOLD_SIZE, host->base + MCI_CARDTHRCTL);
+
+ return 0;
+}
+
+static void himci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
+{
+ struct himci_host *host = mmc_priv(mmc);
+ unsigned int tmp_reg;
+ u32 ctrl;
+
+ himci_trace(2, "begin");
+ himci_assert(mmc);
+ himci_assert(ios);
+ himci_assert(host);
+
+ himci_trace(3, "ios->power_mode = %d ", ios->power_mode);
+ switch (ios->power_mode) {
+ case MMC_POWER_OFF:
+ /*
+ * Set controller working voltage as 3.3V before power off.
+ */
+ ctrl = himci_readl(host->base + MCI_UHS_REG);
+ ctrl &= ~HI_SDXC_CTRL_VDD_180;
+ himci_writel(ctrl, host->base + MCI_UHS_REG);
+
+ himci_ctrl_power(host, POWER_OFF);
+ break;
+ case MMC_POWER_UP:
+ case MMC_POWER_ON:
+ himci_ctrl_power(host, POWER_ON);
+ break;
+ }
+ himci_trace(3, "ios->clock = %d ", ios->clock);
+ if (ios->clock) {
+ himci_control_cclk(host, DISABLE);
+ himci_set_cclk(host, ios->clock);
+ himci_control_cclk(host, ENABLE);
+
+ /* speed mode check, if it is DDR50 set DDR mode */
+ if (ios->timing == MMC_TIMING_UHS_DDR50) {
+ ctrl = himci_readl(host->base + MCI_UHS_REG);
+ if (!(HI_SDXC_CTRL_DDR_REG & ctrl)) {
+ ctrl |= HI_SDXC_CTRL_DDR_REG;
+ himci_writel(ctrl, host->base + MCI_UHS_REG);
+ }
+ }
+ } else {
+ himci_control_cclk(host, DISABLE);
+ if (ios->timing != MMC_TIMING_UHS_DDR50) {
+ ctrl = himci_readl(host->base + MCI_UHS_REG);
+ if (HI_SDXC_CTRL_DDR_REG & ctrl) {
+ ctrl &= ~HI_SDXC_CTRL_DDR_REG;
+ himci_writel(ctrl, host->base + MCI_UHS_REG);
+ }
+ }
+ }
+
+ /* set bus_width */
+ himci_trace(3, "ios->bus_width = %d ", ios->bus_width);
+ if (ios->bus_width == MMC_BUS_WIDTH_4) {
+ tmp_reg = himci_readl(host->base + MCI_CTYPE);
+ tmp_reg |= CARD_WIDTH;
+ himci_writel(tmp_reg, host->base + MCI_CTYPE);
+ } else {
+ tmp_reg = himci_readl(host->base + MCI_CTYPE);
+ tmp_reg &= ~CARD_WIDTH;
+ himci_writel(tmp_reg, host->base + MCI_CTYPE);
+ }
+}
+
+static void himci_enable_sdio_irq(struct mmc_host *mmc, int enable)
+{
+ struct himci_host *host = mmc_priv(mmc);
+ unsigned int reg_value;
+
+ reg_value = himci_readl(host->base + MCI_INTMASK);
+ if (enable)
+ reg_value |= SDIO_INT_MASK;
+ else
+ reg_value &= ~SDIO_INT_MASK;
+ himci_writel(reg_value, host->base + MCI_INTMASK);
+}
+
+static int himci_get_card_detect(struct mmc_host *mmc)
+{
+ unsigned ret;
+ struct himci_host *host = mmc_priv(mmc);
+
+ himci_trace(2, "begin");
+ ret = himci_sys_card_detect(host);
+
+ if (ret)
+ return 0;
+ else
+ return 1;
+}
+
+static int himci_get_ro(struct mmc_host *mmc)
+{
+ unsigned ret;
+ struct himci_host *host = mmc_priv(mmc);
+
+ himci_trace(2, "begin");
+ himci_assert(mmc);
+
+ ret = himci_ctrl_card_readonly(host);
+
+ return ret;
+}
+
+static const struct mmc_host_ops himci_ops = {
+ .request = himci_request,
+ .set_ios = himci_set_ios,
+ .get_ro = himci_get_ro,
+ .start_signal_voltage_switch = himci_start_signal_voltage_switch,
+ .execute_tuning = himci_execute_tuning,
+ .enable_sdio_irq = himci_enable_sdio_irq,
+ .get_cd = himci_get_card_detect,
+};
+
+static irqreturn_t hisd_irq(int irq, void *dev_id)
+{
+ struct himci_host *host = dev_id;
+ u32 state = 0;
+ int handle = 0;
+ u32 mstate = 0;
+
+ spin_lock(&host->lock);
+ state = himci_readl(host->base + MCI_RINTSTS);
+ spin_unlock(&host->lock);
+
+ /* bugfix: when send soft stop to SD Card, Host will report
+ sdio interrupt, This situation needs to be avoided */
+ if (host->mmc->caps & MMC_CAP_SDIO_IRQ) {
+ if ((host->mmc->card != NULL)
+ && (host->mmc->card->type == MMC_TYPE_SDIO)) {
+ mstate = himci_readl(host->base + MCI_INTMASK);
+ if ((state & SDIO_INT_STATUS) &&
+ (mstate & SDIO_INT_MASK)) {
+ spin_lock(&host->lock);
+ himci_writel(SDIO_INT_STATUS,
+ host->base + MCI_RINTSTS);
+ spin_unlock(&host->lock);
+ handle = 1;
+ mmc_signal_sdio_irq(host->mmc);
+ }
+ }
+ }
+
+ if (state & DATA_INT_MASK) {
+ handle = 1;
+ host->pending_events |= HIMCI_PEND_DTO_M;
+
+ spin_lock(&host->lock);
+ host->irq_status = himci_readl(host->base + MCI_RINTSTS);
+ himci_writel(DATA_INT_MASK , host->base + MCI_RINTSTS);
+ spin_unlock(&host->lock);
+
+ wake_up(&host->intr_wait);
+ }
+
+ if (handle)
+ return IRQ_HANDLED;
+
+ return IRQ_NONE;
+}
+
+static int himci_of_parse(struct device_node *np, struct mmc_host *mmc)
+{
+ struct himci_host *host = mmc_priv(mmc);
+ int ret = mmc_of_parse(mmc);
+ int len;
+
+ if (ret)
+ return ret;
+
+ if (of_property_read_u32(np, "min-frequency", &mmc->caps))
+ mmc->f_min = MMC_CCLK_MIN;
+
+ of_property_read_u32(np, "devid", &host->devid);
+
+ if (of_find_property(np, "cap-mmc-hw-reset", &len))
+ mmc->caps |= MMC_CAP_HW_RESET;
+
+ return 0;
+}
+
+static int __init himci_probe(struct platform_device *pdev)
+{
+ struct mmc_host *mmc;
+ struct himci_host *host = NULL;
+ struct resource *host_ioaddr_res = NULL;
+ int ret = 0, irq;
+ struct device_node *np = pdev->dev.of_node;
+
+ himci_trace(2, "begin");
+ pr_info("mmc host probe\n");
+ himci_assert(pdev);
+
+ mmc = mmc_alloc_host(sizeof(struct himci_host), &pdev->dev);
+ if (!mmc) {
+ himci_error("no mem for hi mci host controller!\n");
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ platform_set_drvdata(pdev, mmc);
+
+ mmc->ops = &himci_ops;
+
+ host_ioaddr_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (NULL == host_ioaddr_res) {
+ himci_error("no ioaddr rescources config!\n");
+ ret = -ENODEV;
+ goto out;
+ }
+
+ if (himci_of_parse(np, mmc)) {
+ himci_error("failed to parse mmc dts!\n");
+ ret = -EINVAL;
+ goto out;
+ }
+
+ /* reload by this controller */
+ mmc->max_blk_count = 2048;
+ mmc->max_segs = 1024;
+ mmc->max_seg_size = mmc->max_blk_size * mmc->max_blk_count;
+ mmc->max_req_size = mmc->max_blk_size * mmc->max_blk_count;
+ mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
+
+ host = mmc_priv(mmc);
+ mci_host[slot_index++] = host;
+ pdev->id = host->devid;
+ host->pdev = pdev;
+ host->mmc = mmc;
+ host->dma_vaddr = dma_alloc_coherent(&pdev->dev, CMD_DES_PAGE_SIZE,
+ &host->dma_paddr, GFP_KERNEL);
+ if (!host->dma_vaddr) {
+ himci_error("no mem for himci dma!\n");
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ host->base = devm_ioremap_resource(&pdev->dev, host_ioaddr_res);
+ if (IS_ERR_OR_NULL(host->base)) {
+ himci_error("no mem for himci base!\n");
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ spin_lock_init(&host->lock);
+
+ host->crg_rst = devm_reset_control_get(&pdev->dev, "mmc_reset");
+ if (IS_ERR_OR_NULL(host->crg_rst)) {
+ himci_error("get rst fail.\n");
+ ret = PTR_ERR(host->crg_rst);
+ goto out;
+ }
+
+ reset_control_assert(host->crg_rst);
+ usleep_range(50, 60);
+ reset_control_deassert(host->crg_rst);
+
+ host->clk = devm_clk_get(&pdev->dev, "mmc_clk");
+ if (IS_ERR_OR_NULL(host->clk)) {
+ himci_error("get clock fail.\n");
+ ret = PTR_ERR(host->clk);
+ goto out;
+ }
+
+ clk_prepare_enable(host->clk);
+
+ host->power_status = POWER_OFF;
+
+ /* enable card */
+ himci_init_host(host);
+ host->card_status = himci_sys_card_detect(host);
+
+ init_timer(&host->timer);
+ host->timer.function = himci_detect_card;
+ host->timer.data = (unsigned long)host;
+ host->timer.expires = jiffies + detect_time;
+ add_timer(&host->timer);
+
+ init_waitqueue_head(&host->intr_wait);
+ irq = platform_get_irq(pdev, 0);
+ if (irq < 0) {
+ pr_err("no IRQ defined!\n");
+ goto out;
+ }
+
+ host->irq = irq;
+ ret = request_irq(irq, hisd_irq, 0, DRIVER_NAME, host);
+ if (ret) {
+ pr_err("request_irq error!\n");
+ goto out;
+ }
+
+ mmc_add_host(mmc);
+ return 0;
+out:
+ if (host) {
+ del_timer(&host->timer);
+
+ if (host->base)
+ devm_iounmap(&pdev->dev, host->base);
+
+ if (host->dma_vaddr)
+ dma_free_coherent(&pdev->dev, CMD_DES_PAGE_SIZE,
+ host->dma_vaddr, host->dma_paddr);
+ }
+ if (mmc)
+ mmc_free_host(mmc);
+
+ return ret;
+}
+
+static int __exit himci_remove(struct platform_device *pdev)
+{
+ struct mmc_host *mmc = platform_get_drvdata(pdev);
+
+ himci_trace(2, "begin");
+ himci_assert(pdev);
+
+ platform_set_drvdata(pdev, NULL);
+
+ if (mmc) {
+ struct himci_host *host = mmc_priv(mmc);
+
+ mmc_remove_host(mmc);
+ free_irq(host->irq, host);
+ del_timer_sync(&host->timer);
+ himci_ctrl_power(host, POWER_OFF);
+ himci_control_cclk(host, DISABLE);
+ devm_iounmap(&pdev->dev, host->base);
+ dma_free_coherent(&pdev->dev, CMD_DES_PAGE_SIZE, host->dma_vaddr,
+ host->dma_paddr);
+ mmc_free_host(mmc);
+ }
+ return 0;
+}
+
+static void himci_shutdown(struct platform_device *pdev)
+{
+ struct mmc_host *mmc = platform_get_drvdata(pdev);
+
+ himci_trace(3, "shutdown");
+ if (mmc) {
+ unsigned int val;
+ struct himci_host *host = mmc_priv(mmc);
+
+ /* bugfix: host reset can trigger error intr */
+ himci_writel(0, host->base + MCI_IDINTEN);
+ himci_writel(0, host->base + MCI_INTMASK);
+
+ val = himci_readl(host->base + MCI_CTRL);
+ val |= CTRL_RESET | FIFO_RESET | DMA_RESET;
+ himci_writel(val, host->base + MCI_CTRL);
+ }
+}
+
+#ifdef CONFIG_PM
+static int himci_pltm_suspend(struct platform_device *pdev,
+ pm_message_t state)
+{
+ struct mmc_host *mmc = platform_get_drvdata(pdev);
+ struct himci_host *host;
+ int ret = 0;
+
+ if (mmc) {
+ host = mmc_priv(mmc);
+ del_timer_sync(&host->timer);
+
+ if (__clk_is_enabled(host->clk))
+ clk_disable_unprepare(host->clk);
+ }
+
+ return ret;
+}
+
+static int himci_pltm_resume(struct platform_device *pdev)
+{
+ struct mmc_host *mmc = platform_get_drvdata(pdev);
+ struct himci_host *host;
+ int ret = 0;
+
+ if (mmc) {
+ host = mmc_priv(mmc);
+
+ if (!__clk_is_enabled(host->clk))
+ clk_prepare_enable(host->clk);
+
+ himci_init_host(host);
+
+ add_timer(&host->timer);
+ }
+
+ return ret;
+}
+#else
+#define himci_pltm_suspend NULL
+#define himci_pltm_resume NULL
+#endif
+
+void himci_mmc_rescan(int slot)
+{
+ struct mmc_host *mmc;
+ struct himci_host *host;
+
+ host = mci_host[slot];
+ if (!host || !host->mmc) {
+ himci_trace(5, "mmc%d: invalid slot!\n", slot);
+ return;
+ }
+
+ mmc = host->mmc;
+ del_timer_sync(&host->timer);
+
+ mmc_remove_host(mmc);
+
+ mmc_add_host(mmc);
+
+ add_timer(&host->timer);
+}
+EXPORT_SYMBOL(himci_mmc_rescan);
+
+static const struct of_device_id
+himci_match[] __maybe_unused = {
+ {.compatible = "hisilicon,hi3516a-himci"},
+ {},
+};
+
+static struct platform_driver himci_driver = {
+ .probe = himci_probe,
+ .remove = himci_remove,
+ .shutdown = himci_shutdown,
+ .suspend = himci_pltm_suspend,
+ .resume = himci_pltm_resume,
+ .driver = {
+ .name = DRIVER_NAME,
+ .owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(himci_match),
+ },
+};
+
+static int __init himci_init(void)
+{
+ int ret;
+
+ himci_trace(2, "begin");
+
+ /*
+ * We should register SDIO1 first to make sure that
+ * the eMMC device,which connected to SDIO1 is mmcblk0.
+ */
+
+ ret = platform_driver_register(&himci_driver);
+ if (ret) {
+ platform_driver_unregister(&himci_driver);
+ himci_error("Himci driver register failed!");
+ return ret;
+ }
+
+ /* device proc entry */
+ ret = mci_proc_init(HIMCI_SLOT_NUM);
+ if (ret)
+ himci_error("device proc init is failed!");
+
+ return ret;
+}
+
+static void __exit himci_exit(void)
+{
+ himci_trace(2, "begin");
+
+ mci_proc_shutdown();
+
+ platform_driver_unregister(&himci_driver);
+}
+
+module_init(himci_init);
+module_exit(himci_exit);
+
+#ifdef MODULE
+MODULE_AUTHOR("Hisilicon Drive Group");
+MODULE_DESCRIPTION("MMC/SD driver for the Hisilicon MMC/SD Host Controller");
+MODULE_LICENSE("GPL");
+#endif
diff --git a/drivers/mmc/host/himci/himci.h b/drivers/mmc/host/himci/himci.h
new file mode 100644
index 0000000..5c00ada
--- /dev/null
+++ b/drivers/mmc/host/himci/himci.h
@@ -0,0 +1,138 @@
+#ifndef _HI_MCI_H_
+#define _HI_MCI_H_
+
+#include
+
+extern int trace_level;
+#define HIMCI_TRACE_LEVEL 5
+/*
+ 0 - all message
+ 1 - dump all register read/write
+ 2 - flow trace
+ 3 - timeout err and protocol err
+ */
+
+#define HIMCI_TRACE_FMT KERN_INFO
+
+#define NOT_FOUND -1
+#define POWER_ON 1
+#define POWER_OFF 0
+
+#define CARD_UNPLUGED 1
+#define CARD_PLUGED 0
+
+#define ENABLE 1
+#define DISABLE 0
+
+#define HI_MCI_DETECT_TIMEOUT (HZ/2)
+
+#define HI_MCI_REQUEST_TIMEOUT (5 * HZ)
+
+#define MAX_RETRY_COUNT 100
+
+#define MMC_CCLK_MIN 100000
+
+/* Base address of SD card register */
+#define HI_MCI_INTR (48+32)
+
+#define himci_trace(level, msg...) do { \
+ if ((level) >= trace_level) { \
+ printk(HIMCI_TRACE_FMT "%s:%d: ", __func__, __LINE__); \
+ printk(msg); \
+ printk("\n"); \
+ } \
+} while (0)
+
+#define himci_assert(cond) do { \
+ if (!(cond)) {\
+ printk(KERN_ERR "Assert:himci:%s:%d\n", \
+ __func__, \
+ __LINE__); \
+ BUG(); \
+ } \
+} while (0)
+
+#define himci_error(s...) do { \
+ printk(KERN_ERR "himci:%s:%d: ", __func__, __LINE__); \
+ printk(s); \
+ printk("\n"); \
+} while (0)
+
+#define himci_readl(addr) ({unsigned int reg = readl(IOMEM(addr)); \
+ himci_trace(1, "readl(0x%04X) = 0x%08X", (unsigned int)addr, reg); \
+ reg; })
+
+#define himci_writel(v, addr) do { writel(v, IOMEM(addr)); \
+ himci_trace(1, "writel(0x%04X) = 0x%08X", (unsigned int)addr, \
+ (unsigned int)(v)); \
+} while (0)
+
+struct himci_des {
+ unsigned long idmac_des_ctrl;
+ unsigned long idmac_des_buf_size;
+ unsigned long idmac_des_buf_addr;
+ unsigned long idmac_des_next_addr;
+};
+
+struct himci_host {
+ struct mmc_host *mmc;
+ struct platform_device *pdev;
+ spinlock_t lock;
+ struct mmc_request *mrq;
+ struct mmc_command *cmd;
+ struct mmc_data *data;
+ void __iomem *base;
+ struct scatterlist *dma_sg;
+ unsigned int dma_sg_num;
+ unsigned int dma_dir;
+ dma_addr_t dma_paddr;
+ unsigned int *dma_vaddr;
+ struct timer_list timer;
+ unsigned int irq;
+ unsigned int irq_status;
+ unsigned int is_tuning;
+ wait_queue_head_t intr_wait;
+#define HIMCI_PEND_DTO_B (0)
+#define HIMCI_PEND_DTO_M (1 << HIMCI_PEND_DTO_B)
+ unsigned long pending_events;
+ unsigned int power_status;
+ unsigned int card_status;
+ unsigned int devid;
+ unsigned int hclk;
+ unsigned int cclk;
+ struct clk *clk;
+ struct reset_control *crg_rst;
+};
+
+union cmd_arg_u {
+ unsigned int cmd_arg;
+ struct cmd_bits_arg {
+ unsigned int cmd_index:6;
+ unsigned int response_expect:1;
+ unsigned int response_length:1;
+ unsigned int check_response_crc:1;
+ unsigned int data_transfer_expected:1;
+ unsigned int read_write:1;
+ unsigned int transfer_mode:1;
+ unsigned int send_auto_stop:1;
+ unsigned int wait_prvdata_complete:1;
+ unsigned int stop_abort_cmd:1;
+ unsigned int send_initialization:1;
+ unsigned int card_number:5;
+ unsigned int update_clk_reg_only:1; /* bit 21 */
+ unsigned int read_ceata_device:1;
+ unsigned int ccs_expected:1;
+ unsigned int enable_boot:1;
+ unsigned int expect_boot_ack:1;
+ unsigned int disable_boot:1;
+ unsigned int boot_mode:1;
+ unsigned int volt_switch:1;
+ unsigned int use_hold_reg:1;
+ unsigned int reserved:1;
+ unsigned int start_cmd:1; /* HSB */
+ } bits;
+};
+
+struct mmc_host *get_mmchost(int hostid);
+#endif
+
diff --git a/drivers/mmc/host/himci/himci_hi3516a.c b/drivers/mmc/host/himci/himci_hi3516a.c
new file mode 100644
index 0000000..33e9003
--- /dev/null
+++ b/drivers/mmc/host/himci/himci_hi3516a.c
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#define TUNING_START_PHASE 0
+#define TUNING_END_PHASE 7
+#define HIMCI_PHASE_SCALE 8
+#define DRV_PHASE_DFLT (0x2<<23)
+#define SMPL_PHASE_DFLT (0x3<<16)
+
+#define REG_PAD_CTRL 0x200f0800
+
+#define REG_CTRL_SDIO0_CLK 0xcc
+#define REG_CTRL_SDIO0_CMD 0xdc
+#define REG_CTRL_SDIO0_DATA0 0xe0
+#define REG_CTRL_SDIO0_DATA1 0xe4
+#define REG_CTRL_SDIO0_DATA2 0xe8
+#define REG_CTRL_SDIO0_DATA3 0xec
+
+#define REG_CTRL_SDIO1_CLK 0x104
+#define REG_CTRL_SDIO1_CMD 0x114
+#define REG_CTRL_SDIO1_DATA0 0x118
+#define REG_CTRL_SDIO1_DATA1 0x11c
+#define REG_CTRL_SDIO1_DATA2 0x120
+#define REG_CTRL_SDIO1_DATA3 0x124
+
+#define SDIO_CLK_DS_3V3 0x60
+#define SDIO_CMD_DS_3V3 0xe0
+#define SDIO_DATA0_DS_3V3 0xe0
+#define SDIO_DATA1_DS_3V3 0xe0
+#define SDIO_DATA2_DS_3V3 0xe0
+#define SDIO_DATA3_DS_3V3 0xe0
+
+#define SDIO_CLK_DS_1V8 0x40
+#define SDIO_CMD_DS_1V8 0xd0
+#define SDIO_DATA0_DS_1V8 0xd0
+#define SDIO_DATA1_DS_1V8 0xd0
+#define SDIO_DATA2_DS_1V8 0xd0
+#define SDIO_DATA3_DS_1V8 0xd0
+
+struct sdio_drv_cap {
+ unsigned int reg_addr;
+ unsigned int ds_3v3;
+ unsigned int ds_1v8;
+};
+
+#define SDIO_DRV_CAP(ofst, v1, v2) { \
+ .reg_addr = ofst, \
+ .ds_3v3 = v1, \
+ .ds_1v8 = v2}
+static struct sdio_drv_cap sdio_ds[] = {
+ SDIO_DRV_CAP(REG_CTRL_SDIO0_CLK, SDIO_CLK_DS_3V3, SDIO_CLK_DS_1V8),
+ SDIO_DRV_CAP(REG_CTRL_SDIO0_CMD, SDIO_CMD_DS_3V3, SDIO_CMD_DS_1V8),
+ SDIO_DRV_CAP(REG_CTRL_SDIO0_DATA0, SDIO_DATA0_DS_3V3, SDIO_DATA0_DS_1V8),
+ SDIO_DRV_CAP(REG_CTRL_SDIO0_DATA1, SDIO_DATA1_DS_3V3, SDIO_DATA1_DS_1V8),
+ SDIO_DRV_CAP(REG_CTRL_SDIO0_DATA2, SDIO_DATA2_DS_3V3, SDIO_DATA2_DS_1V8),
+ SDIO_DRV_CAP(REG_CTRL_SDIO0_DATA3, SDIO_DATA3_DS_3V3, SDIO_DATA3_DS_1V8),
+ SDIO_DRV_CAP(REG_CTRL_SDIO1_CLK, SDIO_CLK_DS_3V3, SDIO_CLK_DS_1V8),
+ SDIO_DRV_CAP(REG_CTRL_SDIO1_CMD, SDIO_CMD_DS_3V3, SDIO_CMD_DS_1V8),
+ SDIO_DRV_CAP(REG_CTRL_SDIO1_DATA0, SDIO_DATA0_DS_3V3, SDIO_DATA0_DS_1V8),
+ SDIO_DRV_CAP(REG_CTRL_SDIO1_DATA1, SDIO_DATA1_DS_3V3, SDIO_DATA1_DS_1V8),
+ SDIO_DRV_CAP(REG_CTRL_SDIO1_DATA2, SDIO_DATA2_DS_3V3, SDIO_DATA2_DS_1V8),
+ SDIO_DRV_CAP(REG_CTRL_SDIO1_DATA3, SDIO_DATA3_DS_3V3, SDIO_DATA3_DS_1V8),
+};
+
+static void himci_set_drv_cap(struct himci_host *host, unsigned int vdd_180)
+{
+ unsigned int i, offset;
+
+ offset = host->devid * 6;
+ for (i = 0; i < 6; i++) {
+ if (vdd_180)
+ himci_writel(sdio_ds[i + offset].ds_1v8,
+ IO_ADDRESS(REG_PAD_CTRL + sdio_ds[i + offset].reg_addr));
+ else
+ himci_writel(sdio_ds[i + offset].ds_3v3,
+ IO_ADDRESS(REG_PAD_CTRL + sdio_ds[i + offset].reg_addr));
+ }
+}
diff --git a/drivers/mmc/host/himci/himci_proc.c b/drivers/mmc/host/himci/himci_proc.c
new file mode 100644
index 0000000..c60dd5b
--- /dev/null
+++ b/drivers/mmc/host/himci/himci_proc.c
@@ -0,0 +1,221 @@
+/*****************************************************************************
+ * This is the driver for the host mci SOC.
+ *
+ * Copyright (C) Hisilicon. All rights reserved.
+ *
+ ******************************************************************************/
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+#include
+#include
+#include "himci.h"
+#include "himci_reg.h"
+#include "himci_proc.h"
+
+#define MCI_PARENT "mci"
+#define MCI_STATS_PROC "mci_info"
+#define MAX_CLOCK_SCALE (4)
+
+static struct proc_dir_entry *proc_mci_dir;
+static unsigned int mci_max_connections;
+static char *card_type[MAX_CARD_TYPE + 1] = {
+ "MMC card",
+ "SD card",
+ "SDIO card",
+ "SD combo (IO+mem) card",
+ "unknown"
+};
+static char *clock_unit[MAX_CLOCK_SCALE] = {
+ "Hz",
+ "KHz",
+ "MHz",
+ "GHz"
+};
+
+static char *mci_get_card_type(unsigned int sd_type)
+{
+ if (MAX_CARD_TYPE <= sd_type)
+ return card_type[MAX_CARD_TYPE];
+ else
+ return card_type[sd_type];
+}
+
+static unsigned int analyze_clock_scale(unsigned int clock,
+ unsigned int *clock_val)
+{
+ unsigned int scale = 0;
+ unsigned int tmp = clock;
+
+ while (1) {
+ tmp = tmp / 1000;
+ if (0 < tmp) {
+ *clock_val = tmp;
+ scale++;
+ } else {
+ break;
+ }
+ }
+ return scale;
+}
+
+static void mci_stats_seq_printout(struct seq_file *s)
+{
+ unsigned int index_mci;
+ unsigned int clock;
+ unsigned int clock_scale;
+ unsigned int clock_value = 0;
+ const char *type;
+ struct mmc_host *mmc;
+ struct himci_host *host;
+ struct mmc_card *card;
+
+ for (index_mci = 0; index_mci < HIMCI_SLOT_NUM; index_mci++) {
+ host = mci_host[index_mci];
+ if (!host || !host->mmc) {
+ seq_printf(s, "MCI%d invalid\n", index_mci);
+ continue;
+ } else {
+ seq_printf(s, "MCI%d", index_mci);
+ }
+
+ mmc = host->mmc;
+ card = mmc->card;
+ if (NULL == card) {
+ seq_puts(s, " disconnected\n");
+ } else {
+ seq_puts(s, " connected\n");
+
+ seq_printf(s,
+ "\tType: %s",
+ mci_get_card_type(card->type)
+ );
+
+ if (mmc_card_blockaddr(card)) {
+ if (mmc_card_ext_capacity(card))
+ type = "SDXC";
+ else
+ type = "SDHC";
+ seq_printf(s, "(%s)\n", type);
+ }
+
+ clock = host->hclk;
+ clock_scale = analyze_clock_scale(clock, &clock_value);
+ seq_printf(s, "\tHost work clock %d%s\n",
+ clock_value, clock_unit[clock_scale]);
+
+ clock = mmc->ios.clock;
+ clock_scale = analyze_clock_scale(clock, &clock_value);
+ seq_printf(s, "\tCard support clock %d%s\n",
+ clock_value, clock_unit[clock_scale]);
+
+ clock = host->cclk;
+ clock_scale = analyze_clock_scale(clock, &clock_value);
+ seq_printf(s, "\tCard work clock %d%s\n",
+ clock_value, clock_unit[clock_scale]);
+ }
+ }
+}
+
+/* proc interface setup */
+static void *mci_seq_start(struct seq_file *s, loff_t *pos)
+{
+ /* counter is used to tracking multi proc interfaces
+ * We have only one interface so return zero
+ * pointer to start the sequence.
+ */
+ static unsigned long counter;
+
+ if (*pos == 0)
+ return &counter;
+
+ *pos = 0;
+ return NULL;
+}
+
+/* proc interface next */
+static void *mci_seq_next(struct seq_file *s, void *v, loff_t *pos)
+{
+ (*pos)++;
+ if (*pos >= HIMCI_SLOT_NUM)
+ return NULL;
+
+ return NULL;
+}
+
+/* define parameters where showed in proc file */
+static int mci_stats_seq_show(struct seq_file *s, void *v)
+{
+ mci_stats_seq_printout(s);
+ return 0;
+}
+
+/* proc interface stop */
+static void mci_seq_stop(struct seq_file *s, void *v)
+{
+}
+
+/* proc interface operation */
+static const struct seq_operations mci_stats_seq_ops = {
+ .start = mci_seq_start,
+ .next = mci_seq_next,
+ .stop = mci_seq_stop,
+ .show = mci_stats_seq_show
+};
+
+/* proc file open*/
+static int mci_stats_proc_open(struct inode *inode, struct file *file)
+{
+ return seq_open(file, &mci_stats_seq_ops);
+};
+
+/* proc file operation */
+static const struct file_operations mci_stats_proc_ops = {
+ .owner = THIS_MODULE,
+ .open = mci_stats_proc_open,
+ .read = seq_read,
+ .release = seq_release
+};
+
+int mci_proc_init(unsigned int max_connections)
+{
+ struct proc_dir_entry *proc_stats_entry;
+
+ mci_max_connections = max_connections;
+
+ proc_mci_dir = proc_mkdir(MCI_PARENT, NULL);
+ if (!proc_mci_dir) {
+ pr_err("%s: failed to create proc file %s\n",
+ __func__, MCI_PARENT);
+ return 1;
+ }
+
+ proc_stats_entry = proc_create(MCI_STATS_PROC,
+ 0, proc_mci_dir, &mci_stats_proc_ops);
+ if (!proc_stats_entry) {
+ pr_err("%s: failed to create proc file %s\n",
+ __func__, MCI_STATS_PROC);
+ return 1;
+ }
+
+ return 0;
+}
+
+int mci_proc_shutdown(void)
+{
+ if (proc_mci_dir) {
+ if (mci_max_connections > 0)
+ remove_proc_entry(MCI_STATS_PROC, proc_mci_dir);
+
+ remove_proc_entry(MCI_PARENT, NULL);
+ proc_mci_dir = NULL;
+ }
+
+ return 0;
+}
diff --git a/drivers/mmc/host/himci/himci_proc.h b/drivers/mmc/host/himci/himci_proc.h
new file mode 100644
index 0000000..23b4a22
--- /dev/null
+++ b/drivers/mmc/host/himci/himci_proc.h
@@ -0,0 +1,18 @@
+/*
+ * MCI connection table manager
+ */
+#ifndef __MCI_PROC_H__
+#define __MCI_PROC_H__
+
+#include
+
+#define MAX_CARD_TYPE 4
+#define MAX_SPEED_MODE 5
+
+#define HIMCI_SLOT_NUM 2
+
+extern struct himci_host *mci_host[HIMCI_SLOT_NUM];
+int mci_proc_init(unsigned int max_connections);
+int mci_proc_shutdown(void);
+
+#endif /* __MCI_PROC_H__ */
diff --git a/drivers/mmc/host/himci/himci_reg.h b/drivers/mmc/host/himci/himci_reg.h
new file mode 100644
index 0000000..3f156f48
--- /dev/null
+++ b/drivers/mmc/host/himci/himci_reg.h
@@ -0,0 +1,188 @@
+#ifndef _HI_MCI_REG_H_
+#define _HI_MCI_REG_H_
+
+#define HI_MCI_IO_SIZE 0x1000
+
+#define MCI_CTRL 0x00
+#define MCI_PWREN 0x04
+#define MCI_CLKDIV 0x08
+#define MCI_CLKSRC 0x0C
+#define MCI_CLKENA 0x10
+#define MCI_TIMEOUT 0x14
+#define MCI_CTYPE 0x18
+#define MCI_BLKSIZ 0x1c
+#define MCI_BYTCNT 0x20
+#define MCI_INTMASK 0x24
+#define MCI_CMDARG 0x28
+#define MCI_CMD 0x2C
+#define MCI_RESP0 0x30
+#define MCI_RESP1 0x34
+#define MCI_RESP2 0x38
+#define MCI_RESP3 0x3C
+#define MCI_MINTSTS 0x40
+#define MCI_RINTSTS 0x44
+#define MCI_STATUS 0x48
+#define MCI_FIFOTH 0x4C
+#define MCI_CDETECT 0x50
+#define MCI_WRTPRT 0x54
+#define MCI_GPIO 0x58
+#define MCI_TCBCNT 0x5C
+#define MCI_TBBCNT 0x60
+#define MCI_DEBNCE 0x64
+#define MCI_USRID 0x68
+#define MCI_VERID 0x6C
+#define MCI_HCON 0x70
+#define MCI_UHS_REG 0x74
+#define MCI_BMOD 0x80
+#define MCI_DBADDR 0x88
+#define MCI_IDSTS 0x8C
+#define MCI_IDINTEN 0x90
+#define MCI_DSCADDR 0x94
+#define MCI_BUFADDR 0x98
+#define MCI_CARDTHRCTL 0x100
+#define MCI_UHS_REG_EXT 0x108
+/* MCI_UHS_REG(0x74) details */
+#define HI_SDXC_CTRL_VDD_180 (0x1<<0)
+#define HI_SDXC_CTRL_DDR_REG (0x1<<16)
+
+/* MCI_BMOD(0x80) details */
+#define BMOD_SWR (0x1<<0)
+#define BURST_INCR (0x1<<1)
+#define BMOD_DMA_EN (0x1<<7)
+#define BURST_8 (0x2<<8)
+#define BURST_16 (0x3<<8)
+
+/* MCI_CTRL(0x00) details */
+#define CTRL_RESET (1<<0)
+#define FIFO_RESET (1<<1)
+#define DMA_RESET (1<<2)
+#define INTR_EN (1<<4)
+#define USE_INTERNAL_DMA (1<<25)
+
+/* IDMAC DEST1 details */
+#define DMA_BUFFER (0x2000)
+#define MAX_DMA_DES (20480)
+
+/* IDMAC DEST0 details */
+#define DMA_DES_OWN (1<<31)
+#define DMA_DES_NEXT_DES (1<<4)
+#define DMA_DES_FIRST_DES (1<<3)
+#define DMA_DES_LAST_DES (1<<2)
+
+/* MCI_CDETECT(0x50) details */
+#define HIMCI_CARD0 (0x1<<0)
+
+/* MCI_TIMEOUT(0x14) details: */
+/*bit 31-8: data read timeout param*/
+#define DATA_TIMEOUT (0xffffff<<8)
+
+/* bit 7-0: response timeout param */
+#define RESPONSE_TIMEOUT 0xff
+
+/* MCI_CLKENA(0x10) details */
+#define CCLK_ENABLE (0x1<<0) /* bit 0: enable of card clk*/
+
+
+
+/* MCI_CTYPE(0x18) details */
+#define CARD_WIDTH (0x1<<0)
+
+/* MCI_CARDTHRCTL(0x100) details */
+#define RW_THRESHOLD_SIZE (0x2000001)
+
+/* MCI_INTMASK(0x24) details:
+ bit 16-1: mask MMC host controller each interrupt
+*/
+#define ALL_INT_MASK 0x1ffff
+#define DTO_INT_MASK (0x1<<3)
+#define SDIO_INT_MASK (0x1<<16)
+
+/* MCI_UHS_REG_EXT(0x108) details */
+/* bit[19:16] sampling phase */
+#define CLK_SMPL_PHS_SHIFT (16)
+#define CLK_SMPL_PHS_MASK (0x7<<16)
+
+/* bit[26:23] drv phase */
+#define CLK_DRV_PHS_SHIFT (23)
+#define CLK_DRV_PHS_MASK (0x7<<23)
+#define DEFAULT_PHASE 0x1050000
+
+/* MCI_CMD(0x2c) details:
+ bit 31: cmd execute or load start param of interface clk bit
+*/
+#define START_CMD (0x1<<31)
+
+/* MCI_INTSTS(0x44) details */
+/***************************************************************/
+/* bit 16: sdio interrupt status */
+#define SDIO_INT_STATUS (0x1<<16)
+
+/* bit 15: end-bit error (read)/write no CRC interrupt status */
+#define EBE_INT_STATUS (0x1<<15)
+
+/* bit 14: auto command done interrupt status */
+#define ACD_INT_STATUS (0x1<<14)
+
+/* bit 13: start bit error interrupt status */
+#define SBE_INT_STATUS (0x1<<13)
+
+/* bit 12: hardware locked write error interrupt status */
+#define HLE_INT_STATUS (0x1<<12)
+
+/* bit 11: FIFO underrun/overrun error interrupt status */
+#define FRUN_INT_STATUS (0x1<<11)
+
+/* bit 10: data starvation-by-host timeout interrupt status */
+#define HTO_INT_STATUS (0x1<<10)
+
+/* bit 10: volt_switch to 1.8v for sdxc */
+#define VOLT_SWITCH_INT_STATUS (0x1<<10)
+
+/* bit 9: data read timeout interrupt status */
+#define DRTO_INT_STATUS (0x1<<9)
+
+/* bit 8: response timeout interrupt status */
+#define RTO_INT_STATUS (0x1<<8)
+
+/* bit 7: data CRC error interrupt status */
+#define DCRC_INT_STATUS (0x1<<7)
+
+/* bit 6: response CRC error interrupt status */
+#define RCRC_INT_STATUS (0x1<<6)
+
+/* bit 5: receive FIFO data request interrupt status */
+#define RXDR_INT_STATUS (0x1<<5)
+
+/* bit 4: transmit FIFO data request interrupt status */
+#define TXDR_INT_STATUS (0x1<<4)
+
+/* bit 3: data transfer Over interrupt status */
+#define DTO_INT_STATUS (0x1<<3)
+
+/* bit 2: command done interrupt status */
+#define CD_INT_STATUS (0x1<<2)
+
+/* bit 1: response error interrupt status */
+#define RE_INT_STATUS (0x1<<1)
+
+#define CMD_INT_MASK (RTO_INT_STATUS | RCRC_INT_STATUS | RE_INT_STATUS)
+#define DATA_INT_MASK (DTO_INT_STATUS | DCRC_INT_STATUS \
+ | SBE_INT_STATUS | EBE_INT_STATUS)
+/***************************************************************/
+
+/* MCI_RINTSTS(0x44) details:bit 16-1: clear
+ MMC host controller each interrupt but
+ hardware locked write error interrupt
+*/
+#define ALL_INT_CLR 0x1efff
+#define ALL_SD_INT_CLR 0xefff
+
+/* MCI_STATUS(0x48) details */
+#define DATA_BUSY (0x1<<9)
+
+/* MCI_FIFOTH(0x4c) details */
+#define BURST_SIZE (0x6<<28)
+#define RX_WMARK (0x7f<<16)
+#define TX_WMARK (0x80)
+
+#endif
diff --git a/drivers/mtd/Makefile b/drivers/mtd/Makefile
index 99bb9a1..f46b1cc 100644
--- a/drivers/mtd/Makefile
+++ b/drivers/mtd/Makefile
@@ -30,7 +30,7 @@ obj-$(CONFIG_MTD_SWAP) += mtdswap.o
nftl-objs := nftlcore.o nftlmount.o
inftl-objs := inftlcore.o inftlmount.o
+obj-$(CONFIG_MTD_SPI_NOR) += spi-nor/
obj-y += chips/ lpddr/ maps/ devices/ nand/ onenand/ tests/
-obj-$(CONFIG_MTD_SPI_NOR) += spi-nor/
obj-$(CONFIG_MTD_UBI) += ubi/
diff --git a/drivers/mtd/devices/Makefile b/drivers/mtd/devices/Makefile
index 7912d3a..9e7da47 100644
--- a/drivers/mtd/devices/Makefile
+++ b/drivers/mtd/devices/Makefile
@@ -18,5 +18,4 @@ obj-$(CONFIG_MTD_BCM47XXSFLASH) += bcm47xxsflash.o
obj-$(CONFIG_MTD_ST_SPI_FSM) += st_spi_fsm.o
obj-$(CONFIG_MTD_POWERNV_FLASH) += powernv_flash.o
-
CFLAGS_docg3.o += -I$(src)
diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
index b254090..5f4768c 100644
--- a/drivers/mtd/nand/Kconfig
+++ b/drivers/mtd/nand/Kconfig
@@ -569,4 +569,31 @@ config MTD_NAND_MTK
Enables support for NAND controller on MTK SoCs.
This controller is found on mt27xx, mt81xx, mt65xx SoCs.
+config MTD_SPI_NAND_HISI_BVT
+ tristate "Support for SPI NAND controller on Hisilicon SoCs"
+ depends on MTD_NAND
+ help
+ Enables support for the SPI NAND device drivers.
+
+config HISI_NAND_ECC_STATUS_REPORT
+ tristate "Report the ecc status to MTD for HiSilicon Nand Driver"
+ depends on MFD_HISI_FMC
+ default n
+ help
+ Flash Memory Controller V100 reports the ecc status include ECC error
+ and ECC corrected to MTD to monitor the aging of devices.
+
+config HISI_NAND_FS_MAY_NO_YAFFS2
+ bool "Remove the restraintion of 16bit ecc type on yaffs2 to HiSilicon"
+ depends on MFD_HISI_FMC
+ default n
+ help
+ The ecc type: 16bit is limited by the HiSilicon flash memory controller,
+ as the yaffs2 tag of hisi rootfs limits the min size of CTRL len is 28.
+
+source "drivers/mtd/nand/hifmc100/Kconfig"
+source "drivers/mtd/nand/hisnfc100/Kconfig"
+source "drivers/mtd/nand/hinfc610/Kconfig"
+source "drivers/mtd/nand/hifmc100_nand/Kconfig"
+
endif # MTD_NAND
diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
index cafde6f..84f9a3f 100644
--- a/drivers/mtd/nand/Makefile
+++ b/drivers/mtd/nand/Makefile
@@ -8,6 +8,10 @@ obj-$(CONFIG_MTD_NAND_BCH) += nand_bch.o
obj-$(CONFIG_MTD_NAND_IDS) += nand_ids.o
obj-$(CONFIG_MTD_SM_COMMON) += sm_common.o
+obj-$(CONFIG_MTD_NAND_HIFMC100) += hifmc100_nand/
+obj-$(CONFIG_MTD_SPI_NAND_HIFMC100) += hifmc100/
+obj-$(CONFIG_MTD_NAND_HISNFC100) += hisnfc100/
+obj-$(CONFIG_MTD_NAND_HINFC610) += hinfc610/
obj-$(CONFIG_MTD_NAND_CAFE) += cafe_nand.o
obj-$(CONFIG_MTD_NAND_AMS_DELTA) += ams-delta.o
obj-$(CONFIG_MTD_NAND_DENALI) += denali.o
@@ -59,4 +63,4 @@ obj-$(CONFIG_MTD_NAND_BRCMNAND) += brcmnand/
obj-$(CONFIG_MTD_NAND_QCOM) += qcom_nandc.o
obj-$(CONFIG_MTD_NAND_MTK) += mtk_nand.o mtk_ecc.o
-nand-objs := nand_base.o nand_bbt.o nand_timings.o
+nand-objs := nand_base.o nand_bbt.o nand_timings.o hinfc_gen.o hinfc_spl_ids.o match_table.o
diff --git a/drivers/mtd/nand/hifmc100/Kconfig b/drivers/mtd/nand/hifmc100/Kconfig
new file mode 100644
index 0000000..5b15bc8
--- /dev/null
+++ b/drivers/mtd/nand/hifmc100/Kconfig
@@ -0,0 +1,17 @@
+#
+# hisilicon flash memory controller SPI nand device driver version 100
+# drivers/mtd/nand/hifmc100/Kconfig
+# add by hisilicon 2017.8.7
+#
+
+config MTD_SPI_NAND_HIFMC100
+ bool "Hisilicon Flash Memory Controller v100 SPI Nand devices support"
+ depends on MFD_HISI_FMC && MTD_SPI_NAND_HISI_BVT
+ select MISC_FILESYSTEMS
+ select MTD_BLOCK
+ select YAFFS_FS
+ select YAFFS_YAFFS2
+ help
+ Hisilicon Flash Memory Controller version 100 is called hifmc100 for
+ short. The controller driver support registers and DMA transfers
+ while reading or writing the SPI nand flash.
diff --git a/drivers/mtd/nand/hifmc100/Makefile b/drivers/mtd/nand/hifmc100/Makefile
new file mode 100644
index 0000000..b1fda5d
--- /dev/null
+++ b/drivers/mtd/nand/hifmc100/Makefile
@@ -0,0 +1,26 @@
+#
+# The Flash Memory Controller v100 Device Driver for hisilicon
+#
+# Copyright (c) 2016-2017 HiSilicon Technologies Co., Ltd.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+#
+
+#
+# drivers/mtd/nand/hifmc100/Makefile
+#
+
+obj-y += hifmc_spi_nand_ids.o
+obj-y += hifmc100.o hifmc100_os.o
diff --git a/drivers/mtd/nand/hifmc100/hifmc100.c b/drivers/mtd/nand/hifmc100/hifmc100.c
new file mode 100644
index 0000000..748088f
--- /dev/null
+++ b/drivers/mtd/nand/hifmc100/hifmc100.c
@@ -0,0 +1,1167 @@
+/*
+ * The Flash Memory Controller v100 Device Driver for hisilicon
+ *
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "../hinfc_gen.h"
+#include "hifmc100_os.h"
+#include "hifmc100.h"
+#include
+
+/*****************************************************************************/
+static void hifmc100_switch_to_spi_nand(struct hifmc_host *host)
+{
+ int reg;
+
+ reg = hifmc_readl(host, FMC_CFG);
+ reg &= ~FLASH_TYPE_SEL_MASK;
+ reg |= FMC_CFG_FLASH_SEL(FLASH_TYPE_SPI_NAND);
+ hifmc_writel(host, FMC_CFG, reg);
+}
+
+/*****************************************************************************/
+static void hifmc100_operation_config(struct hifmc_host *host, int op)
+{
+ int ret, clkrate = 0;
+ struct hifmc_spi *spi = host->spi;
+
+ hifmc100_switch_to_spi_nand(host);
+ clk_prepare_enable(host->clk);
+ switch (op) {
+ case OP_STYPE_WRITE:
+ clkrate = min((u_long)host->clkrate,
+ (u_long)CLK_FMC_TO_CRG_MHZ(spi->write->clock));
+ break;
+ case OP_STYPE_READ:
+ clkrate = min((u_long)host->clkrate,
+ (u_long)CLK_FMC_TO_CRG_MHZ(spi->read->clock));
+ break;
+ case OP_STYPE_ERASE:
+ clkrate = min((u_long)host->clkrate,
+ (u_long)CLK_FMC_TO_CRG_MHZ(spi->erase->clock));
+ break;
+ default:
+ break;
+ }
+
+ ret = clk_set_rate(host->clk, clkrate);
+ if (WARN_ON(ret))
+ pr_err("clk_set_rate failed: %d\n", ret);
+}
+
+/*****************************************************************************/
+static void hifmc100_send_cmd_write(struct hifmc_host *host)
+{
+ unsigned char pages_per_block_shift;
+ unsigned int reg, block_num, block_num_h, page_num;
+ struct hifmc_spi *spi = host->spi;
+ struct nand_chip *chip = host->chip;
+#ifdef HIFMC100_SPI_NAND_SUPPORT_REG_WRITE
+ const char *op = "Reg";
+#else
+ const char *op = "Dma";
+#endif
+
+ if (WR_DBG)
+ pr_info("\n");
+ FMC_PR(WR_DBG, "*-Start send %s page write command\n", op);
+
+ mutex_lock(host->lock);
+ hifmc100_operation_config(host, OP_STYPE_WRITE);
+
+ reg = spi->driver->wait_ready(spi);
+ if (reg) {
+ DB_MSG("Error: %s program wait ready failed! status: %#x\n",
+ op, reg);
+ goto end;
+ }
+
+ reg = spi->driver->write_enable(spi);
+ if (reg) {
+ DB_MSG("Error: %s program write enable failed! reg: %#x\n",
+ op, reg);
+ goto end;
+ }
+
+ reg = FMC_INT_CLR_ALL;
+ hifmc_writel(host, FMC_INT_CLR, reg);
+ FMC_PR(WR_DBG, "|-Set INT_CLR[%#x]%#x\n", FMC_INT_CLR, reg);
+
+ reg = OP_CFG_FM_CS(host->cmd_op.cs)
+ | OP_CFG_MEM_IF_TYPE(spi->write->iftype);
+ hifmc_writel(host, FMC_OP_CFG, reg);
+ FMC_PR(WR_DBG, "|-Set OP_CFG[%#x]%#x\n", FMC_OP_CFG, reg);
+
+ pages_per_block_shift = chip->phys_erase_shift - chip->page_shift;
+ block_num = host->addr_value[1] >> pages_per_block_shift;
+ block_num_h = block_num >> REG_CNT_HIGH_BLOCK_NUM_SHIFT;
+ reg = FMC_ADDRH_SET(block_num_h);
+ hifmc_writel(host, FMC_ADDRH, reg);
+ FMC_PR(WR_DBG, "|-Set ADDRH[%#x]%#x\n", FMC_ADDRH, reg);
+
+ page_num = host->addr_value[1] - (block_num << pages_per_block_shift);
+ reg = ((block_num & REG_CNT_BLOCK_NUM_MASK) << REG_CNT_BLOCK_NUM_SHIFT)
+ | ((page_num & REG_CNT_PAGE_NUM_MASK) << REG_CNT_PAGE_NUM_SHIFT);
+ hifmc_writel(host, FMC_ADDRL, reg);
+ FMC_PR(WR_DBG, "|-Set ADDRL[%#x]%#x\n", FMC_ADDRL, reg);
+
+ *host->epm = 0x0000;
+
+#ifndef HIFMC100_SPI_NAND_SUPPORT_REG_WRITE
+ reg = host->dma_buffer;
+ hifmc_writel(host, FMC_DMA_SADDR_D0, reg);
+ FMC_PR(WR_DBG, "|-Set DMA_SADDR_D[0x40]%#x\n", reg);
+
+#ifdef CONFIG_64BIT
+ reg = (host->dma_buffer & FMC_DMA_SADDRH_MASK) >> 32;
+ hifmc_writel(host, FMC_DMA_SADDRH_D0, reg);
+ FMC_PR(WR_DBG, "\t|-Set DMA_SADDRH_D0[%#x]%#x\n", FMC_DMA_SADDRH_D0, reg);
+#endif
+
+ reg = host->dma_oob;
+ hifmc_writel(host, FMC_DMA_SADDR_OOB, reg);
+ FMC_PR(WR_DBG, "|-Set DMA_SADDR_OOB[%#x]%#x\n", FMC_DMA_SADDR_OOB, reg);
+#ifdef CONFIG_64BIT
+ reg = (host->dma_oob & FMC_DMA_SADDRH_MASK) >> 32;
+ hifmc_writel(host, FMC_DMA_SADDRH_OOB, reg);
+ FMC_PR(WR_DBG, "\t|-Set DMA_SADDRH_OOB[%#x]%#x\n", FMC_DMA_SADDRH_OOB,
+ reg);
+#endif
+#endif
+
+ reg = OP_CTRL_WR_OPCODE(spi->write->cmd)
+#ifdef HIFMC100_SPI_NAND_SUPPORT_REG_WRITE
+ | OP_CTRL_DMA_OP(OP_TYPE_REG)
+#else
+ | OP_CTRL_DMA_OP(OP_TYPE_DMA)
+#endif
+ | OP_CTRL_RW_OP(RW_OP_WRITE)
+ | OP_CTRL_DMA_OP_READY;
+ hifmc_writel(host, FMC_OP_CTRL, reg);
+ FMC_PR(WR_DBG, "|-Set OP_CTRL[%#x]%#x\n", FMC_OP_CTRL, reg);
+
+ FMC_DMA_WAIT_INT_FINISH(host);
+
+end:
+ mutex_unlock(host->lock);
+ FMC_PR(WR_DBG, "*-End %s page program!\n", op);
+}
+
+/*****************************************************************************/
+static void hifmc100_send_cmd_status(struct hifmc_host *host)
+{
+ unsigned char status, addr = STATUS_ADDR;
+ struct hifmc_spi *spi = host->spi;
+
+ if (host->cmd_op.l_cmd == NAND_CMD_GET_FEATURES)
+ addr = PROTECT_ADDR;
+
+ status = spi_nand_feature_op(spi, GET_OP, addr, 0);
+ FMC_PR((ER_DBG || WR_DBG), "\t*-Get status[%#x]: %#x\n", addr, status);
+}
+
+/*****************************************************************************/
+static void hifmc100_send_cmd_read(struct hifmc_host *host)
+{
+ unsigned char pages_per_block_shift, only_oob = 0;
+ unsigned short wrap = 0;
+ unsigned int reg, block_num, block_num_h, page_num, addr_of = 0;
+ struct hifmc_spi *spi = host->spi;
+ struct nand_chip *chip = host->chip;
+#ifdef HIFMC100_SPI_NAND_SUPPORT_REG_READ
+ char *op = "Reg";
+#else
+ char *op = "Dma";
+#endif
+
+ if (RD_DBG)
+ pr_info("\n");
+ FMC_PR(RD_DBG, "\t*-Start %s page read\n", op);
+
+ if ((host->addr_value[0] == host->cache_addr_value[0])
+ && (host->addr_value[1] == host->cache_addr_value[1])) {
+ FMC_PR(RD_DBG, "\t*-%s read cache hit, addr[%#x %#x]\n",
+ op, host->addr_value[1], host->addr_value[0]);
+ return;
+ }
+
+ mutex_lock(host->lock);
+ hifmc100_operation_config(host, OP_STYPE_READ);
+
+ FMC_PR(RD_DBG, "\t|-Wait ready before %s page read\n", op);
+ reg = spi->driver->wait_ready(spi);
+ if (reg) {
+ DB_MSG("Error: %s read wait ready fail! reg: %#x\n", op, reg);
+ goto end;
+ }
+
+ reg = FMC_INT_CLR_ALL;
+ hifmc_writel(host, FMC_INT_CLR, reg);
+ FMC_PR(RD_DBG, "\t|-Set INT_CLR[%#x]%#x\n", FMC_INT_CLR, reg);
+
+ if (host->cmd_op.l_cmd == NAND_CMD_READOOB) {
+ only_oob = 1;
+ host->cmd_op.op_cfg = OP_CTRL_RD_OP_SEL(RD_OP_READ_OOB);
+ } else
+ host->cmd_op.op_cfg = OP_CTRL_RD_OP_SEL(RD_OP_READ_ALL_PAGE);
+
+ reg = OP_CFG_FM_CS(host->cmd_op.cs)
+ | OP_CFG_MEM_IF_TYPE(spi->read->iftype)
+ | OP_CFG_DUMMY_NUM(spi->read->dummy);
+ hifmc_writel(host, FMC_OP_CFG, reg);
+ FMC_PR(RD_DBG, "\t|-Set OP_CFG[%#x]%#x\n", FMC_OP_CFG, reg);
+
+ pages_per_block_shift = chip->phys_erase_shift - chip->page_shift;
+ block_num = host->addr_value[1] >> pages_per_block_shift;
+ block_num_h = block_num >> REG_CNT_HIGH_BLOCK_NUM_SHIFT;
+
+ reg = FMC_ADDRH_SET(block_num_h);
+ hifmc_writel(host, FMC_ADDRH, reg);
+ FMC_PR(RD_DBG, "\t|-Set ADDRH[%#x]%#x\n", FMC_ADDRH, reg);
+
+ page_num = host->addr_value[1] - (block_num << pages_per_block_shift);
+ if (only_oob)
+ switch (host->ecctype) {
+ case NAND_ECC_8BIT:
+ addr_of = REG_CNT_ECC_8BIT_OFFSET;
+ break;
+ case NAND_ECC_16BIT:
+ addr_of = REG_CNT_ECC_16BIT_OFFSET;
+ break;
+ case NAND_ECC_24BIT:
+ addr_of = REG_CNT_ECC_24BIT_OFFSET;
+ break;
+ case NAND_ECC_0BIT:
+ default:
+ break;
+ }
+
+ reg = ((block_num & REG_CNT_BLOCK_NUM_MASK) << REG_CNT_BLOCK_NUM_SHIFT)
+ | ((page_num & REG_CNT_PAGE_NUM_MASK) << REG_CNT_PAGE_NUM_SHIFT)
+ | ((wrap & REG_CNT_WRAP_MASK) << REG_CNT_WRAP_SHIFT)
+ | (addr_of & REG_CNT_ECC_OFFSET_MASK);
+ hifmc_writel(host, FMC_ADDRL, reg);
+ FMC_PR(RD_DBG, "\t|-Set ADDRL[%#x]%#x\n", FMC_ADDRL, reg);
+
+#ifndef HIFMC100_SPI_NAND_SUPPORT_REG_READ
+ reg = host->dma_buffer;
+ hifmc_writel(host, FMC_DMA_SADDR_D0, reg);
+ FMC_PR(RD_DBG, "\t|-Set DMA_SADDR_D0[%#x]%#x\n", FMC_DMA_SADDR_D0, reg);
+
+#ifdef CONFIG_64BIT
+ reg = (host->dma_buffer & FMC_DMA_SADDRH_MASK) >> 32;
+ hifmc_writel(host, FMC_DMA_SADDRH_D0, reg);
+ FMC_PR(RD_DBG, "\t|-Set DMA_SADDRH_D0[%#x]%#x\n", FMC_DMA_SADDRH_D0, reg);
+#endif
+
+ reg = host->dma_oob;
+ hifmc_writel(host, FMC_DMA_SADDR_OOB, reg);
+ FMC_PR(RD_DBG, "\t|-Set DMA_SADDR_OOB[%#x]%#x\n", FMC_DMA_SADDR_OOB,
+ reg);
+
+#ifdef CONFIG_64BIT
+ reg = (host->dma_oob & FMC_DMA_SADDRH_MASK) >> 32;
+ hifmc_writel(host, FMC_DMA_SADDRH_OOB, reg);
+ FMC_PR(RD_DBG, "\t|-Set DMA_SADDRH_OOB[%#x]%#x\n", FMC_DMA_SADDRH_OOB,
+ reg);
+#endif
+#endif
+
+ reg = OP_CTRL_RD_OPCODE(spi->read->cmd) | host->cmd_op.op_cfg
+#ifdef HIFMC100_SPI_NAND_SUPPORT_REG_READ
+ | OP_CTRL_DMA_OP(OP_TYPE_REG)
+#else
+ | OP_CTRL_DMA_OP(OP_TYPE_DMA)
+#endif
+ | OP_CTRL_RW_OP(RW_OP_READ) | OP_CTRL_DMA_OP_READY;
+ hifmc_writel(host, FMC_OP_CTRL, reg);
+ FMC_PR(RD_DBG, "\t|-Set OP_CTRL[%#x]%#x\n", FMC_OP_CTRL, reg);
+
+ FMC_DMA_WAIT_INT_FINISH(host);
+
+ host->cache_addr_value[0] = host->addr_value[0];
+ host->cache_addr_value[1] = host->addr_value[1];
+
+end:
+ mutex_unlock(host->lock);
+ FMC_PR(RD_DBG, "\t*-End %s page read\n", op);
+}
+
+/*****************************************************************************/
+static void hifmc100_send_cmd_erase(struct hifmc_host *host)
+{
+ unsigned int reg;
+ struct hifmc_spi *spi = host->spi;
+
+ if (ER_DBG)
+ pr_info("\n");
+ FMC_PR(ER_DBG, "\t*-Start send cmd erase!\n");
+
+ mutex_lock(host->lock);
+ hifmc100_operation_config(host, OP_STYPE_ERASE);
+
+ reg = spi->driver->wait_ready(spi);
+ FMC_PR(ER_DBG, "\t|-Erase wait ready, reg: %#x\n", reg);
+ if (reg) {
+ DB_MSG("Error: Erase wait ready fail! status: %#x\n", reg);
+ goto end;
+ }
+
+ reg = spi->driver->write_enable(spi);
+ if (reg) {
+ DB_MSG("Error: Erase write enable failed! reg: %#x\n", reg);
+ goto end;
+ }
+
+ reg = FMC_INT_CLR_ALL;
+ hifmc_writel(host, FMC_INT_CLR, reg);
+ FMC_PR(ER_DBG, "\t|-Set INT_CLR[%#x]%#x\n", FMC_INT_CLR, reg);
+
+ reg = spi->erase->cmd;
+ hifmc_writel(host, FMC_CMD, FMC_CMD_CMD1(reg));
+ FMC_PR(ER_DBG, "\t|-Set CMD[%#x]%#x\n", FMC_CMD, reg);
+
+ reg = FMC_ADDRL_BLOCK_H_MASK(host->addr_value[1])
+ | FMC_ADDRL_BLOCK_L_MASK(host->addr_value[0]);
+ hifmc_writel(host, FMC_ADDRL, reg);
+ FMC_PR(ER_DBG, "\t|-Set ADDRL[%#x]%#x\n", FMC_ADDRL, reg);
+
+ reg = OP_CFG_FM_CS(host->cmd_op.cs)
+ | OP_CFG_MEM_IF_TYPE(spi->erase->iftype)
+ | OP_CFG_ADDR_NUM(STD_OP_ADDR_NUM)
+ | OP_CFG_DUMMY_NUM(spi->erase->dummy);
+ hifmc_writel(host, FMC_OP_CFG, reg);
+ FMC_PR(ER_DBG, "\t|-Set OP_CFG[%#x]%#x\n", FMC_OP_CFG, reg);
+
+ reg = FMC_OP_CMD1_EN
+ | FMC_OP_ADDR_EN
+ | FMC_OP_REG_OP_START;
+ hifmc_writel(host, FMC_OP, reg);
+ FMC_PR(ER_DBG, "\t|-Set OP[%#x]%#x\n", FMC_OP, reg);
+
+ FMC_CMD_WAIT_CPU_FINISH(host);
+
+end:
+ mutex_unlock(host->lock);
+ FMC_PR(ER_DBG, "\t*-End send cmd erase!\n");
+}
+
+/*****************************************************************************/
+void hifmc100_ecc0_switch(struct hifmc_host *host, unsigned char op)
+{
+ unsigned int config;
+#if EC_DBG
+ unsigned int cmp_cfg;
+
+ config = hifmc_readl(host, FMC_CFG);
+ FMC_PR(EC_DBG, "\t *-Get CFG[%#x]%#x\n", FMC_CFG, config);
+
+ if (op)
+ cmp_cfg = host->fmc_cfg;
+ else
+ cmp_cfg = host->fmc_cfg_ecc0;
+
+ if (cmp_cfg != config)
+ DB_MSG("Warning: FMC config[%#x] is different.\n",
+ cmp_cfg);
+#endif
+
+ if (op == ENABLE)
+ config = host->fmc_cfg_ecc0;
+ else if (op == DISABLE)
+ config = host->fmc_cfg;
+ else {
+ DB_MSG("Error: Invalid opcode: %d\n", op);
+ return;
+ }
+
+ hifmc_writel(host, FMC_CFG, config);
+ FMC_PR(EC_DBG, "\t *-Set CFG[%#x]%#x\n", FMC_CFG, config);
+}
+
+/*****************************************************************************/
+static void hifmc100_send_cmd_readid(struct hifmc_host *host)
+{
+ unsigned int reg;
+
+ FMC_PR(BT_DBG, "\t|*-Start send cmd read ID\n");
+
+ hifmc100_ecc0_switch(host, ENABLE);
+
+ reg = FMC_CMD_CMD1(SPI_CMD_RDID);
+ hifmc_writel(host, FMC_CMD, reg);
+ FMC_PR(BT_DBG, "\t||-Set CMD[%#x]%#x\n", FMC_CMD, reg);
+
+ reg = READ_ID_ADDR;
+ hifmc_writel(host, FMC_ADDRL, reg);
+ FMC_PR(BT_DBG, "\t||-Set ADDRL[%#x]%#x\n", FMC_ADDRL, reg);
+
+ reg = OP_CFG_FM_CS(host->cmd_op.cs)
+ | OP_CFG_ADDR_NUM(READ_ID_ADDR_NUM);
+ hifmc_writel(host, FMC_OP_CFG, reg);
+ FMC_PR(BT_DBG, "\t||-Set OP_CFG[%#x]%#x\n", FMC_OP_CFG, reg);
+
+ reg = FMC_DATA_NUM_CNT(MAX_SPI_NAND_ID_LEN);
+ hifmc_writel(host, FMC_DATA_NUM, reg);
+ FMC_PR(BT_DBG, "\t||-Set DATA_NUM[%#x]%#x\n", FMC_DATA_NUM, reg);
+
+ reg = FMC_OP_CMD1_EN
+ | FMC_OP_ADDR_EN
+ | FMC_OP_READ_DATA_EN
+ | FMC_OP_REG_OP_START;
+ hifmc_writel(host, FMC_OP, reg);
+ FMC_PR(BT_DBG, "\t||-Set OP[%#x]%#x\n", FMC_OP, reg);
+
+ host->addr_cycle = 0x0;
+
+ FMC_CMD_WAIT_CPU_FINISH(host);
+
+ hifmc100_ecc0_switch(host, DISABLE);
+
+ FMC_PR(BT_DBG, "\t|*-End read flash ID\n");
+}
+
+/*****************************************************************************/
+static void hifmc100_send_cmd_reset(struct hifmc_host *host)
+{
+ unsigned int reg;
+
+ FMC_PR(BT_DBG, "\t|*-Start send cmd reset\n");
+
+ reg = FMC_CMD_CMD1(SPI_CMD_RESET);
+ hifmc_writel(host, FMC_CMD, reg);
+ FMC_PR(BT_DBG, "\t||-Set CMD[%#x]%#x\n", FMC_CMD, reg);
+
+ reg = OP_CFG_FM_CS(host->cmd_op.cs);
+ hifmc_writel(host, FMC_OP_CFG, reg);
+ FMC_PR(BT_DBG, "\t||-Set OP_CFG[%#x]%#x\n", FMC_OP_CFG, reg);
+
+ reg = FMC_OP_CMD1_EN | FMC_OP_REG_OP_START;
+ hifmc_writel(host, FMC_OP, reg);
+ FMC_PR(BT_DBG, "\t||-Set OP[%#x]%#x\n", FMC_OP, reg);
+
+ FMC_CMD_WAIT_CPU_FINISH(host);
+
+ FMC_PR(BT_DBG, "\t|*-End send cmd reset\n");
+}
+
+/*****************************************************************************/
+static void hifmc100_host_init(struct hifmc_host *host)
+{
+ unsigned int reg;
+
+ FMC_PR(BT_DBG, "\t||*-Start SPI Nand host init\n");
+
+ reg = hifmc_readl(host, FMC_CFG);
+ if ((reg & FMC_CFG_OP_MODE_MASK) == FMC_CFG_OP_MODE_BOOT) {
+ reg |= FMC_CFG_OP_MODE(FMC_CFG_OP_MODE_NORMAL);
+ hifmc_writel(host, FMC_CFG, reg);
+ FMC_PR(BT_DBG, "\t|||-Set CFG[%#x]%#x\n", FMC_CFG, reg);
+ }
+
+ host->fmc_cfg = reg;
+ host->fmc_cfg_ecc0 = (reg & ~ECC_TYPE_MASK) | ECC_TYPE_0BIT;
+
+ reg = hifmc_readl(host, FMC_GLOBAL_CFG);
+ if (reg & FMC_GLOBAL_CFG_WP_ENABLE) {
+ reg &= ~FMC_GLOBAL_CFG_WP_ENABLE;
+ hifmc_writel(host, FMC_GLOBAL_CFG, reg);
+ }
+
+ host->addr_cycle = 0;
+ host->addr_value[0] = 0;
+ host->addr_value[1] = 0;
+ host->cache_addr_value[0] = ~0;
+ host->cache_addr_value[1] = ~0;
+
+ host->send_cmd_write = hifmc100_send_cmd_write;
+ host->send_cmd_status = hifmc100_send_cmd_status;
+ host->send_cmd_read = hifmc100_send_cmd_read;
+ host->send_cmd_erase = hifmc100_send_cmd_erase;
+ host->send_cmd_readid = hifmc100_send_cmd_readid;
+ host->send_cmd_reset = hifmc100_send_cmd_reset;
+#ifdef CONFIG_PM
+ host->suspend = hifmc100_suspend;
+ host->resume = hifmc100_resume;
+#endif
+
+ reg = TIMING_CFG_TCSH(CS_HOLD_TIME)
+ | TIMING_CFG_TCSS(CS_SETUP_TIME)
+ | TIMING_CFG_TSHSL(CS_DESELECT_TIME);
+ hifmc_writel(host, FMC_SPI_TIMING_CFG, reg);
+
+ reg = ALL_BURST_ENABLE;
+ hifmc_writel(host, FMC_DMA_AHB_CTRL, reg);
+
+ FMC_PR(BT_DBG, "\t||*-End SPI Nand host init\n");
+}
+
+/*****************************************************************************/
+static unsigned char hifmc100_read_byte(struct mtd_info *mtd)
+{
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hifmc_host *host = chip->priv;
+ unsigned char value, ret_val = 0;
+
+ if (host->cmd_op.l_cmd == NAND_CMD_READID) {
+ value = hifmc_readb(host->iobase + host->offset);
+ host->offset++;
+ if (host->cmd_op.data_no == host->offset)
+ host->cmd_op.l_cmd = 0;
+ return value;
+ }
+
+ if (host->cmd_op.cmd == NAND_CMD_STATUS) {
+ value = hifmc_readl(host, FMC_STATUS);
+ if (host->cmd_op.l_cmd == NAND_CMD_GET_FEATURES) {
+ FMC_PR((ER_DBG || WR_DBG), "\t\tRead BP status:%#x\n",
+ value);
+ if (ANY_BP_ENABLE(value))
+ ret_val |= NAND_STATUS_WP;
+
+ host->cmd_op.l_cmd = NAND_CMD_STATUS;
+ }
+
+ if (!(value & STATUS_OIP_MASK))
+ ret_val |= NAND_STATUS_READY;
+
+ if (value & STATUS_E_FAIL_MASK) {
+ FMC_PR(ER_DBG, "\t\tGet erase status: %#x\n", value);
+ ret_val |= NAND_STATUS_FAIL;
+ }
+
+ if (value & STATUS_P_FAIL_MASK) {
+ FMC_PR(WR_DBG, "\t\tGet write status: %#x\n", value);
+ ret_val |= NAND_STATUS_FAIL;
+ }
+
+ return ret_val;
+ }
+
+ if (host->cmd_op.l_cmd == NAND_CMD_READOOB) {
+ value = hifmc_readb(host->buffer + host->pagesize + host->offset);
+ host->offset++;
+ return value;
+ }
+
+ host->offset++;
+
+ return hifmc_readb(host->buffer + host->column + host->offset - 1);
+}
+
+/*****************************************************************************/
+static unsigned short hifmc100_read_word(struct mtd_info *mtd)
+{
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hifmc_host *host = chip->priv;
+
+ host->offset += 2;
+ return hifmc_readw(host->buffer + host->column + host->offset - 2);
+}
+
+/*****************************************************************************/
+static void hifmc100_write_buf(struct mtd_info *mtd,
+ const u_char *buf, int len)
+{
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hifmc_host *host = chip->priv;
+
+#ifdef HIFMC100_SPI_NAND_SUPPORT_REG_WRITE
+ if (buf == chip->oob_poi)
+ memcpy((char *)host->iobase + host->pagesize, buf, len);
+ else
+ memcpy((char *)host->iobase, buf, len);
+#else
+ if (buf == chip->oob_poi)
+ memcpy((char *)(host->buffer + host->pagesize), buf, len);
+ else
+ memcpy((char *)host->buffer, buf, len);
+#endif
+ return;
+}
+
+/*****************************************************************************/
+static void hifmc100_read_buf(struct mtd_info *mtd, u_char *buf, int len)
+{
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hifmc_host *host = chip->priv;
+
+#ifdef HIFMC100_SPI_NAND_SUPPORT_REG_READ
+ if (buf == chip->oob_poi)
+ memcpy(buf, (char *)host->iobase + host->pagesize, len);
+ else
+ memcpy(buf, (char *)host->iobase, len);
+#else
+ if (buf == chip->oob_poi)
+ memcpy(buf, (char *)host->buffer + host->pagesize, len);
+ else
+ memcpy(buf, (char *)host->buffer, len);
+#endif
+
+#ifdef CONFIG_HISI_NAND_ECC_STATUS_REPORT
+ if (buf != chip->oob_poi) {
+ u_int reg, ecc_step = host->pagesize >> 10;
+
+ reg = hifmc_readl(host, HIFMC100_ECC_ERR_NUM0_BUF0);
+ while (ecc_step) {
+ u_char err_num;
+
+ err_num = GET_ECC_ERR_NUM(--ecc_step, reg);
+ if (err_num == 0xff)
+ mtd->ecc_stats.failed++;
+ else
+ mtd->ecc_stats.corrected += err_num;
+ }
+ }
+#endif
+
+ return;
+}
+
+/*****************************************************************************/
+static void hifmc100_select_chip(struct mtd_info *mtd, int chipselect)
+{
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hifmc_host *host = chip->priv;
+
+ if (chipselect < 0)
+ return;
+
+ if (chipselect > CONFIG_SPI_NAND_MAX_CHIP_NUM)
+ DB_BUG("Error: Invalid chipselect: %d\n", chipselect);
+
+ if (host->mtd != mtd) {
+ host->mtd = mtd;
+ host->cmd_op.cs = chipselect;
+ }
+
+ if (!(chip->options & NAND_BROKEN_XD)) {
+ if ((chip->state == FL_ERASING) || (chip->state == FL_WRITING))
+ host->cmd_op.l_cmd = NAND_CMD_GET_FEATURES;
+ }
+}
+
+/*****************************************************************************/
+static void hifmc100_cmd_ctrl(struct mtd_info *mtd, int dat, unsigned ctrl)
+{
+ unsigned char cmd;
+ int is_cache_invalid = 1;
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hifmc_host *host = chip->priv;
+
+ if (ctrl & NAND_ALE) {
+ unsigned int addr_value = 0;
+ unsigned int addr_offset = 0;
+
+ if (ctrl & NAND_CTRL_CHANGE) {
+ host->addr_cycle = 0x0;
+ host->addr_value[0] = 0x0;
+ host->addr_value[1] = 0x0;
+ }
+ addr_offset = host->addr_cycle << 3;
+
+ if (host->addr_cycle >= HIFMC100_ADDR_CYCLE_MASK) {
+ addr_offset = (host->addr_cycle -
+ HIFMC100_ADDR_CYCLE_MASK) << 3;
+ addr_value = 1;
+ }
+
+ host->addr_value[addr_value] |=
+ ((dat & 0xff) << addr_offset);
+
+ host->addr_cycle++;
+ }
+
+ if ((ctrl & NAND_CLE) && (ctrl & NAND_CTRL_CHANGE)) {
+ cmd = dat & 0xff;
+ host->cmd_op.cmd = cmd;
+ switch (cmd) {
+ case NAND_CMD_PAGEPROG:
+ host->offset = 0;
+ host->send_cmd_write(host);
+ break;
+
+ case NAND_CMD_READSTART:
+ is_cache_invalid = 0;
+ if (host->addr_value[0] == host->pagesize)
+ host->cmd_op.l_cmd = NAND_CMD_READOOB;
+ host->send_cmd_read(host);
+ break;
+
+ case NAND_CMD_ERASE2:
+ host->send_cmd_erase(host);
+ break;
+
+ case NAND_CMD_READID:
+ memset((u_char *)(host->iobase), 0,
+ MAX_SPI_NAND_ID_LEN);
+ host->cmd_op.l_cmd = cmd;
+ host->cmd_op.data_no = MAX_SPI_NAND_ID_LEN;
+ host->send_cmd_readid(host);
+ break;
+
+ case NAND_CMD_STATUS:
+ host->send_cmd_status(host);
+ break;
+
+ case NAND_CMD_READ0:
+ host->cmd_op.l_cmd = cmd;
+ break;
+
+ case NAND_CMD_RESET:
+ host->send_cmd_reset(host);
+ break;
+
+ case NAND_CMD_SEQIN:
+ case NAND_CMD_ERASE1:
+ default:
+ break;
+ }
+ }
+
+ if ((dat == NAND_CMD_NONE) && host->addr_cycle) {
+ if (host->cmd_op.cmd == NAND_CMD_SEQIN
+ || host->cmd_op.cmd == NAND_CMD_READ0
+ || host->cmd_op.cmd == NAND_CMD_READID) {
+ host->offset = 0x0;
+ host->column = (host->addr_value[0] & 0xffff);
+ }
+ }
+
+ if (is_cache_invalid) {
+ host->cache_addr_value[0] = ~0;
+ host->cache_addr_value[1] = ~0;
+ }
+}
+
+/*****************************************************************************/
+static int hifmc100_dev_ready(struct mtd_info *mtd)
+{
+ unsigned int reg;
+ unsigned long deadline = jiffies + FMC_MAX_READY_WAIT_JIFFIES;
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hifmc_host *host = chip->priv;
+
+ do {
+ reg = OP_CFG_FM_CS(host->cmd_op.cs);
+ hifmc_writel(host, FMC_OP_CFG, reg);
+
+ reg = FMC_OP_READ_STATUS_EN | FMC_OP_REG_OP_START;
+ hifmc_writel(host, FMC_OP, reg);
+
+ FMC_CMD_WAIT_CPU_FINISH(host);
+
+ reg = hifmc_readl(host, FMC_STATUS);
+
+ if (!(reg & STATUS_OIP_MASK))
+ return NAND_STATUS_READY;
+
+ cond_resched();
+
+ } while (!time_after_eq(jiffies, deadline));
+
+ if (!(chip->options & NAND_SCAN_SILENT_NODEV))
+ pr_warn("Wait SPI nand ready timeout, status: %#x\n", reg);
+
+ return 0;
+}
+
+/*****************************************************************************/
+/*
+ * 'host->epm' only use the first oobfree[0] field, it looks very simple, But...
+ */
+/* Default OOB area layout */
+static int hifmc_ooblayout_ecc_default(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *oobregion)
+{
+ if (section)
+ return -ERANGE;
+
+ oobregion->length = 32;
+ oobregion->offset = 32;
+
+ return 0;
+}
+
+static int hifmc_ooblayout_free_default(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *oobregion)
+{
+ if (section)
+ return -ERANGE;
+
+ oobregion->length = 30;
+ oobregion->offset = 2;
+
+ return 0;
+}
+
+static struct mtd_ooblayout_ops hifmc_ooblayout_default_ops = {
+ .ecc = hifmc_ooblayout_ecc_default,
+ .free = hifmc_ooblayout_free_default,
+};
+
+#ifdef CONFIG_HISI_NAND_FS_MAY_NO_YAFFS2
+static int hifmc_ooblayout_ecc_4k16bit(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *oobregion)
+{
+ if (section)
+ return -ERANGE;
+
+ oobregion->length = 14;
+ oobregion->offset = 14;
+
+ return 0;
+}
+
+static int hifmc_ooblayout_free_4k16bit(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *oobregion)
+{
+ if (section)
+ return -ERANGE;
+
+ oobregion->length = 14;
+ oobregion->offset = 2;
+
+ return 0;
+}
+
+static struct mtd_ooblayout_ops hifmc_ooblayout_4k16bit_ops = {
+ .ecc = hifmc_ooblayout_ecc_4k16bit,
+ .free = hifmc_ooblayout_free_4k16bit,
+};
+
+static int hifmc_ooblayout_ecc_2k16bit(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *oobregion)
+{
+ if (section)
+ return -ERANGE;
+
+ oobregion->length = 6;
+ oobregion->offset = 6;
+
+ return 0;
+}
+
+static int hifmc_ooblayout_free_2k16bit(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *oobregion)
+{
+ if (section)
+ return -ERANGE;
+
+ oobregion->length = 6;
+ oobregion->offset = 2;
+
+ return 0;
+}
+
+static struct mtd_ooblayout_ops hifmc_ooblayout_2k16bit_ops = {
+ .ecc = hifmc_ooblayout_ecc_2k16bit,
+ .free = hifmc_ooblayout_free_2k16bit,
+};
+#endif
+
+/*****************************************************************************/
+static struct nand_config_info hifmc_spi_nand_config_table[] = {
+ {NAND_PAGE_4K, NAND_ECC_24BIT, 24, 200, &hifmc_ooblayout_default_ops},
+#ifdef CONFIG_HISI_NAND_FS_MAY_NO_YAFFS2
+ {NAND_PAGE_4K, NAND_ECC_16BIT, 16, 128, &hifmc_ooblayout_4k16bit_ops},
+#endif
+ {NAND_PAGE_4K, NAND_ECC_8BIT, 8, 88, &hifmc_ooblayout_default_ops},
+ {NAND_PAGE_4K, NAND_ECC_0BIT, 0, 32, &hifmc_ooblayout_default_ops},
+
+ {NAND_PAGE_2K, NAND_ECC_24BIT, 24, 128, &hifmc_ooblayout_default_ops},
+#ifdef CONFIG_HISI_NAND_FS_MAY_NO_YAFFS2
+ {NAND_PAGE_2K, NAND_ECC_16BIT, 16, 64, &hifmc_ooblayout_2k16bit_ops},
+#endif
+ {NAND_PAGE_2K, NAND_ECC_8BIT, 8, 64, &hifmc_ooblayout_default_ops},
+ {NAND_PAGE_2K, NAND_ECC_0BIT, 0, 32, &hifmc_ooblayout_default_ops},
+
+ {0, 0, 0, 0, NULL},
+};
+
+/*
+ * Auto-sensed the page size and ecc type value. driver will try each of page
+ * size and ecc type one by one till flash can be read and wrote accurately.
+ * so the page size and ecc type is match adaptively without switch on the board
+ */
+static struct nand_config_info *hifmc100_get_config_type_info(
+ struct mtd_info *mtd, struct nand_dev_t *nand_dev)
+{
+ struct nand_config_info *best = NULL;
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct nand_config_info *info = hifmc_spi_nand_config_table;
+
+ nand_dev->start_type = "Auto";
+
+ for (; info->ooblayout_ops; info++) {
+ if (match_page_type_to_size(info->pagetype) != mtd->writesize)
+ continue;
+
+ if (mtd->oobsize < info->oobsize)
+ continue;
+
+ if (!best || (best->ecctype < info->ecctype))
+ best = info;
+ }
+
+ /* All SPI NAND are small-page, SLC */
+ chip->bits_per_cell = 1;
+
+ return best;
+}
+
+/*****************************************************************************/
+static void hifmc100_chip_init(struct nand_chip *chip)
+{
+ chip->read_byte = hifmc100_read_byte;
+ chip->read_word = hifmc100_read_word;
+ chip->write_buf = hifmc100_write_buf;
+ chip->read_buf = hifmc100_read_buf;
+
+ chip->select_chip = hifmc100_select_chip;
+
+ chip->cmd_ctrl = hifmc100_cmd_ctrl;
+ chip->dev_ready = hifmc100_dev_ready;
+
+ chip->chip_delay = FMC_CHIP_DELAY;
+
+ chip->options = NAND_SKIP_BBTSCAN | NAND_BROKEN_XD
+ | NAND_SCAN_SILENT_NODEV;
+
+ chip->ecc.mode = NAND_ECC_NONE;
+}
+
+/*****************************************************************************/
+static void hifmc100_set_oob_info(struct mtd_info *mtd,
+ struct nand_config_info *info, struct nand_dev_t *nand_dev)
+{
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hifmc_host *host = chip->priv;
+ struct mtd_oob_region hifmc_oobregion = {0, 0};
+
+ if (info->ecctype != NAND_ECC_0BIT)
+ mtd->oobsize = info->oobsize;
+
+ host->oobsize = mtd->oobsize;
+ nand_dev->oobsize = host->oobsize;
+
+ host->dma_oob = host->dma_buffer + host->pagesize;
+ host->bbm = (u_char *)(host->buffer + host->pagesize
+ + HIFMC_BAD_BLOCK_POS);
+
+ info->ooblayout_ops->free(mtd, 0, &hifmc_oobregion);
+
+ mtd_set_ooblayout(mtd, info->ooblayout_ops);
+
+ /* EB bits locate in the bottom two of CTRL(30) */
+ host->epm = (u_short *)(host->buffer + host->pagesize
+ + hifmc_oobregion.offset + 28);
+
+#ifdef CONFIG_HISI_NAND_FS_MAY_NO_YAFFS2
+ if (best->ecctype == NAND_ECC_16BIT) {
+ if (host->pagesize == _2K) {
+ /* EB bits locate in the bottom two of CTRL(4) */
+ host->epm = (u_short *)(host->buffer + host->pagesize
+ + hifmc_oobregion.offset + 4);
+ } else if (host->pagesize == _4K) {
+ /* EB bit locate in the bottom two of CTRL(14) */
+ host->epm = (u_short *)(host->buffer + host->pagesize
+ + hifmc_oobregion.offset + 12);
+ }
+ }
+#endif
+}
+
+/*****************************************************************************/
+static unsigned int hifmc100_get_ecc_reg(struct hifmc_host *host,
+ struct nand_config_info *info, struct nand_dev_t *nand_dev)
+{
+ host->ecctype = info->ecctype;
+ nand_dev->ecctype = host->ecctype;
+
+ return FMC_CFG_ECC_TYPE(match_ecc_type_to_reg(info->ecctype));
+}
+
+/*****************************************************************************/
+static unsigned int hifmc100_get_page_reg(struct hifmc_host *host,
+ struct nand_config_info *info)
+{
+ host->pagesize = match_page_type_to_size(info->pagetype);
+
+ return FMC_CFG_PAGE_SIZE(match_page_type_to_reg(info->pagetype));
+}
+
+/*****************************************************************************/
+static unsigned int hifmc100_get_block_reg(struct hifmc_host *host,
+ struct nand_config_info *info)
+{
+ unsigned int block_reg = 0, page_per_block;
+ struct mtd_info *mtd = host->mtd;
+
+ host->block_page_mask = ((mtd->erasesize / mtd->writesize) - 1);
+ page_per_block = mtd->erasesize / match_page_type_to_size(info->pagetype);
+ switch (page_per_block) {
+ case 64:
+ block_reg = BLOCK_SIZE_64_PAGE;
+ break;
+ case 128:
+ block_reg = BLOCK_SIZE_128_PAGE;
+ break;
+ case 256:
+ block_reg = BLOCK_SIZE_256_PAGE;
+ break;
+ case 512:
+ block_reg = BLOCK_SIZE_512_PAGE;
+ break;
+ default:
+ DB_MSG("Can't support block %#x and page %#x size\n",
+ mtd->erasesize, mtd->writesize);
+ }
+
+ return FMC_CFG_BLOCK_SIZE(block_reg);
+}
+
+/*****************************************************************************/
+static void hifmc100_set_fmc_cfg_reg(struct hifmc_host *host,
+ struct nand_config_info *type_info, struct nand_dev_t *nand_dev)
+{
+ unsigned int page_reg, ecc_reg, block_reg, reg_fmc_cfg;
+
+ ecc_reg = hifmc100_get_ecc_reg(host, type_info, nand_dev);
+ page_reg = hifmc100_get_page_reg(host, type_info);
+ block_reg = hifmc100_get_block_reg(host, type_info);
+
+ reg_fmc_cfg = hifmc_readl(host, FMC_CFG);
+ reg_fmc_cfg &= ~(PAGE_SIZE_MASK | ECC_TYPE_MASK | BLOCK_SIZE_MASK);
+ reg_fmc_cfg |= ecc_reg | page_reg | block_reg;
+ hifmc_writel(host, FMC_CFG, reg_fmc_cfg);
+
+ /* Save value of FMC_CFG and FMC_CFG_ECC0 to turn on/off ECC */
+ host->fmc_cfg = reg_fmc_cfg;
+ host->fmc_cfg_ecc0 = (host->fmc_cfg & ~ECC_TYPE_MASK) | ECC_TYPE_0BIT;
+ FMC_PR(BT_DBG, "\t|-Save FMC_CFG[%#x]: %#x and FMC_CFG_ECC0: %#x\n",
+ FMC_CFG, host->fmc_cfg, host->fmc_cfg_ecc0);
+}
+
+/*****************************************************************************/
+static int hifmc100_set_config_info(struct mtd_info *mtd,
+ struct nand_chip *chip, struct nand_dev_t *nand_dev)
+{
+ struct hifmc_host *host = chip->priv;
+ struct nand_config_info *type_info = NULL;
+
+ FMC_PR(BT_DBG, "\t*-Start config Block Page OOB and Ecc\n");
+
+ type_info = hifmc100_get_config_type_info(mtd, nand_dev);
+ BUG_ON(!type_info);
+
+ FMC_PR(BT_DBG, "\t|-%s Config, PageSize %s EccType %s OOBSize %d\n",
+ nand_dev->start_type, nand_page_name(type_info->pagetype),
+ nand_ecc_name(type_info->ecctype), type_info->oobsize);
+
+ /* Set the page_size, ecc_type, block_size of FMC_CFG[0x0] register */
+ hifmc100_set_fmc_cfg_reg(host, type_info, nand_dev);
+
+ hifmc100_set_oob_info(mtd, type_info, nand_dev);
+
+ FMC_PR(BT_DBG, "\t*-End config Block Page Oob and Ecc\n");
+
+ return 0;
+}
+
+/*****************************************************************************/
+int hifmc100_spi_nand_init(struct nand_chip *chip)
+{
+ struct hifmc_host *host = chip->priv;
+
+ FMC_PR(BT_DBG, "\t|*-Start hifmc100 SPI Nand init\n");
+
+ /* Set system clock and enable controller */
+ clk_prepare_enable(host->clk);
+
+ /* Switch SPI type to SPI nand */
+ hifmc100_switch_to_spi_nand(host);
+
+ /* Hifmc host init */
+ hifmc100_host_init(host);
+ host->chip = chip;
+
+ /* Hifmc nand_chip struct init */
+ hifmc100_chip_init(chip);
+
+ hifmc_spi_nand_ids_register();
+ hinfc_param_adjust = hifmc100_set_config_info;
+
+ FMC_PR(BT_DBG, "\t|*-End hifmc100 SPI Nand init\n");
+
+ return 0;
+}
+#ifdef CONFIG_PM
+/*****************************************************************************/
+int hifmc100_suspend(struct platform_device *pltdev, pm_message_t state)
+{
+ unsigned int ret;
+ struct hifmc_host *host = platform_get_drvdata(pltdev);
+ struct hifmc_spi *spi = host->spi;
+
+ mutex_lock(host->lock);
+ hifmc100_switch_to_spi_nand(host);
+
+ ret = spi->driver->wait_ready(spi);
+ if (ret) {
+ DB_MSG("Error: wait ready failed!");
+ return 0;
+ }
+
+ clk_disable_unprepare(host->clk);
+ mutex_unlock(host->lock);
+
+ return 0;
+}
+/*****************************************************************************/
+int hifmc100_resume(struct platform_device *pltdev)
+{
+ int cs;
+ struct hifmc_host *host = platform_get_drvdata(pltdev);
+ struct nand_chip *chip = host->chip;
+
+ mutex_lock(host->lock);
+ hifmc100_switch_to_spi_nand(host);
+ clk_prepare_enable(host->clk);
+
+ for (cs = 0; cs < chip->numchips; cs++)
+ host->send_cmd_reset(host);
+
+ hifmc100_spi_nand_config(host);
+
+ mutex_unlock(host->lock);
+ return 0;
+}
+#endif
+
diff --git a/drivers/mtd/nand/hifmc100/hifmc100.h b/drivers/mtd/nand/hifmc100/hifmc100.h
new file mode 100644
index 0000000..2f7f5a8
--- /dev/null
+++ b/drivers/mtd/nand/hifmc100/hifmc100.h
@@ -0,0 +1,391 @@
+/*
+ * The Flash Memory Controller v100 Device Driver for hisilicon
+ *
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#ifndef __HIFMC100_H__
+#define __HIFMC100_H__
+
+/*****************************************************************************/
+#include
+#include
+
+/*****************************************************************************/
+#define INFINITE (0xFFFFFFFF)
+
+/*****************************************************************************/
+#define SPI_IF_READ_STD (0x01)
+#define SPI_IF_READ_FAST (0x02)
+#define SPI_IF_READ_DUAL (0x04)
+#define SPI_IF_READ_DUAL_ADDR (0x08)
+#define SPI_IF_READ_QUAD (0x10)
+#define SPI_IF_READ_QUAD_ADDR (0x20)
+
+#define SPI_IF_WRITE_STD (0x01)
+#define SPI_IF_WRITE_DUAL (0x02)
+#define SPI_IF_WRITE_DUAL_ADDR (0x04)
+#define SPI_IF_WRITE_QUAD (0x08)
+#define SPI_IF_WRITE_QUAD_ADDR (0x10)
+
+#define SPI_IF_ERASE_SECTOR_4K (0x01)
+#define SPI_IF_ERASE_SECTOR_32K (0x02)
+#define SPI_IF_ERASE_SECTOR_64K (0x04)
+#define SPI_IF_ERASE_SECTOR_128K (0x08)
+#define SPI_IF_ERASE_SECTOR_256K (0x10)
+
+/******************************************************************************/
+#define HIFMC_SPI_NAND_SUPPORT_READ (SPI_IF_READ_STD \
+ | SPI_IF_READ_FAST \
+ | SPI_IF_READ_DUAL \
+ | SPI_IF_READ_DUAL_ADDR \
+ | SPI_IF_READ_QUAD \
+ | SPI_IF_READ_QUAD_ADDR)
+
+#define HIFMC_SPI_NAND_SUPPORT_WRITE (SPI_IF_WRITE_STD | SPI_IF_WRITE_QUAD)
+
+#define HIFMC_SPI_NAND_SUPPORT_MAX_DUMMY 8
+
+/*****************************************************************************/
+#define SPI_CMD_READ_STD 0x03 /* Standard read cache */
+#define SPI_CMD_READ_FAST 0x0B /* Higher speed read cache */
+#define SPI_CMD_READ_DUAL 0x3B /* 2 IO read cache only date */
+#define SPI_CMD_READ_DUAL_ADDR 0xBB /* 2 IO read cache date&addr */
+#define SPI_CMD_READ_QUAD 0x6B /* 4 IO read cache only date */
+#define SPI_CMD_READ_QUAD_ADDR 0xEB /* 4 IO read cache date&addr */
+
+#define SPI_CMD_WRITE_STD 0x02 /* Standard page program */
+#define SPI_CMD_WRITE_DUAL 0xA2 /* 2 IO program only date */
+#define SPI_CMD_WRITE_DUAL_ADDR 0xD2 /* 2 IO program date&addr */
+#define SPI_CMD_WRITE_QUAD 0x32 /* 4 IO program only date */
+#define SPI_CMD_WRITE_QUAD_ADDR 0x12 /* 4 IO program date&addr */
+
+#define SPI_CMD_SE_4K 0x20 /* 4KB sector Erase */
+#define SPI_CMD_SE_32K 0x52 /* 32KB sector Erase */
+#define SPI_CMD_SE_64K 0xD8 /* 64KB sector Erase */
+#define SPI_CMD_SE_128K 0xD8 /* 128KB sector Erase */
+#define SPI_CMD_SE_256K 0xD8 /* 256KB sector Erase */
+
+/*****************************************************************************/
+#define SET_READ_STD(_dummy_, _size_, _clk_) \
+ static struct spi_op read_std_##_dummy_##_size_##_clk_ = { \
+ SPI_IF_READ_STD, SPI_CMD_READ_STD, _dummy_, _size_, _clk_ }
+
+#define SET_READ_FAST(_dummy_, _size_, _clk_) \
+ static struct spi_op read_fast_##_dummy_##_size_##_clk_ = { \
+ SPI_IF_READ_FAST, SPI_CMD_READ_FAST, _dummy_, _size_, _clk_ }
+
+#define SET_READ_DUAL(_dummy_, _size_, _clk_) \
+ static struct spi_op read_dual_##_dummy_##_size_##_clk_ = { \
+ SPI_IF_READ_DUAL, SPI_CMD_READ_DUAL, _dummy_, _size_, _clk_ }
+
+#define SET_READ_DUAL_ADDR(_dummy_, _size_, _clk_) \
+ static struct spi_op read_dual_addr_##_dummy_##_size_##_clk_ = { \
+ SPI_IF_READ_DUAL_ADDR, SPI_CMD_READ_DUAL_ADDR, _dummy_, _size_, _clk_ }
+
+#define SET_READ_QUAD(_dummy_, _size_, _clk_) \
+ static struct spi_op read_quad_##_dummy_##_size_##_clk_ = { \
+ SPI_IF_READ_QUAD, SPI_CMD_READ_QUAD, _dummy_, _size_, _clk_ }
+
+#define SET_READ_QUAD_ADDR(_dummy_, _size_, _clk_) \
+ static struct spi_op read_quad_addr_##_dummy_##_size_##_clk_ = { \
+ SPI_IF_READ_QUAD_ADDR, SPI_CMD_READ_QUAD_ADDR, _dummy_, _size_, _clk_ }
+
+/*****************************************************************************/
+#define SET_WRITE_STD(_dummy_, _size_, _clk_) \
+ static struct spi_op write_std_##_dummy_##_size_##_clk_ = { \
+ SPI_IF_WRITE_STD, SPI_CMD_WRITE_STD, _dummy_, _size_, _clk_ }
+
+#define SET_WRITE_DUAL(_dummy_, _size_, _clk_) \
+ static struct spi_op write_dual_##_dummy_##_size_##_clk_ = { \
+ SPI_IF_WRITE_DUAL, SPI_CMD_WRITE_DUAL, _dummy_, _size_, _clk_ }
+
+#define SET_WRITE_DUAL_ADDR(_dummy_, _size_, _clk_) \
+ static struct spi_op write_dual_addr_##_dummy_##_size_##_clk_ = { \
+SPI_IF_WRITE_DUAL_ADDR, SPI_CMD_WRITE_DUAL_ADDR, _dummy_, _size_, _clk_ }
+
+#define SET_WRITE_QUAD(_dummy_, _size_, _clk_) \
+ static struct spi_op write_quad_##_dummy_##_size_##_clk_ = { \
+ SPI_IF_WRITE_QUAD, SPI_CMD_WRITE_QUAD, _dummy_, _size_, _clk_ }
+
+#define SET_WRITE_QUAD_ADDR(_dummy_, _size_, _clk_) \
+ static struct spi_op write_quad_addr_##_dummy_##_size_##_clk_ = { \
+SPI_IF_WRITE_QUAD_ADDR, SPI_CMD_WRITE_QUAD_ADDR, _dummy_, _size_, _clk_ }
+
+/*****************************************************************************/
+#define SET_ERASE_SECTOR_4K(_dummy_, _size_, _clk_) \
+ static struct spi_op erase_sector_4k_##_dummy_##_size_##_clk_ = { \
+ SPI_IF_ERASE_SECTOR_4K, SPI_CMD_SE_4K, _dummy_, _size_, _clk_ }
+
+#define SET_ERASE_SECTOR_32K(_dummy_, _size_, _clk_) \
+ static struct spi_op erase_sector_32k_##_dummy_##_size_##_clk_ = { \
+ SPI_IF_ERASE_SECTOR_32K, SPI_CMD_SE_32K, _dummy_, _size_, _clk_ }
+
+#define SET_ERASE_SECTOR_64K(_dummy_, _size_, _clk_) \
+ static struct spi_op erase_sector_64k_##_dummy_##_size_##_clk_ = { \
+ SPI_IF_ERASE_SECTOR_64K, SPI_CMD_SE_64K, _dummy_, _size_, _clk_ }
+
+#define SET_ERASE_SECTOR_128K(_dummy_, _size_, _clk_) \
+ static struct spi_op erase_sector_128k_##_dummy_##_size_##_clk_ = { \
+ SPI_IF_ERASE_SECTOR_128K, SPI_CMD_SE_128K, _dummy_, _size_, _clk_ }
+
+#define SET_ERASE_SECTOR_256K(_dummy_, _size_, _clk_) \
+ static struct spi_op erase_sector_256k_##_dummy_##_size_##_clk_ = { \
+ SPI_IF_ERASE_SECTOR_256K, SPI_CMD_SE_256K, _dummy_, _size_, _clk_ }
+
+/*****************************************************************************/
+#define READ_STD(_dummy_, _size_, _clk_) read_std_##_dummy_##_size_##_clk_
+#define READ_FAST(_dummy_, _size_, _clk_) read_fast_##_dummy_##_size_##_clk_
+#define READ_DUAL(_dummy_, _size_, _clk_) read_dual_##_dummy_##_size_##_clk_
+#define READ_DUAL_ADDR(_dummy_, _size_, _clk_) \
+ read_dual_addr_##_dummy_##_size_##_clk_
+#define READ_QUAD(_dummy_, _size_, _clk_) read_quad_##_dummy_##_size_##_clk_
+#define READ_QUAD_ADDR(_dummy_, _size_, _clk_) \
+ read_quad_addr_##_dummy_##_size_##_clk_
+
+/*****************************************************************************/
+#define WRITE_STD(_dummy_, _size_, _clk_) write_std_##_dummy_##_size_##_clk_
+#define WRITE_DUAL(_dummy_, _size_, _clk_) write_dual_##_dummy_##_size_##_clk_
+#define WRITE_DUAL_ADDR(_dummy_, _size_, _clk_) \
+ write_dual_addr_##_dummy_##_size_##_clk_
+#define WRITE_QUAD(_dummy_, _size_, _clk_) write_quad_##_dummy_##_size_##_clk_
+#define WRITE_QUAD_ADDR(_dummy_, _size_, _clk_) \
+ write_quad_addr_##_dummy_##_size_##_clk_
+
+/*****************************************************************************/
+#define ERASE_SECTOR_4K(_dummy_, _size_, _clk_) \
+ erase_sector_4k_##_dummy_##_size_##_clk_
+#define ERASE_SECTOR_32K(_dummy_, _size_, _clk_) \
+ erase_sector_32k_##_dummy_##_size_##_clk_
+#define ERASE_SECTOR_64K(_dummy_, _size_, _clk_) \
+ erase_sector_64k_##_dummy_##_size_##_clk_
+#define ERASE_SECTOR_128K(_dummy_, _size_, _clk_) \
+ erase_sector_128k_##_dummy_##_size_##_clk_
+#define ERASE_SECTOR_256K(_dummy_, _size_, _clk_) \
+ erase_sector_256k_##_dummy_##_size_##_clk_
+
+/*****************************************************************************/
+#define SPI_CMD_WREN 0x06 /* Write Enable */
+#define SPI_CMD_WRDI 0x04 /* Write Disable */
+
+#define SPI_CMD_RDID 0x9F /* Read Identification */
+
+/*****************************************************************************/
+#define SPI_CMD_GET_FEATURES 0x0F /* Get Features */
+#define SPI_CMD_SET_FEATURE 0x1F /* Set Feature */
+
+#define SPI_CMD_PAGE_READ 0x13 /* Page Read to Cache */
+
+#define SPI_CMD_RESET 0xff /* Reset the device */
+
+/*****************************************************************************/
+/* These macroes are for debug only, reg option is slower then dma option */
+#undef HIFMC100_SPI_NAND_SUPPORT_REG_READ
+/* #define HIFMC100_SPI_NAND_SUPPORT_REG_READ */
+
+#undef HIFMC100_SPI_NAND_SUPPORT_REG_WRITE
+/* #define HIFMC100_SPI_NAND_SUPPORT_REG_WRITE */
+
+#ifdef CONFIG_HISI_NAND_ECC_STATUS_REPORT
+/*****************************************************************************/
+#define HIFMC100_ECC_ERR_NUM0_BUF0 0xc0
+
+#define GET_ECC_ERR_NUM(_i, _reg) (((_reg) >> ((_i) * 8)) & 0xff)
+#endif
+/*****************************************************************************/
+#define REG_CNT_HIGH_BLOCK_NUM_SHIFT 10
+
+#define REG_CNT_BLOCK_NUM_MASK 0x3ff
+#define REG_CNT_BLOCK_NUM_SHIFT 22
+
+#define REG_CNT_PAGE_NUM_MASK 0x3f
+#define REG_CNT_PAGE_NUM_SHIFT 16
+
+#define REG_CNT_WRAP_MASK 0xf
+#define REG_CNT_WRAP_SHIFT 12
+
+#define REG_CNT_ECC_OFFSET_MASK 0xfff
+#define REG_CNT_ECC_8BIT_OFFSET 1054
+#define REG_CNT_ECC_16BIT_OFFSET 1056
+#define REG_CNT_ECC_24BIT_OFFSET 1082
+
+#define ERR_STR_DRIVER "Driver does not support this configure "
+#define ERR_STR_CHECK "Please make sure the hardware configuration is correct"
+
+/*****************************************************************************/
+#define HIFMC100_ADDR_CYCLE_MASK 0x2
+
+/*****************************************************************************/
+#define OP_STYPE_NONE 0x0
+#define OP_STYPE_READ 0x01
+#define OP_STYPE_WRITE 0x02
+#define OP_STYPE_ERASE 0x04
+#define CLK_FMC_TO_CRG_MHZ(_clk) ((_clk) * 2000000)
+
+/*****************************************************************************/
+#define MAX_SPI_OP 8
+
+/*****************************************************************************/
+/* SPI general operation parameter */
+struct spi_op {
+ unsigned char iftype;
+ unsigned char cmd;
+ unsigned char dummy;
+ unsigned int size;
+ unsigned int clock;
+};
+
+struct spi_drv;
+
+/* SPI interface all operation */
+struct hifmc_spi {
+ char *name;
+ int chipselect;
+ unsigned long long chipsize;
+ unsigned int erasesize;
+#define SPI_NOR_3BYTE_ADDR_LEN 3 /* address len 3Bytes */
+#define SPI_NOR_4BYTE_ADDR_LEN 4 /* address len 4Bytes for 32MB */
+ unsigned int addrcycle;
+
+ struct spi_op read[1];
+ struct spi_op write[1];
+ struct spi_op erase[MAX_SPI_OP];
+
+ void *host;
+
+ struct spi_drv *driver;
+};
+
+/* SPI interface special operation function hook */
+struct spi_drv {
+ int (*wait_ready)(struct hifmc_spi *spi);
+ int (*write_enable)(struct hifmc_spi *spi);
+ int (*qe_enable)(struct hifmc_spi *spi);
+ int (*bus_prepare)(struct hifmc_spi *spi, int op);
+ int (*entry_4addr)(struct hifmc_spi *spi, int en);
+};
+
+struct spi_nand_info {
+ char *name;
+ unsigned char id[MAX_SPI_NAND_ID_LEN];
+ unsigned char id_len;
+ unsigned long long chipsize;
+ unsigned int erasesize;
+ unsigned int pagesize;
+ unsigned int oobsize;
+#define BBP_LAST_PAGE 0x01
+#define BBP_FIRST_PAGE 0x02
+ unsigned int badblock_pos;
+ struct spi_op *read[MAX_SPI_OP];
+ struct spi_op *write[MAX_SPI_OP];
+ struct spi_op *erase[MAX_SPI_OP];
+ struct spi_drv *driver;
+};
+
+/*****************************************************************************/
+extern u_char spi_nand_feature_op(struct hifmc_spi *spi, u_char op, u_char addr,
+ u_char val);
+
+/*****************************************************************************/
+struct hifmc_host {
+ struct mtd_info *mtd;
+ struct nand_chip *chip;
+ struct hifmc_spi spi[CONFIG_SPI_NAND_MAX_CHIP_NUM];
+ struct hifmc_cmd_op cmd_op;
+
+ void __iomem *iobase;
+ void __iomem *regbase;
+ struct clk *clk;
+ u32 clkrate;
+
+ unsigned int fmc_cfg;
+ unsigned int fmc_cfg_ecc0;
+
+ unsigned int offset;
+
+ struct device *dev;
+ struct mutex *lock;
+
+ /* This is maybe an un-aligment address, only for malloc or free */
+ char *buforg;
+ char *buffer;
+
+#ifdef CONFIG_64BIT
+ unsigned long long dma_buffer;
+ unsigned long long dma_oob;
+#else
+ unsigned int dma_buffer;
+ unsigned int dma_oob;
+#endif
+
+ unsigned int addr_cycle;
+ unsigned int addr_value[2];
+ unsigned int cache_addr_value[2];
+
+ unsigned int column;
+ unsigned int block_page_mask;
+
+ unsigned int ecctype;
+ unsigned int pagesize;
+ unsigned int oobsize;
+
+ int add_partition;
+
+ int need_rr_data;
+#define HIFMC100_READ_RETRY_DATA_LEN 128
+ char rr_data[HIFMC100_READ_RETRY_DATA_LEN];
+ struct read_retry_t *read_retry;
+
+ int version;
+
+ /* BOOTROM read two bytes to detect the bad block flag */
+#define HIFMC_BAD_BLOCK_POS 0
+ unsigned char *bbm; /* nand bad block mark */
+ unsigned short *epm; /* nand empty page mark */
+
+ unsigned int uc_er;
+
+ void (*send_cmd_write)(struct hifmc_host *host);
+ void (*send_cmd_status)(struct hifmc_host *host);
+ void (*send_cmd_read)(struct hifmc_host *host);
+ void (*send_cmd_erase)(struct hifmc_host *host);
+ void (*send_cmd_readid)(struct hifmc_host *host);
+ void (*send_cmd_reset)(struct hifmc_host *host);
+#ifdef CONFIG_PM
+ int (*suspend)(struct platform_device *pltdev, pm_message_t state);
+ int (*resume)(struct platform_device *pltdev);
+#endif
+};
+
+/*****************************************************************************/
+void hifmc100_ecc0_switch(struct hifmc_host *host, unsigned char op);
+
+int hifmc100_spi_nand_init(struct nand_chip *chip);
+
+/*****************************************************************************/
+extern void hifmc_spi_nand_ids_register(void);
+
+extern void hifmc_set_nand_system_clock(struct spi_op *op, int clk_en);
+
+/*****************************************************************************/
+#ifdef CONFIG_PM
+int hifmc100_suspend(struct platform_device *pltdev, pm_message_t state);
+int hifmc100_resume(struct platform_device *pltdev);
+void hifmc100_spi_nand_config(struct hifmc_host *host);
+#endif
+
+#endif /* End of __HIFMC100_H__ */
diff --git a/drivers/mtd/nand/hifmc100/hifmc100_os.c b/drivers/mtd/nand/hifmc100/hifmc100_os.c
new file mode 100644
index 0000000..c5c90fe
--- /dev/null
+++ b/drivers/mtd/nand/hifmc100/hifmc100_os.c
@@ -0,0 +1,237 @@
+/*
+ * The Flash Memory Controller v100 Device Driver for hisilicon
+ *
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+#include "../../mtdcore.h"
+#include "hifmc100.h"
+#include "hifmc100_os.h"
+
+/*****************************************************************************/
+static int hifmc100_spi_nand_pre_probe(struct nand_chip *chip)
+{
+ uint8_t nand_maf_id;
+ struct hifmc_host *host = chip->priv;
+
+ /* Reset the chip first */
+ host->send_cmd_reset(host);
+ udelay(1000);
+
+ /* Check the ID */
+ host->offset = 0;
+ memset((unsigned char *)(chip->IO_ADDR_R), 0, 0x10);
+ host->send_cmd_readid(host);
+ nand_maf_id = hifmc_readb(chip->IO_ADDR_R);
+
+ if (nand_maf_id == 0x00 || nand_maf_id == 0xff) {
+ printk("Cannot found a valid SPI Nand Device\n");
+ return 1;
+ }
+
+ return 0;
+}
+/*****************************************************************************/
+static int hifmc_nand_scan(struct mtd_info *mtd)
+{
+ int result = 0;
+ unsigned char cs, chip_num = CONFIG_SPI_NAND_MAX_CHIP_NUM;
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hifmc_host *host = chip->priv;
+
+ for (cs = 0; chip_num && (cs < HIFMC_MAX_CHIP_NUM); cs++) {
+ if (hifmc_cs_user[cs]) {
+ FMC_PR(BT_DBG, "\t\t*-Current CS(%d) is occupied.\n",
+ cs);
+ continue;
+ }
+
+ host->cmd_op.cs = cs;
+
+ if (hifmc100_spi_nand_pre_probe(chip))
+ return -ENODEV;
+
+ FMC_PR(BT_DBG, "\t\t*-Scan SPI nand flash on CS: %d\n", cs);
+ if (nand_scan(mtd, chip_num))
+ continue;
+ chip_num--;
+ }
+
+ if (chip_num == CONFIG_SPI_NAND_MAX_CHIP_NUM)
+ result = -ENXIO;
+ else
+ result = 0;
+
+ return result;
+}
+
+/*****************************************************************************/
+static int hisi_spi_nand_probe(struct platform_device *pltdev)
+{
+ int len, result = 0;
+ struct hifmc_host *host;
+ struct nand_chip *chip;
+ struct mtd_info *mtd;
+ struct device *dev = &pltdev->dev;
+ struct device_node *np = NULL;
+ struct hisi_fmc *fmc = dev_get_drvdata(dev->parent);
+
+ FMC_PR(BT_DBG, "\t*-Start SPI Nand flash driver probe\n");
+
+ len = sizeof(struct hifmc_host) + sizeof(struct nand_chip)
+ + sizeof(struct mtd_info);
+ host = devm_kzalloc(dev, len, GFP_KERNEL);
+ if (!host)
+ return -ENOMEM;
+ memset((char *)host, 0, len);
+
+ platform_set_drvdata(pltdev, host);
+ host->dev = &pltdev->dev;
+
+ host->chip = chip = (struct nand_chip *)&host[1];
+ host->mtd = mtd = nand_to_mtd(chip);
+
+ host->regbase = fmc->regbase;
+ host->iobase = fmc->iobase;
+ host->clk = fmc->clk;
+ host->lock = &fmc->lock;
+
+ memset((char *)host->iobase, 0xff, SPI_NAND_BUFFER_LEN);
+ chip->IO_ADDR_R = chip->IO_ADDR_W = host->iobase;
+
+ host->buffer = dmam_alloc_coherent(host->dev, SPI_NAND_BUFFER_LEN,
+ &host->dma_buffer, GFP_KERNEL);
+ if (!host->buffer) {
+ DB_MSG("Error: Can't allocate memory for dma buffer.");
+ result = -EIO;
+ goto fail;
+ }
+ memset(host->buffer, 0xff, SPI_NAND_BUFFER_LEN);
+
+ chip->priv = host;
+ result = hifmc100_spi_nand_init(chip);
+ if (result) {
+ FMC_PR(BT_DBG, "\t|-SPI Nand init failed, ret: %d\n", result);
+ result = -ENODEV;
+ goto fail;
+ }
+
+ np = of_get_next_available_child(dev->of_node, NULL);
+ mtd->name = np->name;
+ mtd->type = MTD_NANDFLASH;
+ mtd->priv = chip;
+ mtd->owner = THIS_MODULE;
+
+ result = of_property_read_u32(np, "spi-max-frequency", &host->clkrate);
+ if (result)
+ goto fail;
+
+ result = hifmc_nand_scan(mtd);
+ if (result) {
+ FMC_PR(BT_DBG, "\t|-Scan SPI Nand failed.\n");
+ goto fail;
+ }
+
+ result = mtd_device_register(mtd, NULL, 0);
+ if (!result) {
+ FMC_PR(BT_DBG, "\t*-End driver probe !!\n");
+ return 0;
+ }
+
+ result = -ENODEV;
+fail:
+ clk_disable_unprepare(host->clk);
+ nand_release(mtd);
+
+ DB_MSG("Error: driver probe, result: %d\n", result);
+ return result;
+}
+
+/*****************************************************************************/
+static int hisi_spi_nand_remove(struct platform_device *pltdev)
+{
+ struct hifmc_host *host = platform_get_drvdata(pltdev);
+
+ dmam_free_coherent(host->dev, SPI_NAND_BUFFER_LEN,
+ host->buffer, host->dma_buffer);
+ clk_disable_unprepare(host->clk);
+ nand_release(host->mtd);
+
+ return 0;
+}
+
+#ifdef CONFIG_PM
+/*****************************************************************************/
+static int hifmc100_os_suspend(struct platform_device *pltdev,
+ pm_message_t state)
+{
+ struct hifmc_host *host = platform_get_drvdata(pltdev);
+
+ if (host && host->suspend)
+ return (host->suspend)(pltdev, state);
+
+ return 0;
+}
+
+/*****************************************************************************/
+static int hifmc100_os_resume(struct platform_device *pltdev)
+{
+ struct hifmc_host *host = platform_get_drvdata(pltdev);
+
+ if (host && host->resume)
+ return (host->resume)(pltdev);
+
+ return 0;
+}
+#endif /* End of CONFIG_PM */
+/*****************************************************************************/
+static const struct of_device_id hisi_spi_nand_dt_ids[] = {
+ { .compatible = "hisilicon,hisi-spi-nand"},
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, hisi_spi_nand_dt_ids);
+
+static struct platform_driver hisi_spi_nand_driver = {
+ .driver = {
+ .name = "hisi_spi_nand",
+ .of_match_table = hisi_spi_nand_dt_ids,
+ },
+ .probe = hisi_spi_nand_probe,
+ .remove = hisi_spi_nand_remove,
+#ifdef CONFIG_PM
+ .suspend = hifmc100_os_suspend,
+ .resume = hifmc100_os_resume,
+#endif
+};
+module_platform_driver(hisi_spi_nand_driver);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("BVT_BSP");
+MODULE_DESCRIPTION("Hisilicon Flash Memory Controller V100 SPI Nand Driver");
diff --git a/drivers/mtd/nand/hifmc100/hifmc100_os.h b/drivers/mtd/nand/hifmc100/hifmc100_os.h
new file mode 100644
index 0000000..22199dc
--- /dev/null
+++ b/drivers/mtd/nand/hifmc100/hifmc100_os.h
@@ -0,0 +1,30 @@
+/*
+ * The Flash Memory Controller v100 Device Driver for hisilicon
+ *
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#ifndef __HIFMC100_OS_H__
+#define __HIFMC100_OS_H__
+
+/*****************************************************************************/
+#define SPI_NAND_MAX_PAGESIZE 4096
+#define SPI_NAND_MAX_OOBSIZE 256
+
+#define SPI_NAND_BUFFER_LEN (SPI_NAND_MAX_PAGESIZE + SPI_NAND_MAX_OOBSIZE)
+
+#endif /* End of __HIFMC100_OS_H__ */
diff --git a/drivers/mtd/nand/hifmc100/hifmc100_spi_general.c b/drivers/mtd/nand/hifmc100/hifmc100_spi_general.c
new file mode 100644
index 0000000..4bcd9c1
--- /dev/null
+++ b/drivers/mtd/nand/hifmc100/hifmc100_spi_general.c
@@ -0,0 +1,253 @@
+/*
+ * The Flash Memory Controller v100 Device Driver for hisilicon
+ *
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+/*
+ Send set/get features command to SPI Nand flash
+*/
+u_char spi_nand_feature_op(struct hifmc_spi *spi, u_char op, u_char addr,
+ u_char val)
+{
+ unsigned int reg;
+ const char *str[] = {"Get", "Set"};
+ struct hifmc_host *host = (struct hifmc_host *)spi->host;
+
+ if ((GET_OP == op) && (STATUS_ADDR == addr)) {
+ if (SR_DBG)
+ pr_info("\n");
+ FMC_PR(SR_DBG, "\t\t|*-Start Get Status\n");
+
+ reg = OP_CFG_FM_CS(host->cmd_op.cs);
+ hifmc_writel(host, FMC_OP_CFG, reg);
+ FMC_PR(SR_DBG, "\t\t||-Set OP_CFG[%#x]%#x\n", FMC_OP_CFG, reg);
+
+ reg = FMC_OP_READ_STATUS_EN | FMC_OP_REG_OP_START;
+ hifmc_writel(host, FMC_OP, reg);
+ FMC_PR(SR_DBG, "\t\t||-Set OP[%#x]%#x\n", FMC_OP, reg);
+
+ FMC_CMD_WAIT_CPU_FINISH(host);
+
+ val = hifmc_readl(host, FMC_STATUS);
+ FMC_PR(SR_DBG, "\t\t|*-End Get Status, result: %#x\n", val);
+
+ return val;
+ }
+
+ FMC_PR(FT_DBG, "\t|||*-Start %s feature, addr[%#x]\n", str[op], addr);
+
+ hifmc100_ecc0_switch(host, ENABLE);
+
+ reg = FMC_CMD_CMD1(op ? SPI_CMD_SET_FEATURE : SPI_CMD_GET_FEATURES);
+ hifmc_writel(host, FMC_CMD, reg);
+ FMC_PR(FT_DBG, "\t||||-Set CMD[%#x]%#x\n", FMC_CMD, reg);
+
+ hifmc_writel(host, FMC_ADDRL, addr);
+ FMC_PR(FT_DBG, "\t||||-Set ADDRL[%#x]%#x\n", FMC_ADDRL, addr);
+
+ reg = OP_CFG_FM_CS(host->cmd_op.cs)
+ | OP_CFG_ADDR_NUM(FEATURES_OP_ADDR_NUM);
+ hifmc_writel(host, FMC_OP_CFG, reg);
+ FMC_PR(FT_DBG, "\t||||-Set OP_CFG[%#x]%#x\n", FMC_OP_CFG, reg);
+
+ reg = FMC_DATA_NUM_CNT(FEATURES_DATA_LEN);
+ hifmc_writel(host, FMC_DATA_NUM, reg);
+ FMC_PR(FT_DBG, "\t||||-Set DATA_NUM[%#x]%#x\n", FMC_DATA_NUM, reg);
+
+ reg = FMC_OP_CMD1_EN
+ | FMC_OP_ADDR_EN
+ | FMC_OP_REG_OP_START;
+
+ if (SET_OP == op) {
+ reg |= FMC_OP_WRITE_DATA_EN;
+ hifmc_writeb(val, host->iobase);
+ FMC_PR(FT_DBG, "\t||||-Write IO[%#lx]%#x\n", (long)host->iobase,
+ *(u_char *)host->iobase);
+ } else
+ reg |= FMC_OP_READ_DATA_EN;
+
+ hifmc_writel(host, FMC_OP, reg);
+ FMC_PR(FT_DBG, "\t||||-Set OP[%#x]%#x\n", FMC_OP, reg);
+
+ FMC_CMD_WAIT_CPU_FINISH(host);
+
+ if (GET_OP == op) {
+ val = hifmc_readb(host->iobase);
+ FMC_PR(FT_DBG, "\t||||-Read IO[%#lx]%#x\n", (long)host->iobase,
+ *(u_char *)host->iobase);
+ }
+
+ hifmc100_ecc0_switch(host, DISABLE);
+
+ FMC_PR(FT_DBG, "\t|||*-End %s Feature[%#x]:%#x\n", str[op], addr, val);
+
+ return val;
+}
+
+/*****************************************************************************/
+/*
+ Read status[C0H]:[0]bit OIP, judge whether the device is busy or not
+*/
+static int spi_general_wait_ready(struct hifmc_spi *spi)
+{
+ unsigned char status;
+ unsigned long deadline = jiffies + FMC_MAX_READY_WAIT_JIFFIES;
+ struct hifmc_host *host = (struct hifmc_host *)spi->host;
+
+ do {
+ status = spi_nand_feature_op(spi, GET_OP, STATUS_ADDR, 0);
+ if (!(status & STATUS_OIP_MASK)) {
+ if ((host->cmd_op.l_cmd == NAND_CMD_ERASE2)
+ && (status & STATUS_E_FAIL_MASK))
+ return status;
+ if ((host->cmd_op.l_cmd == NAND_CMD_PAGEPROG)
+ && (status & STATUS_P_FAIL_MASK))
+ return status;
+ return 0;
+ }
+
+ cond_resched();
+
+ } while (!time_after_eq(jiffies, deadline));
+
+ DB_MSG("Error: SPI Nand wait ready timeout, status: %#x\n", status);
+
+ return 1;
+}
+
+/*****************************************************************************/
+/*
+ Send write enable cmd to SPI Nand, status[C0H]:[2]bit WEL must be set 1
+*/
+static int spi_general_write_enable(struct hifmc_spi *spi)
+{
+ unsigned int reg;
+ struct hifmc_host *host = (struct hifmc_host *)spi->host;
+
+ if (WE_DBG)
+ pr_info("\n");
+ FMC_PR(WE_DBG, "\t|*-Start Write Enable\n");
+
+ reg = spi_nand_feature_op(spi, GET_OP, STATUS_ADDR, 0);
+ if (reg & STATUS_WEL_MASK) {
+ FMC_PR(WE_DBG, "\t||-Write Enable was opened! reg: %#x\n",
+ reg);
+ return 0;
+ }
+
+ reg = hifmc_readl(host, FMC_GLOBAL_CFG);
+ FMC_PR(WE_DBG, "\t||-Get GLOBAL_CFG[%#x]%#x\n", FMC_GLOBAL_CFG, reg);
+ if (reg & FMC_GLOBAL_CFG_WP_ENABLE) {
+ reg &= ~FMC_GLOBAL_CFG_WP_ENABLE;
+ hifmc_writel(host, FMC_GLOBAL_CFG, reg);
+ FMC_PR(WE_DBG, "\t||-Set GLOBAL_CFG[%#x]%#x\n",
+ FMC_GLOBAL_CFG, reg);
+ }
+
+ reg = FMC_CMD_CMD1(SPI_CMD_WREN);
+ hifmc_writel(host, FMC_CMD, reg);
+ FMC_PR(WE_DBG, "\t||-Set CMD[%#x]%#x\n", FMC_CMD, reg);
+
+ reg = OP_CFG_FM_CS(host->cmd_op.cs);
+ hifmc_writel(host, FMC_OP_CFG, reg);
+ FMC_PR(WE_DBG, "\t||-Set OP_CFG[%#x]%#x\n", FMC_OP_CFG, reg);
+
+ reg = FMC_OP_CMD1_EN | FMC_OP_REG_OP_START;
+ hifmc_writel(host, FMC_OP, reg);
+ FMC_PR(WE_DBG, "\t||-Set OP[%#x]%#x\n", FMC_OP, reg);
+
+ FMC_CMD_WAIT_CPU_FINISH(host);
+
+#if WE_DBG
+ spi->driver->wait_ready(spi);
+
+ reg = spi_nand_feature_op(spi, GET_OP, STATUS_ADDR, 0);
+ if (reg & STATUS_WEL_MASK)
+ FMC_PR(WE_DBG, "\t||-Write Enable success. reg: %#x\n", reg);
+ else {
+ DB_MSG("Error: Write Enable failed! reg: %#x\n", reg);
+ return reg;
+ }
+#endif
+
+ FMC_PR(WE_DBG, "\t|*-End Write Enable\n");
+ return 0;
+}
+
+/*****************************************************************************/
+/*
+ judge whether SPI Nand support QUAD read/write or not
+*/
+static int spi_is_quad(struct hifmc_spi *spi)
+{
+ const char *if_str[] = {"STD", "DUAL", "DIO", "QUAD", "QIO"};
+
+ FMC_PR(QE_DBG, "\t\t|||*-SPI read iftype: %s write iftype: %s\n",
+ if_str[spi->read->iftype], if_str[spi->write->iftype]);
+
+ if ((IF_TYPE_QUAD == spi->read->iftype)
+ || (IF_TYPE_QIO == spi->read->iftype)
+ || (IF_TYPE_QUAD == spi->write->iftype)
+ || (IF_TYPE_QIO == spi->write->iftype))
+ return 1;
+
+ return 0;
+}
+
+/*****************************************************************************/
+/*
+ Send set features cmd to SPI Nand, feature[B0H]:[0]bit QE would be set
+*/
+static int spi_general_qe_enable(struct hifmc_spi *spi)
+{
+ unsigned int reg, op;
+ const char *str[] = {"Disable", "Enable"};
+
+ FMC_PR(QE_DBG, "\t||*-Start SPI Nand flash QE\n");
+
+ op = spi_is_quad(spi);
+
+ FMC_PR(QE_DBG, "\t|||*-End Quad check, SPI Nand %s Quad.\n", str[op]);
+
+ reg = spi_nand_feature_op(spi, GET_OP, FEATURE_ADDR, 0);
+ FMC_PR(QE_DBG, "\t|||-Get [%#x]feature: %#x\n", FEATURE_ADDR, reg);
+ if ((reg & FEATURE_QE_ENABLE) == op) {
+ FMC_PR(QE_DBG, "\t||*-SPI Nand quad was %sd!\n", str[op]);
+ return op;
+ }
+
+ if (op == ENABLE)
+ reg |= FEATURE_QE_ENABLE;
+ else
+ reg &= ~FEATURE_QE_ENABLE;
+
+ spi_nand_feature_op(spi, SET_OP, FEATURE_ADDR, reg);
+ FMC_PR(QE_DBG, "\t|||-SPI Nand %s Quad\n", str[op]);
+
+ spi->driver->wait_ready(spi);
+
+ reg = spi_nand_feature_op(spi, GET_OP, FEATURE_ADDR, 0);
+ if ((reg & FEATURE_QE_ENABLE) == op)
+ FMC_PR(QE_DBG, "\t|||-SPI Nand %s Quad succeed!\n", str[op]);
+ else
+ DB_MSG("Error: %s Quad failed! reg: %#x\n", str[op], reg);
+
+ FMC_PR(QE_DBG, "\t||*-End SPI Nand %s Quad.\n", str[op]);
+
+ return op;
+}
diff --git a/drivers/mtd/nand/hifmc100/hifmc_spi_nand_ids.c b/drivers/mtd/nand/hifmc100/hifmc_spi_nand_ids.c
new file mode 100644
index 0000000..1e8a4e5
--- /dev/null
+++ b/drivers/mtd/nand/hifmc100/hifmc_spi_nand_ids.c
@@ -0,0 +1,1341 @@
+/*
+ * The Flash Memory Controller v100 Device Driver for hisilicon
+ *
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "../hinfc_gen.h"
+#include "hifmc100.h"
+
+/*****************************************************************************/
+SET_READ_STD(1, INFINITE, 24);
+
+SET_READ_FAST(1, INFINITE, 75);
+SET_READ_FAST(1, INFINITE, 80);
+SET_READ_FAST(1, INFINITE, 104);
+SET_READ_FAST(1, INFINITE, 108);
+SET_READ_FAST(1, INFINITE, 120);
+
+SET_READ_DUAL(1, INFINITE, 75);
+SET_READ_DUAL(1, INFINITE, 80);
+SET_READ_DUAL(1, INFINITE, 104);
+SET_READ_DUAL(1, INFINITE, 108);
+SET_READ_DUAL(1, INFINITE, 120);
+
+SET_READ_DUAL_ADDR(1, INFINITE, 75);
+SET_READ_DUAL_ADDR(1, INFINITE, 80);
+SET_READ_DUAL_ADDR(1, INFINITE, 104);
+SET_READ_DUAL_ADDR(1, INFINITE, 108);
+SET_READ_DUAL_ADDR(1, INFINITE, 120);
+
+SET_READ_QUAD(1, INFINITE, 75);
+SET_READ_QUAD(1, INFINITE, 80);
+SET_READ_QUAD(1, INFINITE, 104);
+SET_READ_QUAD(1, INFINITE, 108);
+SET_READ_QUAD(1, INFINITE, 120);
+
+SET_READ_QUAD_ADDR(1, INFINITE, 75);
+SET_READ_QUAD_ADDR(2, INFINITE, 75);
+SET_READ_QUAD_ADDR(1, INFINITE, 80);
+SET_READ_QUAD_ADDR(2, INFINITE, 80);
+SET_READ_QUAD_ADDR(2, INFINITE, 104);
+SET_READ_QUAD_ADDR(1, INFINITE, 108);
+SET_READ_QUAD_ADDR(1, INFINITE, 120);
+
+/*****************************************************************************/
+SET_WRITE_STD(0, 256, 24);
+SET_WRITE_STD(0, 256, 75);
+SET_WRITE_STD(0, 256, 80);
+SET_WRITE_STD(0, 256, 104);
+
+SET_WRITE_QUAD(0, 256, 75);
+SET_WRITE_QUAD(0, 256, 80);
+SET_WRITE_QUAD(0, 256, 104);
+SET_WRITE_QUAD(0, 256, 108);
+SET_WRITE_QUAD(0, 256, 120);
+
+/*****************************************************************************/
+SET_ERASE_SECTOR_128K(0, _128K, 24);
+SET_ERASE_SECTOR_128K(0, _128K, 75);
+SET_ERASE_SECTOR_128K(0, _128K, 80);
+SET_ERASE_SECTOR_128K(0, _128K, 104);
+
+SET_ERASE_SECTOR_256K(0, _256K, 24);
+SET_ERASE_SECTOR_256K(0, _256K, 75);
+SET_ERASE_SECTOR_256K(0, _256K, 80);
+SET_ERASE_SECTOR_256K(0, _256K, 104);
+
+/*****************************************************************************/
+#include "hifmc100_spi_general.c"
+static struct spi_drv spi_driver_general = {
+ .wait_ready = spi_general_wait_ready,
+ .write_enable = spi_general_write_enable,
+ .qe_enable = spi_general_qe_enable,
+};
+
+/* some spi nand flash default QUAD enable, needn't to set qe enable */
+static struct spi_drv spi_driver_no_qe = {
+ .wait_ready = spi_general_wait_ready,
+ .write_enable = spi_general_write_enable,
+};
+
+/*****************************************************************************/
+#define SPI_NAND_ID_TAB_VER "2.4"
+
+/******* SPI Nand ID Table ***************************************************
+* Version Manufacturer Chip Name Size Operation
+* 1.0 ESMT F50L512M41A 64MB Add 5 chip
+* GD 5F1GQ4UAYIG 128MB
+* GD 5F2GQ4UAYIG 256MB
+* GD 5F4GQ4UAYIG 512MB
+* GD 5F4GQ4UBYIG 512MB
+* 1.1 ESMT F50L1G41A 128MB Add 2 chip
+* Winbond W25N01GV 128MB
+* 1.2 GD 5F1GQ4UBYIG 128MB Add 2 chip
+* GD 5F2GQ4UBYIG 256MB
+* 1.3 ATO ATO25D1GA 128MB Add 1 chip
+* 1.4 MXIC MX35LF1GE4AB 128MB Add 2 chip
+* MXIC MX35LF2GE4AB 256MB (SOP-16Pin)
+* 1.5 Paragon PN26G01A 128MB Add 1 chip
+* 1.6 All-flash AFS1GQ4UAC 128MB Add 1 chip
+* 1.7 TOSHIBA TC58CVG0S3H 128MB Add 2 chip
+* TOSHIBA TC58CVG2S0H 512MB
+* 1.8 ALL-flash AFS2GQ4UAD 256MB Add 2 chip
+* Paragon PN26G02A 256MB
+* 1.9 TOSHIBA TC58CVG1S3H 256MB Add 1 chip
+* 2.0 HeYangTek HYF1GQ4UAACAE 128MB Add 3 chip
+* HeYangTek HYF2GQ4UAACAE 256MB
+* HeYangTek HYF4GQ4UAACBE 512MB
+* 2.1 Micron MT29F1G01ABA 128MB Add 5 chip
+ Paragon 1.8V PN26Q01AWSIUG 128MB
+ TOSHIBA 1.8V TC58CYG0S3H 128MB
+ TOSHIBA 1.8V TC58CYG1S3H 256MB
+ TOSHIBA 1.8V TC58CYG2S0H 512MB
+* 2.2 Micron MT29F2G01ABA 256MB Add 1 chip
+* 2.3 MXIC MX35LF2G14AC 256MB Add 1 chip
+* 2.4 GD 1.8V 5F4GQ4RAYIG 512MB Add 1 chip
+******************************************************************************/
+struct spi_nand_info hifmc_spi_nand_flash_table[] = {
+ /* Micron MT29F1G01ABA 1GBit */
+ {
+ .name = "MT29F1G01ABA",
+ .id = {0x2C, 0x14},
+ .id_len = 2,
+ .chipsize = _128M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 128,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 80),
+ &READ_DUAL(1, INFINITE, 80),
+ &READ_DUAL_ADDR(1, INFINITE, 80),
+ &READ_QUAD(1, INFINITE, 80),
+ &READ_QUAD_ADDR(2, INFINITE, 80),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 80),
+ &WRITE_QUAD(0, 256, 80),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 80),
+ 0
+ },
+ .driver = &spi_driver_no_qe,
+ },
+
+ /* Micron MT29F2G01ABA 2GBit */
+ {
+ .name = "MT29F2G01ABA",
+ .id = {0x2C, 0x24},
+ .id_len = 2,
+ .chipsize = _256M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 128,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 108),
+ &READ_DUAL(1, INFINITE, 108),
+ &READ_DUAL_ADDR(1, INFINITE, 108),
+ &READ_QUAD(1, INFINITE, 108),
+ &READ_QUAD_ADDR(2, INFINITE, 104),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 80),
+ &WRITE_QUAD(0, 256, 108),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 80),
+ 0
+ },
+ .driver = &spi_driver_no_qe,
+ },
+
+ /* ESMT F50L512M41A 512Mbit */
+ {
+ .name = "F50L512M41A",
+ .id = {0xC8, 0x20},
+ .id_len = 2,
+ .chipsize = _64M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 64,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 104),
+ &READ_DUAL(1, INFINITE, 104),
+ &READ_QUAD(1, INFINITE, 104),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 104),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 24),
+ 0
+ },
+ .driver = &spi_driver_no_qe,
+ },
+
+ /* ESMT F50L1G41A 1Gbit */
+ {
+ .name = "F50L1G41A",
+ .id = {0xC8, 0x21},
+ .id_len = 2,
+ .chipsize = _128M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 64,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 104),
+ &READ_DUAL(1, INFINITE, 104),
+ &READ_QUAD(1, INFINITE, 104),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 104),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 24),
+ 0
+ },
+ .driver = &spi_driver_no_qe,
+ },
+
+ /* GD 5F1GQ4UAYIG 1Gbit */
+ {
+ .name = "5F1GQ4UAYIG",
+ .id = {0xc8, 0xf1},
+ .id_len = 2,
+ .chipsize = _128M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 64,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 120),
+ &READ_DUAL(1, INFINITE, 120),
+ &READ_DUAL_ADDR(1, INFINITE, 120),
+ &READ_QUAD(1, INFINITE, 120),
+ &READ_QUAD_ADDR(1, INFINITE, 120),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 120),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 24),
+ 0
+ },
+ .driver = &spi_driver_general,
+ },
+
+ /* GD 5F1GQ4UBYIG 1Gbit */
+ {
+ .name = "5F1GQ4UBYIG",
+ .id = {0xc8, 0xd1},
+ .id_len = 2,
+ .chipsize = _128M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 128,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 120),
+ &READ_DUAL(1, INFINITE, 120),
+ &READ_DUAL_ADDR(1, INFINITE, 120),
+ &READ_QUAD(1, INFINITE, 120),
+ &READ_QUAD_ADDR(1, INFINITE, 120),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 120),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 24),
+ 0
+ },
+ .driver = &spi_driver_general,
+ },
+
+ /* GD 5F2GQ4UAYIG 2Gbit */
+ {
+ .name = "5F2GQ4UAYIG",
+ .id = {0xc8, 0xf2},
+ .id_len = 2,
+ .chipsize = _256M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 64,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 120),
+ &READ_DUAL(1, INFINITE, 120),
+ &READ_DUAL_ADDR(1, INFINITE, 120),
+ &READ_QUAD(1, INFINITE, 120),
+ &READ_QUAD_ADDR(1, INFINITE, 120),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 120),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 24),
+ 0
+ },
+ .driver = &spi_driver_general,
+ },
+
+ /* GD 5F2GQ4UBYIG 2Gbit */
+ {
+ .name = "5F2GQ4UBYIG",
+ .id = {0xc8, 0xd2},
+ .id_len = 2,
+ .chipsize = _256M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 128,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 120),
+ &READ_DUAL(1, INFINITE, 120),
+ &READ_DUAL_ADDR(1, INFINITE, 120),
+ &READ_QUAD(1, INFINITE, 120),
+ &READ_QUAD_ADDR(1, INFINITE, 120),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 120),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 24),
+ 0
+ },
+ .driver = &spi_driver_general,
+ },
+
+ /* GD 5F4GQ4UAYIG 4Gbit */
+ {
+ .name = "5F4GQ4UAYIG",
+ .id = {0xc8, 0xf4},
+ .id_len = 2,
+ .chipsize = _512M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 64,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 120),
+ &READ_DUAL(1, INFINITE, 120),
+ &READ_DUAL_ADDR(1, INFINITE, 120),
+ &READ_QUAD(1, INFINITE, 120),
+ &READ_QUAD_ADDR(1, INFINITE, 120),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 120),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 24),
+ 0
+ },
+ .driver = &spi_driver_general,
+ },
+
+ /* GD 5F4GQ4UBYIG 4Gbit */
+ {
+ .name = "5F4GQ4UBYIG",
+ .id = {0xc8, 0xd4},
+ .id_len = 2,
+ .chipsize = _512M,
+ .erasesize = _256K,
+ .pagesize = _4K,
+ .oobsize = 256,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 120),
+ &READ_DUAL(1, INFINITE, 120),
+ &READ_DUAL_ADDR(1, INFINITE, 120),
+ &READ_QUAD(1, INFINITE, 120),
+ &READ_QUAD_ADDR(1, INFINITE, 120),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 120),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_256K(0, _256K, 24),
+ 0
+ },
+ .driver = &spi_driver_general,
+ },
+
+ /* GD 1.8V 5F4GQ4RAYIG 4Gbit */
+ {
+ .name = "5F4GQ4RAYIG",
+ .id = {0xc8, 0xe4},
+ .id_len = 2,
+ .chipsize = _512M,
+ .erasesize = _256K,
+ .pagesize = _4K,
+ .oobsize = 256,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 75),
+ &READ_DUAL(1, INFINITE, 75),
+ &READ_DUAL_ADDR(1, INFINITE, 75),
+ &READ_QUAD(1, INFINITE, 75),
+ &READ_QUAD_ADDR(1, INFINITE, 75),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 75),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_256K(0, _256K, 24),
+ 0
+ },
+ .driver = &spi_driver_general,
+ },
+
+ /* Winbond W25N01GV 1Gbit */
+ {
+ .name = "W25N01GV",
+ .id = {0xef, 0xaa, 0x21},
+ .id_len = 3,
+ .chipsize = _128M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 64,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 104),
+ &READ_DUAL(1, INFINITE, 104),
+ &READ_DUAL_ADDR(1, INFINITE, 104),
+ &READ_QUAD(1, INFINITE, 104),
+ &READ_QUAD_ADDR(2, INFINITE, 104),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 104),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 24),
+ 0
+ },
+ .driver = &spi_driver_no_qe,
+ },
+
+ /* Winbond W25N01GW 1Gbit 1.8V */
+ {
+ .name = "W25N01GW",
+ .id = {0xef, 0xba, 0x21},
+ .id_len = 3,
+ .chipsize = _128M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 64,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 75),
+ &READ_DUAL(1, INFINITE, 75),
+ &READ_DUAL_ADDR(1, INFINITE, 75),
+ &READ_QUAD(1, INFINITE, 75),
+ &READ_QUAD_ADDR(2, INFINITE, 75),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 75),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 24),
+ 0
+ },
+ .driver = &spi_driver_no_qe,
+ },
+
+ /* ATO ATO25D1GA 1Gbit */
+ {
+ .name = "ATO25D1GA",
+ .id = {0x9b, 0x12},
+ .id_len = 2,
+ .chipsize = _128M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 64,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 104),
+ &READ_QUAD(1, INFINITE, 104),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 104),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 24),
+ 0
+ },
+ .driver = &spi_driver_general,
+ },
+
+ /* MXIC MX35LF1GE4AB 1Gbit */
+ {
+ .name = "MX35LF1GE4AB",
+ .id = {0xc2, 0x12},
+ .id_len = 2,
+ .chipsize = _128M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 64,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 104),
+ &READ_QUAD(1, INFINITE, 104),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 104),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 24),
+ 0
+ },
+ .driver = &spi_driver_general,
+ },
+
+ /* MXIC MX35LF2GE4AB 2Gbit SOP-16Pin */
+ {
+ .name = "MX35LF2GE4AB",
+ .id = {0xc2, 0x22},
+ .id_len = 2,
+ .chipsize = _256M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 64,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 104),
+ &READ_QUAD(1, INFINITE, 104),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 104),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 24),
+ 0
+ },
+ .driver = &spi_driver_general,
+ },
+
+ /* MXIC MX35LF2G14AC 2GBit */
+ {
+ .name = "MX35LF2G14AC",
+ .id = {0xc2, 0x20},
+ .id_len = 2,
+ .chipsize = _256M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 64,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 104),
+ &READ_QUAD(1, INFINITE, 104),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 104),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 24),
+ 0
+ },
+ .driver = &spi_driver_general,
+ },
+
+ /* Paragon PN26G01AWSIUG 1Gbit 1.8V */
+ {
+ .name = "PN26G01AW",
+ .id = {0xa1, 0xc1},
+ .id_len = 2,
+ .chipsize = _128M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 128,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 75),
+ &READ_DUAL(1, INFINITE, 75),
+ &READ_DUAL_ADDR(1, INFINITE, 75),
+ &READ_QUAD(1, INFINITE, 75),
+ &READ_QUAD_ADDR(1, INFINITE, 75),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 75),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 75),
+ 0
+ },
+ .driver = &spi_driver_general,
+ },
+
+ /* Paragon PN26G01A 1Gbit */
+ {
+ .name = "PN26G01A",
+ .id = {0xa1, 0xe1},
+ .id_len = 2,
+ .chipsize = _128M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 128,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 108),
+ &READ_DUAL(1, INFINITE, 108),
+ &READ_DUAL_ADDR(1, INFINITE, 108),
+ &READ_QUAD(1, INFINITE, 108),
+ &READ_QUAD_ADDR(1, INFINITE, 108),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 108),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 24),
+ 0
+ },
+ .driver = &spi_driver_general,
+ },
+
+ /* Paragon PN26G02A 2Gbit */
+ {
+ .name = "PN26G02A",
+ .id = {0xa1, 0xe2},
+ .id_len = 2,
+ .chipsize = _256M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 128,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 108),
+ &READ_DUAL(1, INFINITE, 108),
+ &READ_DUAL_ADDR(1, INFINITE, 108),
+ &READ_QUAD(1, INFINITE, 108),
+ &READ_QUAD_ADDR(1, INFINITE, 108),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 108),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 24),
+ 0
+ },
+ .driver = &spi_driver_general,
+ },
+
+ /* All-flash AFS1GQ4UAC 1Gbit */
+ {
+ .name = "AFS1GQ4UAC",
+ .id = {0xc1, 0x51},
+ .id_len = 2,
+ .chipsize = _128M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 128,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 80),
+ &READ_DUAL(1, INFINITE, 80),
+ &READ_DUAL_ADDR(1, INFINITE, 80),
+ &READ_QUAD(1, INFINITE, 80),
+ &READ_QUAD_ADDR(1, INFINITE, 80),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 80),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 24),
+ 0
+ },
+ .driver = &spi_driver_general,
+ },
+
+ /* All-flash AFS2GQ4UAD 2Gbit */
+ {
+ .name = "AFS2GQ4UAD",
+ .id = {0xc1, 0x52},
+ .id_len = 2,
+ .chipsize = _256M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 128,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 80),
+ &READ_DUAL(1, INFINITE, 80),
+ &READ_DUAL_ADDR(1, INFINITE, 80),
+ &READ_QUAD(1, INFINITE, 80),
+ &READ_QUAD_ADDR(1, INFINITE, 80),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 24),
+ &WRITE_QUAD(0, 256, 80),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 24),
+ 0
+ },
+ .driver = &spi_driver_general,
+ },
+
+ /* TOSHIBA TC58CVG0S3H 1Gbit */
+ {
+ .name = "TC58CVG0S3H",
+ .id = {0x98, 0xc2},
+ .id_len = 2,
+ .chipsize = _128M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 64,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 104),
+ &READ_DUAL(1, INFINITE, 104),
+ &READ_QUAD(1, INFINITE, 104),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 104),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 104),
+ 0
+ },
+ .driver = &spi_driver_no_qe,
+ },
+
+ /* TOSHIBA TC58CYG0S3H 1.8V 1Gbit */
+ {
+ .name = "TC58CYG0S3H",
+ .id = {0x98, 0xb2},
+ .id_len = 2,
+ .chipsize = _128M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 128,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 75),
+ &READ_DUAL(1, INFINITE, 75),
+ &READ_QUAD(1, INFINITE, 75),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 75),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 75),
+ 0
+ },
+ .driver = &spi_driver_no_qe,
+ },
+
+ /* TOSHIBA TC58CVG1S3H 2Gbit */
+ {
+ .name = "TC58CVG1S3H",
+ .id = {0x98, 0xcb},
+ .id_len = 2,
+ .chipsize = _256M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 64,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 104),
+ &READ_DUAL(1, INFINITE, 104),
+ &READ_QUAD(1, INFINITE, 104),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 104),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 104),
+ 0
+ },
+ .driver = &spi_driver_no_qe,
+ },
+
+ /* TOSHIBA TC58CYG1S3H 1.8V 2Gbit */
+ {
+ .name = "TC58CYG1S3H",
+ .id = {0x98, 0xbb},
+ .id_len = 2,
+ .chipsize = _256M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 128,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 75),
+ &READ_DUAL(1, INFINITE, 75),
+ &READ_QUAD(1, INFINITE, 75),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 75),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 75),
+ 0
+ },
+ .driver = &spi_driver_no_qe,
+ },
+
+ /* TOSHIBA TC58CVG2S0H 4Gbit */
+ {
+ .name = "TC58CVG2S0H",
+ .id = {0x98, 0xcd},
+ .id_len = 2,
+ .chipsize = _512M,
+ .erasesize = _256K,
+ .pagesize = _4K,
+ .oobsize = 128,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 104),
+ &READ_DUAL(1, INFINITE, 104),
+ &READ_QUAD(1, INFINITE, 104),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 104),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_256K(0, _256K, 104),
+ 0
+ },
+ .driver = &spi_driver_no_qe,
+ },
+
+ /* TOSHIBA TC58CYG2S0H 1.8V 4Gbit */
+ {
+ .name = "TC58CYG2S0H",
+ .id = {0x98, 0xbd},
+ .id_len = 2,
+ .chipsize = _512M,
+ .erasesize = _256K,
+ .pagesize = _4K,
+ .oobsize = 256,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 75),
+ &READ_DUAL(1, INFINITE, 75),
+ &READ_QUAD(1, INFINITE, 75),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 75),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_256K(0, _256K, 75),
+ 0
+ },
+ .driver = &spi_driver_no_qe,
+ },
+
+ /* HeYangTek HYF1GQ4UAACAE 1Gbit */
+ {
+ .name = "HYF1GQ4UAACAE",
+ .id = {0xc9, 0x51},
+ .id_len = 2,
+ .chipsize = _128M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 128,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 80),
+ &READ_DUAL(1, INFINITE, 80),
+ &READ_DUAL_ADDR(1, INFINITE, 80),
+ &READ_QUAD(1, INFINITE, 80),
+ &READ_QUAD_ADDR(1, INFINITE, 80),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 80),
+ &WRITE_QUAD(0, 256, 80),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 80),
+ 0
+ },
+ .driver = &spi_driver_general,
+ },
+
+ /* HeYangTek HYF2GQ4UAACAE 2Gbit */
+ {
+ .name = "HYF2GQ4UAACAE",
+ .id = {0xc9, 0x52},
+ .id_len = 2,
+ .chipsize = _256M,
+ .erasesize = _128K,
+ .pagesize = _2K,
+ .oobsize = 128,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 80),
+ &READ_DUAL(1, INFINITE, 80),
+ &READ_DUAL_ADDR(1, INFINITE, 80),
+ &READ_QUAD(1, INFINITE, 80),
+ &READ_QUAD_ADDR(1, INFINITE, 80),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 80),
+ &WRITE_QUAD(0, 256, 80),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_128K(0, _128K, 80),
+ 0
+ },
+ .driver = &spi_driver_general,
+ },
+
+ /* HeYangTek HYF4GQ4UAACBE 4Gbit */
+ {
+ .name = "HYF4GQ4UAACBE",
+ .id = {0xc9, 0xd4},
+ .id_len = 2,
+ .chipsize = _512M,
+ .erasesize = _256K,
+ .pagesize = _4K,
+ .oobsize = 256,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .read = {
+ &READ_STD(1, INFINITE, 24),
+ &READ_FAST(1, INFINITE, 80),
+ &READ_DUAL(1, INFINITE, 80),
+ &READ_DUAL_ADDR(1, INFINITE, 80),
+ &READ_QUAD(1, INFINITE, 80),
+ &READ_QUAD_ADDR(1, INFINITE, 80),
+ 0
+ },
+ .write = {
+ &WRITE_STD(0, 256, 80),
+ &WRITE_QUAD(0, 256, 80),
+ 0
+ },
+ .erase = {
+ &ERASE_SECTOR_256K(0, _256K, 80),
+ 0
+ },
+ .driver = &spi_driver_general,
+ },
+
+ { .id_len = 0, },
+};
+
+/*****************************************************************************/
+static void hifmc100_spi_nand_search_rw(struct spi_nand_info *spiinfo,
+ struct spi_op *spiop_rw, u_int iftype, u_int max_dummy, int rw_type)
+{
+ int ix = 0;
+ struct spi_op **spiop, **fitspiop;
+
+ for (fitspiop = spiop = (rw_type ? spiinfo->write : spiinfo->read);
+ (*spiop) && ix < MAX_SPI_OP; spiop++, ix++) {
+ if (((*spiop)->iftype & iftype)
+ && ((*spiop)->dummy <= max_dummy)
+ && (*fitspiop)->iftype < (*spiop)->iftype)
+ fitspiop = spiop;
+ }
+ memcpy(spiop_rw, (*fitspiop), sizeof(struct spi_op));
+}
+
+/*****************************************************************************/
+static void hifmc100_spi_nand_get_erase(struct spi_nand_info *spiinfo,
+ struct spi_op *spiop_erase)
+{
+ int ix;
+
+ spiop_erase->size = 0;
+ for (ix = 0; ix < MAX_SPI_OP; ix++) {
+ if (spiinfo->erase[ix] == NULL)
+ break;
+ if (spiinfo->erasesize == spiinfo->erase[ix]->size) {
+ memcpy(&spiop_erase[ix], spiinfo->erase[ix],
+ sizeof(struct spi_op));
+ break;
+ }
+ }
+}
+
+/*****************************************************************************/
+static void hifmc100_map_spi_op(struct hifmc_spi *spi)
+{
+ unsigned char ix;
+ const int iftype_read[] = {
+ SPI_IF_READ_STD, IF_TYPE_STD,
+ SPI_IF_READ_FAST, IF_TYPE_STD,
+ SPI_IF_READ_DUAL, IF_TYPE_DUAL,
+ SPI_IF_READ_DUAL_ADDR, IF_TYPE_DIO,
+ SPI_IF_READ_QUAD, IF_TYPE_QUAD,
+ SPI_IF_READ_QUAD_ADDR, IF_TYPE_QIO,
+ 0, 0,
+ };
+ const int iftype_write[] = {
+ SPI_IF_WRITE_STD, IF_TYPE_STD,
+ SPI_IF_WRITE_QUAD, IF_TYPE_QUAD,
+ 0, 0,
+ };
+ const char *if_str[] = {"STD", "DUAL", "DIO", "QUAD", "QIO"};
+
+ FMC_PR(BT_DBG, "\t||*-Start Get SPI operation iftype\n");
+
+ for (ix = 0; iftype_write[ix]; ix += 2) {
+ if (spi->write->iftype == iftype_write[ix]) {
+ spi->write->iftype = iftype_write[ix + 1];
+ break;
+ }
+ }
+ FMC_PR(BT_DBG, "\t|||-Get best write iftype: %s \n",
+ if_str[spi->write->iftype]);
+
+ for (ix = 0; iftype_read[ix]; ix += 2) {
+ if (spi->read->iftype == iftype_read[ix]) {
+ spi->read->iftype = iftype_read[ix + 1];
+ break;
+ }
+ }
+ FMC_PR(BT_DBG, "\t|||-Get best read iftype: %s \n",
+ if_str[spi->read->iftype]);
+
+ spi->erase->iftype = IF_TYPE_STD;
+ FMC_PR(BT_DBG, "\t|||-Get best erase iftype: %s \n",
+ if_str[spi->erase->iftype]);
+
+ FMC_PR(BT_DBG, "\t||*-End Get SPI operation iftype \n");
+}
+
+/*****************************************************************************/
+static void hifmc100_spi_ids_probe(struct mtd_info *mtd,
+ struct spi_nand_info *spi_dev)
+{
+ unsigned int reg;
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hifmc_host *host = chip->priv;
+ struct hifmc_spi *spi = host->spi;
+
+ FMC_PR(BT_DBG, "\t|*-Start match SPI operation & chip init\n");
+
+ spi->host = host;
+ spi->name = spi_dev->name;
+ spi->driver = spi_dev->driver;
+
+ hifmc100_spi_nand_search_rw(spi_dev, spi->read,
+ HIFMC_SPI_NAND_SUPPORT_READ,
+ HIFMC_SPI_NAND_SUPPORT_MAX_DUMMY, RW_OP_READ);
+ FMC_PR(BT_DBG, "\t||-Save spi->read op cmd:%#x\n", spi->read->cmd);
+
+ hifmc100_spi_nand_search_rw(spi_dev, spi->write,
+ HIFMC_SPI_NAND_SUPPORT_WRITE,
+ HIFMC_SPI_NAND_SUPPORT_MAX_DUMMY, RW_OP_WRITE);
+ FMC_PR(BT_DBG, "\t||-Save spi->write op cmd:%#x\n", spi->write->cmd);
+
+ hifmc100_spi_nand_get_erase(spi_dev, spi->erase);
+ FMC_PR(BT_DBG, "\t||-Save spi->erase op cmd:%#x\n", spi->erase->cmd);
+
+ hifmc100_map_spi_op(spi);
+
+ if (spi->driver->qe_enable)
+ spi->driver->qe_enable(spi);
+
+ /* Disable write protection */
+ reg = spi_nand_feature_op(spi, GET_OP, PROTECT_ADDR, 0);
+ FMC_PR(BT_DBG, "\t||-Get protect status[%#x]: %#x\n", PROTECT_ADDR,
+ reg);
+ if (ANY_BP_ENABLE(reg)) {
+ reg &= ~ALL_BP_MASK;
+ spi_nand_feature_op(spi, SET_OP, PROTECT_ADDR, reg);
+ FMC_PR(BT_DBG, "\t||-Set [%#x]FT %#x\n", PROTECT_ADDR, reg);
+
+ spi->driver->wait_ready(spi);
+
+ reg = spi_nand_feature_op(spi, GET_OP, PROTECT_ADDR, 0);
+ FMC_PR(BT_DBG, "\t||-Check BP disable result: %#x\n", reg);
+ if (ANY_BP_ENABLE(reg))
+ DB_MSG("Error: Write protection disable failed!\n");
+ }
+
+ /* Disable chip internal ECC */
+ reg = spi_nand_feature_op(spi, GET_OP, FEATURE_ADDR, 0);
+ FMC_PR(BT_DBG, "\t||-Get feature status[%#x]: %#x\n", FEATURE_ADDR,
+ reg);
+ if (reg & FEATURE_ECC_ENABLE) {
+ reg &= ~FEATURE_ECC_ENABLE;
+ spi_nand_feature_op(spi, SET_OP, FEATURE_ADDR, reg);
+ FMC_PR(BT_DBG, "\t||-Set [%#x]FT: %#x\n", FEATURE_ADDR, reg);
+
+ spi->driver->wait_ready(spi);
+
+ reg = spi_nand_feature_op(spi, GET_OP, FEATURE_ADDR, 0);
+ FMC_PR(BT_DBG, "\t||-Check internal ECC disable result: %#x\n",
+ reg);
+ if (reg & FEATURE_ECC_ENABLE)
+ DB_MSG("Error: Chip internal ECC disable failed!\n");
+ }
+
+ hifmc_cs_user[host->cmd_op.cs]++;
+
+ FMC_PR(BT_DBG, "\t|*-End match SPI operation & chip init\n");
+}
+
+static struct nand_flash_dev spi_nand_dev;
+/*****************************************************************************/
+static struct nand_flash_dev *spi_nand_get_flash_info(struct mtd_info *mtd,
+ unsigned char *id)
+{
+ unsigned char ix, len = 0;
+ char buffer[100];
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hifmc_host *host = chip->priv;
+ struct spi_nand_info *spi_dev = hifmc_spi_nand_flash_table;
+ struct nand_flash_dev *type = &spi_nand_dev;
+
+ FMC_PR(BT_DBG, "\t*-Start find SPI Nand flash\n");
+
+ len = sprintf(buffer, "SPI Nand(cs %d) ID: %#x %#x",
+ host->cmd_op.cs, id[0], id[1]);
+
+ for (; spi_dev->id_len; spi_dev++) {
+ if (memcmp(id, spi_dev->id, spi_dev->id_len))
+ continue;
+
+ for (ix = 2; ix < spi_dev->id_len; ix++)
+ len += sprintf(buffer + len, " %#x", id[ix]);
+ pr_info("%s\n", buffer);
+
+ FMC_PR(BT_DBG, "\t||-CS(%d) found SPI Nand: %s\n",
+ host->cmd_op.cs, spi_dev->name);
+
+ type->name = spi_dev->name;
+ memcpy(type->id, spi_dev->id, spi_dev->id_len);
+ type->pagesize = spi_dev->pagesize;
+ type->chipsize = spi_dev->chipsize >> 20;
+ type->erasesize = spi_dev->erasesize;
+ type->id_len = spi_dev->id_len;
+ type->oobsize = spi_dev->oobsize;
+ FMC_PR(BT_DBG, "\t|-Save struct nand_flash_dev info\n");
+
+ mtd->oobsize = spi_dev->oobsize;
+ mtd->erasesize = spi_dev->erasesize;
+ mtd->writesize = spi_dev->pagesize;
+ chip->chipsize = spi_dev->chipsize;
+
+ hifmc100_spi_ids_probe(mtd, spi_dev);
+
+ FMC_PR(BT_DBG, "\t*-Found SPI nand: %s\n", spi_dev->name);
+
+ return type;
+ }
+
+ FMC_PR(BT_DBG, "\t*-Not found SPI nand flash, %s\n", buffer);
+
+ return NULL;
+}
+
+/*****************************************************************************/
+void hifmc_spi_nand_ids_register(void)
+{
+ pr_info("SPI Nand ID Table Version %s\n", SPI_NAND_ID_TAB_VER);
+ get_spi_nand_flash_type_hook = spi_nand_get_flash_info;
+}
+
+#ifdef CONFIG_PM
+/*****************************************************************************/
+void hifmc100_spi_nand_config(struct hifmc_host *host)
+{
+ unsigned int reg;
+ struct hifmc_spi *spi = host->spi;
+ static const char const *str[] = {"STD", "DUAL", "DIO", "QUAD", "QIO"};
+
+ /* judge whether support QUAD read/write or not, set it if yes */
+ FMC_PR(PM_DBG, "\t|-SPI read iftype: %s write iftype: %s\n",
+ str[spi->read->iftype], str[spi->write->iftype]);
+
+ if (spi->driver->qe_enable)
+ spi->driver->qe_enable(spi);
+
+ /* Disable write protection */
+ reg = spi_nand_feature_op(spi, GET_OP, PROTECT_ADDR, 0);
+ FMC_PR(PM_DBG, "\t|-Get protect status[%#x]: %#x\n", PROTECT_ADDR,
+ reg);
+ if (ANY_BP_ENABLE(reg)) {
+ reg &= ~ALL_BP_MASK;
+ spi_nand_feature_op(spi, SET_OP, PROTECT_ADDR, reg);
+ FMC_PR(PM_DBG, "\t|-Set [%#x]FT %#x\n", PROTECT_ADDR, reg);
+
+ spi->driver->wait_ready(spi);
+
+ reg = spi_nand_feature_op(spi, GET_OP, PROTECT_ADDR, 0);
+ FMC_PR(PM_DBG, "\t|-Check BP disable result: %#x\n", reg);
+ if (ANY_BP_ENABLE(reg))
+ DB_MSG("Error: Write protection disable failed!\n");
+ }
+
+ /* Disable chip internal ECC */
+ reg = spi_nand_feature_op(spi, GET_OP, FEATURE_ADDR, 0);
+ FMC_PR(PM_DBG, "\t|-Get feature status[%#x]: %#x\n", FEATURE_ADDR,
+ reg);
+ if (reg & FEATURE_ECC_ENABLE) {
+ reg &= ~FEATURE_ECC_ENABLE;
+ spi_nand_feature_op(spi, SET_OP, FEATURE_ADDR, reg);
+ FMC_PR(PM_DBG, "\t|-Set [%#x]FT: %#x\n", FEATURE_ADDR, reg);
+
+ spi->driver->wait_ready(spi);
+
+ reg = spi_nand_feature_op(spi, GET_OP, FEATURE_ADDR, 0);
+ FMC_PR(PM_DBG, "\t|-Check internal ECC disable result: %#x\n",
+ reg);
+ if (reg & FEATURE_ECC_ENABLE)
+ DB_MSG("Error: Chip internal ECC disable failed!\n");
+ }
+}
+/*****************************************************************************/
+#endif /* CONFIG_PM */
diff --git a/drivers/mtd/nand/hifmc100_nand/Kconfig b/drivers/mtd/nand/hifmc100_nand/Kconfig
new file mode 100644
index 0000000..7775208
--- /dev/null
+++ b/drivers/mtd/nand/hifmc100_nand/Kconfig
@@ -0,0 +1,50 @@
+#
+# drivers/mtd/nand/hifmc100_nand/Kconfig
+# add by hisilicon 2017.10.26
+#
+
+menuconfig MTD_NAND_HIFMC100
+ bool "Hisilicon Flash Memory Controller v100 Nand devices support"
+ depends on MFD_HISI_FMC && !MTD_SPI_NAND_HISI_BVT
+ select MISC_FILESYSTEMS
+ select MTD_BLOCK
+ select YAFFS_FS
+ select YAFFS_YAFFS2
+ help
+ Hisilicon Flash Memory Controller version 100 is called hifmc100 for
+ short. The controller support DMA transfers while reading or writing
+ the Nand flash.
+
+if MTD_NAND_HIFMC100
+
+config HIFMC100_NAND_EDO_MODE
+ bool "the Extended Data Out(EDO) mode"
+ help
+ In Extended data out (EDO), a new data cycle is started while the data
+ output of the previous cycle is still active. This process of cycle
+ overlapping, called pipelining, increases processing speed by about
+ 10 nanoseconds per cycle,increasing computer performance by about 5
+ percent compared to performance using FMP.
+
+config RW_H_WIDTH
+ int "the width of Read/Write HIGH Hold Time (0 to 15)"
+ range 0 15
+ default 10 if ARCH_HI3559AV100
+ help
+ the Read/Write HIGH Hold Time of nand flash
+
+config R_L_WIDTH
+ int "the Read pulse width (0 to 15)"
+ range 0 15
+ default 10 if ARCH_HI3559AV100
+ help
+ the Read/Write LOW Hold Time of nand flash
+
+config W_L_WIDTH
+ int "the Write pulse width (0 to 15)"
+ range 0 15
+ default 10 if ARCH_HI3559AV100
+ help
+ the Read/Write LOW Hold Time of nand flash
+
+endif # End of MTD_NAND_HIFMC100
diff --git a/drivers/mtd/nand/hifmc100_nand/Makefile b/drivers/mtd/nand/hifmc100_nand/Makefile
new file mode 100644
index 0000000..623363c
--- /dev/null
+++ b/drivers/mtd/nand/hifmc100_nand/Makefile
@@ -0,0 +1,26 @@
+#
+# The Flash Memory Controller v100 Device Driver for hisilicon
+#
+# Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2 of the License, or (at your
+# option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+#
+
+#
+# drivers/mtd/nand/hifmc100_nand/Makefile
+#
+
+obj-y += hifmc_nand_spl_ids.o
+obj-y += hifmc100_nand.o hifmc100_nand_os.o
diff --git a/drivers/mtd/nand/hifmc100_nand/hifmc100_nand.c b/drivers/mtd/nand/hifmc100_nand/hifmc100_nand.c
new file mode 100644
index 0000000..54dddeb
--- /dev/null
+++ b/drivers/mtd/nand/hifmc100_nand/hifmc100_nand.c
@@ -0,0 +1,1127 @@
+/*
+ * The Flash Memory Controller v100 Device Driver for hisilicon
+ *
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "../hinfc_gen.h"
+#include "hifmc100_nand_os.h"
+#include "hifmc100_nand.h"
+
+#include
+/*****************************************************************************/
+static void hifmc100_dma_transfer(struct hifmc_host *host, int todev)
+{
+ unsigned int reg = (unsigned int)host->dma_buffer;
+ char *op = todev ? "write" : "read";
+
+ FMC_PR(DMA_DB, "\t\t *-Start %s page dma transfer\n", op);
+
+ hifmc_writel(host, FMC_DMA_SADDR_D0, reg);
+ FMC_PR(DMA_DB, "\t\t |-Set ADDR0[%#x]%#x\n", FMC_DMA_SADDR_D0, reg);
+
+#ifdef CONFIG_64BIT
+ reg = (host->dma_buffer & FMC_DMA_SADDRH_MASK) >> 32;
+ hifmc_writel(host, FMC_DMA_SADDRH_D0, reg);
+ FMC_PR(DMA_DB, "\t\t |-Set ADDRH0[%#x]%#x\n", FMC_DMA_SADDRH_D0, reg);
+#endif
+
+ reg += FMC_DMA_ADDR_OFFSET;
+ hifmc_writel(host, FMC_DMA_SADDR_D1, reg);
+ FMC_PR(DMA_DB, "\t\t |-Set ADDR1[%#x]%#x\n", FMC_DMA_SADDR_D1, reg);
+
+ reg += FMC_DMA_ADDR_OFFSET;
+ hifmc_writel(host, FMC_DMA_SADDR_D2, reg);
+ FMC_PR(DMA_DB, "\t\t |-Set ADDR2[%#x]%#x\n", FMC_DMA_SADDR_D2, reg);
+
+ reg += FMC_DMA_ADDR_OFFSET;
+ hifmc_writel(host, FMC_DMA_SADDR_D3, reg);
+ FMC_PR(DMA_DB, "\t\t |-Set ADDR3[%#x]%#x\n", FMC_DMA_SADDR_D3, reg);
+
+ reg = host->dma_oob;
+ hifmc_writel(host, FMC_DMA_SADDR_OOB, reg);
+ FMC_PR(DMA_DB, "\t\t |-Set OOB[%#x]%#x\n", FMC_DMA_SADDR_OOB, reg);
+
+#ifdef CONFIG_64BIT
+ reg = (host->dma_oob & FMC_DMA_SADDRH_MASK) >> 32;
+ hifmc_writel(host, FMC_DMA_SADDRH_OOB, reg);
+ FMC_PR(DMA_DB, "\t\t |-Set ADDRH0[%#x]%#x\n", FMC_DMA_SADDRH_OOB, reg);
+#endif
+
+ if (host->ecctype == NAND_ECC_0BIT) {
+ hifmc_writel(host, FMC_DMA_LEN, FMC_DMA_LEN_SET(host->oobsize));
+ FMC_PR(DMA_DB, "\t\t |-Set LEN[%#x]%#x\n", FMC_DMA_LEN, reg);
+ }
+ reg = FMC_OP_READ_DATA_EN | FMC_OP_WRITE_DATA_EN;
+ hifmc_writel(host, FMC_OP, reg);
+ FMC_PR(DMA_DB, "\t\t |-Set OP[%#x]%#x\n", FMC_OP, reg);
+
+ reg = FMC_DMA_AHB_CTRL_DMA_PP_EN
+ | FMC_DMA_AHB_CTRL_BURST16_EN
+ | FMC_DMA_AHB_CTRL_BURST8_EN
+ | FMC_DMA_AHB_CTRL_BURST4_EN;
+ hifmc_writel(host, FMC_DMA_AHB_CTRL, reg);
+ FMC_PR(DMA_DB, "\t\t |-Set AHBCTRL[%#x]%#x\n", FMC_DMA_AHB_CTRL, reg);
+
+ reg = OP_CFG_FM_CS(host->cmd_op.cs)
+ | OP_CFG_ADDR_NUM(host->addr_cycle);
+ hifmc_writel(host, FMC_OP_CFG, reg);
+ FMC_PR(DMA_DB, "\t\t |-Set OP_CFG[%#x]%#x\n", FMC_OP_CFG, reg);
+
+ reg = OP_CTRL_DMA_OP_READY;
+ if (todev)
+ reg |= OP_CTRL_RW_OP(todev);
+ hifmc_writel(host, FMC_OP_CTRL, reg);
+ FMC_PR(DMA_DB, "\t\t |-Set OP_CTRL[%#x]%#x\n", FMC_OP_CTRL, reg);
+
+ FMC_DMA_WAIT_CPU_FINISH(host);
+
+ FMC_PR(DMA_DB, "\t\t *-End %s page dma transfer\n", op);
+
+ return;
+}
+
+/*****************************************************************************/
+static void hifmc100_send_cmd_write(struct hifmc_host *host)
+{
+ unsigned int reg;
+
+ FMC_PR(WR_DBG, "\t|*-Start send page programme cmd\n");
+
+ if (*host->bbm != 0xFF && *host->bbm != 0x00)
+ pr_info("WARNING: attempt to write an invalid bbm. " \
+ "page: 0x%08x, mark: 0x%02x,\n",
+ GET_PAGE_INDEX(host), *host->bbm);
+
+ host->enable_ecc_randomizer(host, ENABLE, ENABLE);
+
+ reg = host->addr_value[1];
+ hifmc_writel(host, FMC_ADDRH, reg);
+ FMC_PR(WR_DBG, "\t||-Set ADDRH[%#x]%#x\n", FMC_ADDRH, reg);
+
+ reg = host->addr_value[0] & 0xffff0000;
+ hifmc_writel(host, FMC_ADDRL, reg);
+ FMC_PR(WR_DBG, "\t||-Set ADDRL[%#x]%#x\n", FMC_ADDRL, reg);
+
+ reg = FMC_CMD_CMD2(NAND_CMD_PAGEPROG) | FMC_CMD_CMD1(NAND_CMD_SEQIN);
+ hifmc_writel(host, FMC_CMD, reg);
+ FMC_PR(WR_DBG, "\t||-Set CMD[%#x]%#x\n", FMC_CMD, reg);
+
+ *host->epm = 0x0000;
+
+ hifmc100_dma_transfer(host, RW_OP_WRITE);
+
+ FMC_PR(WR_DBG, "\t|*-End send page read cmd\n");
+}
+
+/*****************************************************************************/
+static void hifmc100_send_cmd_read(struct hifmc_host *host)
+{
+ unsigned int reg;
+
+ FMC_PR(RD_DBG, "\t*-Start send page read cmd\n");
+
+ if ((host->addr_value[0] == host->cache_addr_value[0])
+ && (host->addr_value[1] == host->cache_addr_value[1])) {
+ FMC_PR(RD_DBG, "\t*-Cache hit! addr1[%#x], addr0[%#x]\n",
+ host->addr_value[1], host->addr_value[0]);
+ return;
+ }
+
+ host->page_status = 0;
+
+ host->enable_ecc_randomizer(host, ENABLE, ENABLE);
+
+ reg = FMC_INT_CLR_ALL;
+ hifmc_writel(host, FMC_INT_CLR, reg);
+ FMC_PR(RD_DBG, "\t|-Set INT_CLR[%#x]%#x\n", FMC_INT_CLR, reg);
+
+ reg = host->nand_cfg;
+ hifmc_writel(host, FMC_CFG, reg);
+ FMC_PR(RD_DBG, "\t|-Set CFG[%#x]%#x\n", FMC_CFG, reg);
+
+ reg = host->addr_value[1];
+ hifmc_writel(host, FMC_ADDRH, reg);
+ FMC_PR(RD_DBG, "\t|-Set ADDRH[%#x]%#x\n", FMC_ADDRH, reg);
+
+ reg = host->addr_value[0] & 0xffff0000;
+ hifmc_writel(host, FMC_ADDRL, reg);
+ FMC_PR(RD_DBG, "\t|-Set ADDRL[%#x]%#x\n", FMC_ADDRL, reg);
+
+ reg = FMC_CMD_CMD2(NAND_CMD_READSTART) | FMC_CMD_CMD1(NAND_CMD_READ0);
+ hifmc_writel(host, FMC_CMD, reg);
+ FMC_PR(RD_DBG, "\t|-Set CMD[%#x]%#x\n", FMC_CMD, reg);
+
+ hifmc100_dma_transfer(host, RW_OP_READ);
+
+ if (hifmc_readl(host, FMC_INT) & FMC_INT_ERR_INVALID)
+ host->page_status |= HIFMC100_PS_UC_ECC;
+
+ host->cache_addr_value[0] = host->addr_value[0];
+ host->cache_addr_value[1] = host->addr_value[1];
+
+ FMC_PR(RD_DBG, "\t*-End send page read cmd\n");
+}
+
+/*****************************************************************************/
+static void hifmc100_send_cmd_erase(struct hifmc_host *host)
+{
+ unsigned int reg;
+
+ FMC_PR(ER_DBG, "\t *-Start send cmd erase\n");
+
+ /* Don't case the read retry config */
+ host->enable_ecc_randomizer(host, DISABLE, DISABLE);
+
+ reg = host->addr_value[0];
+ hifmc_writel(host, FMC_ADDRL, reg);
+ FMC_PR(ER_DBG, "\t |-Set ADDRL[%#x]%#x\n", FMC_ADDRL, reg);
+
+ reg = FMC_CMD_CMD2(NAND_CMD_ERASE2) | FMC_CMD_CMD1(NAND_CMD_ERASE1);
+ hifmc_writel(host, FMC_CMD, reg);
+ FMC_PR(ER_DBG, "\t |-Set CMD[%#x]%#x\n", FMC_CMD, reg);
+
+ reg = OP_CFG_FM_CS(host->cmd_op.cs)
+ | OP_CFG_ADDR_NUM(host->addr_cycle);
+ hifmc_writel(host, FMC_OP_CFG, reg);
+ FMC_PR(ER_DBG, "\t |-Set OP_CFG[%#x]%#x\n", FMC_OP_CFG, reg);
+
+ /* need to config WAIT_READY_EN */
+ reg = FMC_OP_WAIT_READY_EN
+ | FMC_OP_CMD1_EN
+ | FMC_OP_CMD2_EN
+ | FMC_OP_ADDR_EN
+ | FMC_OP_REG_OP_START;
+ hifmc_writel(host, FMC_OP, reg);
+ FMC_PR(ER_DBG, "\t |-Set OP[%#x]%#x\n", FMC_OP, reg);
+
+ FMC_CMD_WAIT_CPU_FINISH(host);
+
+ FMC_PR(ER_DBG, "\t |*-End send cmd erase\n");
+}
+
+/*****************************************************************************/
+static void hifmc100_ecc_randomizer(struct hifmc_host *host, int ecc_en,
+ int randomizer_en)
+{
+ unsigned int old_reg, reg, change = 0;
+ char *ecc_op = ecc_en ? "Quit" : "Enter";
+ char *rand_op = randomizer_en ? "Enable" : "Disable";
+
+ if (IS_NAND_RANDOM(host)) {
+ reg = old_reg = hifmc_readl(host, FMC_GLOBAL_CFG);
+ if (randomizer_en)
+ reg |= FMC_GLOBAL_CFG_RANDOMIZER_EN;
+ else
+ reg &= ~FMC_GLOBAL_CFG_RANDOMIZER_EN;
+
+ if (old_reg != reg) {
+ FMC_PR(EC_DBG, "\t |*-Start %s randomizer\n", rand_op);
+ FMC_PR(EC_DBG, "\t ||-Get global CFG[%#x]%#x\n",
+ FMC_GLOBAL_CFG, old_reg);
+ hifmc_writel(host, FMC_GLOBAL_CFG, reg);
+ FMC_PR(EC_DBG, "\t ||-Set global CFG[%#x]%#x\n",
+ FMC_GLOBAL_CFG, reg);
+ change++;
+ }
+ }
+
+ old_reg = hifmc_readl(host, FMC_CFG);
+ reg = (ecc_en ? host->nand_cfg : host->nand_cfg_ecc0);
+
+ if (old_reg != reg) {
+ FMC_PR(EC_DBG, "\t |%s-Start %s ECC0 mode\n", change ? "|":"*",
+ ecc_op);
+ FMC_PR(EC_DBG, "\t ||-Get CFG[%#x]%#x\n", FMC_CFG, old_reg);
+ hifmc_writel(host, FMC_CFG, reg);
+ FMC_PR(EC_DBG, "\t ||-Set CFG[%#x]%#x\n", FMC_CFG, reg);
+ change++;
+ }
+
+ if (EC_DBG && change)
+ FMC_PR(EC_DBG, "\t |*-End randomizer and ECC0 mode config\n");
+}
+
+/*****************************************************************************/
+static void hifmc100_send_cmd_status(struct hifmc_host *host)
+{
+ unsigned int regval;
+
+ host->enable_ecc_randomizer(host, DISABLE, DISABLE);
+
+ regval = OP_CFG_FM_CS(host->cmd_op.cs);
+ hifmc_writel(host, FMC_OP_CFG, regval);
+
+ regval = FMC_OP_READ_STATUS_EN | FMC_OP_REG_OP_START;
+ hifmc_writel(host, FMC_OP, regval);
+
+ FMC_CMD_WAIT_CPU_FINISH(host);
+}
+
+/*****************************************************************************/
+static void hifmc100_send_cmd_readid(struct hifmc_host *host)
+{
+ unsigned int reg;
+
+ FMC_PR(BT_DBG, "\t *-Start read nand flash ID\n");
+
+ host->enable_ecc_randomizer(host, DISABLE, DISABLE);
+
+ reg = FMC_DATA_NUM_CNT(host->cmd_op.data_no);
+ hifmc_writel(host, FMC_DATA_NUM, reg);
+ FMC_PR(BT_DBG, "\t |-Set DATA_NUM[%#x]%#x\n", FMC_DATA_NUM, reg);
+
+ reg = FMC_CMD_CMD1(NAND_CMD_READID);
+ hifmc_writel(host, FMC_CMD, reg);
+ FMC_PR(BT_DBG, "\t |-Set CMD[%#x]%#x\n", FMC_CMD, reg);
+
+ reg = 0;
+ hifmc_writel(host, FMC_ADDRL, reg);
+ FMC_PR(BT_DBG, "\t |-Set ADDRL[%#x]%#x\n", FMC_ADDRL, reg);
+
+ reg = OP_CFG_FM_CS(host->cmd_op.cs)
+ | OP_CFG_ADDR_NUM(READ_ID_ADDR_NUM);
+ hifmc_writel(host, FMC_OP_CFG, reg);
+ FMC_PR(BT_DBG, "\t |-Set OP_CFG[%#x]%#x\n", FMC_OP_CFG, reg);
+
+ reg = FMC_OP_CMD1_EN
+ | FMC_OP_ADDR_EN
+ | FMC_OP_READ_DATA_EN
+ | FMC_OP_REG_OP_START;
+ hifmc_writel(host, FMC_OP, reg);
+ FMC_PR(BT_DBG, "\t |-Set OP[%#x]%#x\n", FMC_OP, reg);
+
+ host->addr_cycle = 0x0;
+
+ FMC_CMD_WAIT_CPU_FINISH(host);
+
+ FMC_PR(BT_DBG, "\t *-End read nand flash ID\n");
+}
+
+/*****************************************************************************/
+static void hifmc100_send_cmd_reset(struct hifmc_host *host)
+{
+ unsigned int reg;
+
+ FMC_PR(BT_DBG, "\t *-Start reset nand flash\n");
+
+ reg = FMC_CMD_CMD1(NAND_CMD_RESET);
+ hifmc_writel(host, FMC_CMD, reg);
+ FMC_PR(BT_DBG, "\t |-Set CMD[%#x]%#x\n", FMC_CMD, reg);
+
+ reg = OP_CFG_FM_CS(host->cmd_op.cs);
+ hifmc_writel(host, FMC_OP_CFG, reg);
+ FMC_PR(BT_DBG, "\t |-Set OP_CFG[%#x]%#x\n", FMC_OP_CFG, reg);
+
+ reg = FMC_OP_CMD1_EN
+ | FMC_OP_WAIT_READY_EN
+ | FMC_OP_REG_OP_START;
+ hifmc_writel(host, FMC_OP, reg);
+ FMC_PR(BT_DBG, "\t |-Set OP[%#x]%#x\n", FMC_OP, reg);
+
+ FMC_CMD_WAIT_CPU_FINISH(host);
+
+ FMC_PR(BT_DBG, "\t *-End reset nand flash\n");
+}
+
+/*****************************************************************************/
+static unsigned char hifmc100_read_byte(struct mtd_info *mtd)
+{
+ unsigned char value = 0;
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hifmc_host *host = chip->priv;
+
+ if (host->cmd_op.l_cmd == NAND_CMD_READID) {
+ value = hifmc_readb((void __iomem *)(chip->IO_ADDR_R + host->offset));
+ host->offset++;
+ if (host->cmd_op.data_no == host->offset)
+ host->cmd_op.l_cmd = 0;
+ return value;
+ }
+
+ if (host->cmd_op.cmd == NAND_CMD_STATUS) {
+ value = hifmc_readl(host, FMC_STATUS);
+ if (host->cmd_op.l_cmd == NAND_CMD_ERASE1)
+ FMC_PR(ER_DBG, "\t*-Erase WP status: %#x\n", value);
+ if (host->cmd_op.l_cmd == NAND_CMD_PAGEPROG)
+ FMC_PR(WR_DBG, "\t*-Write WP status: %#x\n", value);
+ return value;
+ }
+
+ if (host->cmd_op.l_cmd == NAND_CMD_READOOB) {
+ value = hifmc_readb((void __iomem *)(host->buffer + host->pagesize
+ + host->offset));
+ host->offset++;
+ return value;
+ }
+
+ host->offset++;
+
+ return hifmc_readb((void __iomem *)(host->buffer + host->column \
+ + host->offset - 1));
+}
+
+/*****************************************************************************/
+static unsigned short hifmc100_read_word(struct mtd_info *mtd)
+{
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hifmc_host *host = chip->priv;
+
+ host->offset += 2;
+ return hifmc_readw(host->buffer + host->column + host->offset - 2);
+}
+
+/*****************************************************************************/
+static void hifmc100_write_buf(struct mtd_info *mtd,
+ const u_char *buf, int len)
+{
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hifmc_host *host = chip->priv;
+
+#ifdef HIFMC100_NAND_SUPPORT_REG_WRITE
+ if (buf == chip->oob_poi)
+ memcpy((char *)host->iobase + host->pagesize, buf, len);
+ else
+ memcpy((char *)host->iobase, buf, len);
+#else
+ if (buf == chip->oob_poi)
+ memcpy((char *)host->buffer + host->pagesize, buf, len);
+ else
+ memcpy((char *)host->buffer, buf, len);
+#endif
+ return;
+}
+
+/*****************************************************************************/
+static void hifmc100_ecc_err_num_count(struct mtd_info *mtd,
+ u_int ecc_st, u_int reg)
+{
+ u_char err_num;
+
+ if (ecc_st > 4)
+ ecc_st = 4;
+
+ while (ecc_st) {
+ err_num = GET_ECC_ERR_NUM(--ecc_st, reg);
+ if (err_num == 0xff)
+ mtd->ecc_stats.failed++;
+ else
+ mtd->ecc_stats.corrected += err_num;
+ }
+}
+
+/*****************************************************************************/
+static void hifmc100_read_buf(struct mtd_info *mtd, u_char *buf, int len)
+{
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hifmc_host *host = chip->priv;
+
+#ifdef HIFMC100_NAND_SUPPORT_REG_READ
+ if (buf == chip->oob_poi)
+ memcpy(buf, (char *)host->iobase + host->pagesize, len);
+ else
+ memcpy(buf, (char *)host->iobase, len);
+#else
+ if (buf == chip->oob_poi)
+ memcpy(buf, (char *)host->buffer + host->pagesize, len);
+ else
+ memcpy(buf, (char *)host->buffer, len);
+#endif
+ if (buf != chip->oob_poi) {
+ u_int reg, ecc_step = host->pagesize >> 10;
+
+ /* 2K or 4K or 8K(1) or 16K(1-1) pagesize */
+ reg = hifmc_readl(host, HIFMC100_ECC_ERR_NUM0_BUF0);
+ hifmc100_ecc_err_num_count(mtd, ecc_step, reg);
+
+ if (ecc_step > 4) {
+ /* 8K(2) or 16K(1-2) pagesize */
+ reg = hifmc_readl(host, HIFMC100_ECC_ERR_NUM1_BUF0);
+ hifmc100_ecc_err_num_count(mtd, ecc_step, reg);
+ if (ecc_step > 8) {
+ /* 16K(2-1) pagesize */
+ reg = hifmc_readl(host,
+ HIFMC100_ECC_ERR_NUM0_BUF1);
+ hifmc100_ecc_err_num_count(mtd, ecc_step, reg);
+ /* 16K(2-2) pagesize */
+ reg = hifmc_readl(host,
+ HIFMC100_ECC_ERR_NUM1_BUF1);
+ hifmc100_ecc_err_num_count(mtd, ecc_step, reg);
+ }
+ }
+ }
+
+ return;
+}
+
+/*****************************************************************************/
+static void hifmc100_select_chip(struct mtd_info *mtd, int chipselect)
+{
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hifmc_host *host = chip->priv;
+
+ if (chipselect < 0)
+ return;
+
+ if (chipselect > CONFIG_HIFMC100_MAX_NAND_CHIP)
+ DB_BUG("Error: Invalid chip select: %d\n", chipselect);
+
+ host->cmd_op.cs = chipselect;
+ if (host->mtd != mtd)
+ host->mtd = mtd;
+
+ switch (chip->state) {
+ case FL_ERASING:
+ host->cmd_op.l_cmd = NAND_CMD_ERASE1;
+ if (ER_DBG)
+ pr_info("\n");
+ FMC_PR(ER_DBG, "\t*-Erase chip: %d\n", chipselect);
+ break;
+ case FL_WRITING:
+ host->cmd_op.l_cmd = NAND_CMD_PAGEPROG;
+ if (WR_DBG)
+ pr_info("\n");
+ FMC_PR(WR_DBG, "\t*-Write chip: %d\n", chipselect);
+ break;
+ case FL_READING:
+ host->cmd_op.l_cmd = NAND_CMD_READ0;
+ if (RD_DBG)
+ pr_info("\n");
+ FMC_PR(RD_DBG, "\t*-Read chip: %d\n", chipselect);
+ break;
+ default:
+ break;
+ }
+}
+
+/*****************************************************************************/
+static void hifmc100_cmd_ctrl(struct mtd_info *mtd, int dat, unsigned ctrl)
+{
+ unsigned char cmd;
+ int is_cache_invalid = 1;
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hifmc_host *host = chip->priv;
+
+ if (ctrl & NAND_ALE) {
+ unsigned int addr_value = 0;
+ unsigned int addr_offset = 0;
+
+ if (ctrl & NAND_CTRL_CHANGE) {
+ host->addr_cycle = 0x0;
+ host->addr_value[0] = 0x0;
+ host->addr_value[1] = 0x0;
+ }
+ addr_offset = host->addr_cycle << 3;
+
+ if (host->addr_cycle >= HIFMC100_ADDR_CYCLE_MASK) {
+ addr_offset = (host->addr_cycle -
+ HIFMC100_ADDR_CYCLE_MASK) << 3;
+ addr_value = 1;
+ }
+
+ host->addr_value[addr_value] |=
+ ((dat & 0xff) << addr_offset);
+
+ host->addr_cycle++;
+ }
+
+ if ((ctrl & NAND_CLE) && (ctrl & NAND_CTRL_CHANGE)) {
+ cmd = dat & 0xff;
+ host->cmd_op.cmd = cmd;
+ switch (cmd) {
+ case NAND_CMD_PAGEPROG:
+ host->offset = 0;
+ host->send_cmd_pageprog(host);
+ break;
+
+ case NAND_CMD_READSTART:
+ is_cache_invalid = 0;
+ if (host->addr_value[0] == host->pagesize)
+ host->cmd_op.l_cmd = NAND_CMD_READOOB;
+ host->send_cmd_readstart(host);
+ break;
+
+ case NAND_CMD_ERASE2:
+ host->cmd_op.l_cmd = cmd;
+ host->send_cmd_erase(host);
+ break;
+
+ case NAND_CMD_READID:
+ memset((u_char *)(chip->IO_ADDR_R), 0, MAX_NAND_ID_LEN);
+ host->cmd_op.l_cmd = cmd;
+ host->cmd_op.data_no = MAX_NAND_ID_LEN;
+ host->send_cmd_readid(host);
+ break;
+
+ case NAND_CMD_STATUS:
+ host->send_cmd_status(host);
+ break;
+
+ case NAND_CMD_READ0:
+ host->cmd_op.l_cmd = cmd;
+ break;
+
+ case NAND_CMD_RESET:
+ host->send_cmd_reset(host);
+ break;
+
+ case NAND_CMD_SEQIN:
+ case NAND_CMD_ERASE1:
+ default:
+ break;
+ }
+ }
+
+ /* pass pagesize and ecctype to kernel when startup. */
+ host->enable_ecc_randomizer(host, ENABLE, ENABLE);
+
+ if ((dat == NAND_CMD_NONE) && host->addr_cycle) {
+ if (host->cmd_op.cmd == NAND_CMD_SEQIN
+ || host->cmd_op.cmd == NAND_CMD_READ0
+ || host->cmd_op.cmd == NAND_CMD_READID) {
+ host->offset = 0x0;
+ host->column = (host->addr_value[0] & 0xffff);
+ }
+ }
+
+ if (is_cache_invalid) {
+ host->cache_addr_value[0] = ~0;
+ host->cache_addr_value[1] = ~0;
+ }
+}
+
+/*****************************************************************************/
+static int hifmc100_dev_ready(struct mtd_info *mtd)
+{
+ return 0x1;
+}
+
+/*****************************************************************************/
+/*
+ * 'host->epm' only use the first oobfree[0] field, it looks very simple, But...
+ */
+static int hifmc_ooblayout_ecc_default(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *oobregion)
+{
+ if (section)
+ return -ERANGE;
+
+ oobregion->length = 32;
+ oobregion->offset = 32;
+
+ return 0;
+}
+
+static int hifmc_ooblayout_free_default(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *oobregion)
+{
+ if (section)
+ return -ERANGE;
+
+ oobregion->length = 30;
+ oobregion->offset = 2;
+
+ return 0;
+}
+
+static struct mtd_ooblayout_ops hifmc_ooblayout_default_ops = {
+ .ecc = hifmc_ooblayout_ecc_default,
+ .free = hifmc_ooblayout_free_default,
+};
+
+#ifdef CONFIG_HISI_NAND_FS_MAY_NO_YAFFS2
+static int hifmc_ooblayout_ecc_4k16bit(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *oobregion)
+{
+ if (section)
+ return -ERANGE;
+
+ oobregion->length = 14;
+ oobregion->offset = 14;
+
+ return 0;
+}
+
+static int hifmc_ooblayout_free_4k16bit(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *oobregion)
+{
+ if (section)
+ return -ERANGE;
+
+ oobregion->length = 14;
+ oobregion->offset = 2;
+
+ return 0;
+}
+tatic struct mtd_ooblayout_ops hifmc_ooblayout_4k16bit_ops = {
+ .ecc = hifmc_ooblayout_ecc_4k16bit,
+ .free = hifmc_ooblayout_free_4k16bit,
+};
+
+static int hifmc_ooblayout_ecc_2k16bit(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *oobregion)
+{
+ if (section)
+ return -ERANGE;
+
+ oobregion->length = 6;
+ oobregion->offset = 6;
+
+ return 0;
+}
+
+static int hifmc_ooblayout_free_2k16bit(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *oobregion)
+{
+ if (section)
+ return -ERANGE;
+
+ oobregion->length = 6;
+ oobregion->offset = 2;
+
+ return 0;
+}
+
+static struct mtd_ooblayout_ops hifmc_ooblayout_2k16bit_ops = {
+ .ecc = hifmc_ooblayout_ecc_2k16bit,
+ .free = hifmc_ooblayout_free_2k16bit,
+};
+#endif
+/*****************************************************************************/
+/* ecc/pagesize get from NAND controller */
+static struct nand_config_info hifmc100_nand_hw_auto_config_table[] = {
+ {NAND_PAGE_16K, NAND_ECC_64BIT, 64, 1824/*1824*/, &hifmc_ooblayout_default_ops},
+ {NAND_PAGE_16K, NAND_ECC_40BIT, 40, 1200/*1152*/, &hifmc_ooblayout_default_ops},
+ {NAND_PAGE_16K, NAND_ECC_0BIT, 0, 32 , &hifmc_ooblayout_default_ops},
+
+ {NAND_PAGE_8K, NAND_ECC_64BIT, 64, 928 /*928*/, &hifmc_ooblayout_default_ops},
+ {NAND_PAGE_8K, NAND_ECC_40BIT, 40, 600 /*592*/, &hifmc_ooblayout_default_ops},
+ {NAND_PAGE_8K, NAND_ECC_24BIT, 24, 368 /*368*/, &hifmc_ooblayout_default_ops},
+ {NAND_PAGE_8K, NAND_ECC_0BIT, 0, 32, &hifmc_ooblayout_default_ops},
+
+ {NAND_PAGE_4K, NAND_ECC_24BIT, 24, 200 /*200*/, &hifmc_ooblayout_default_ops},
+#ifdef CONFIG_HISI_NAND_FS_MAY_NO_YAFFS2
+ {NAND_PAGE_4K, NAND_ECC_16BIT, 16, 128 /*128*/, &hifmc_ooblayout_4k16bit_ops},
+#endif
+ {NAND_PAGE_4K, NAND_ECC_8BIT, 8, 128 /*88*/, &hifmc_ooblayout_default_ops},
+ {NAND_PAGE_4K, NAND_ECC_0BIT, 0, 32, &hifmc_ooblayout_default_ops},
+
+ {NAND_PAGE_2K, NAND_ECC_24BIT, 24, 128 /*116*/, &hifmc_ooblayout_default_ops},
+#ifdef CONFIG_HISI_NAND_FS_MAY_NO_YAFFS2
+ {NAND_PAGE_2K, NAND_ECC_16BIT, 16, 64 /*64*/, &hifmc_ooblayout_2k16bit_ops},
+#endif
+ {NAND_PAGE_2K, NAND_ECC_8BIT, 8, 64 /*60*/, &hifmc_ooblayout_default_ops},
+ {NAND_PAGE_2K, NAND_ECC_0BIT, 0, 32, &hifmc_ooblayout_default_ops},
+
+ {0, 0, 0, 0, NULL},
+};
+
+/*****************************************************************************/
+/*
+ * 0 - This NAND NOT support randomizer
+ * 1 - This NAND support randomizer.
+ */
+static int hifmc100_nand_support_randomizer(u_int pageisze, u_int ecctype)
+{
+ switch (pageisze) {
+ case _8K:
+ return (ecctype >= NAND_ECC_24BIT && ecctype <= NAND_ECC_80BIT);
+ case _16K:
+ return (ecctype >= NAND_ECC_40BIT && ecctype <= NAND_ECC_80BIT);
+ case _32K:
+ return (ecctype >= NAND_ECC_40BIT && ecctype <= NAND_ECC_80BIT);
+ default:
+ return 0;
+ }
+}
+
+/*****************************************************************************/
+/* used the best correct arithmetic. */
+static struct nand_config_info *hifmc100_get_config_type_info(
+ struct mtd_info *mtd, struct nand_dev_t *nand_dev)
+{
+ struct nand_config_info *best = NULL;
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hifmc_host *host = chip->priv;
+ struct nand_config_info *info = hifmc100_nand_hw_auto_config_table;
+
+ nand_dev->start_type = "Auto";
+ nand_dev->flags |= (IS_NANDC_HW_AUTO(host) | IS_NANDC_CONFIG_DONE(host));
+
+ for (; info->ooblayout_ops; info++) {
+ if (match_page_type_to_size(info->pagetype) != mtd->writesize)
+ continue;
+
+ if (mtd->oobsize < info->oobsize)
+ continue;
+
+ if (!best || (best->ecctype < info->ecctype))
+ best = info;
+ }
+
+ return best;
+}
+
+/*****************************************************************************/
+static unsigned int hifmc100_get_ecc_reg(struct hifmc_host *host,
+ struct nand_config_info *info, struct nand_dev_t *nand_dev)
+{
+ host->ecctype = info->ecctype;
+ FMC_PR(BT_DBG, "\t |-Save best EccType %d(%s)\n", host->ecctype,
+ match_ecc_type_to_str(info->ecctype));
+
+ nand_dev->ecctype = host->ecctype;
+
+ return FMC_CFG_ECC_TYPE(match_ecc_type_to_reg(info->ecctype));
+}
+
+/*****************************************************************************/
+static unsigned int hifmc100_get_page_reg(struct hifmc_host *host,
+ struct nand_config_info *info)
+{
+ host->pagesize = match_page_type_to_size(info->pagetype);
+ FMC_PR(BT_DBG, "\t |-Save best PageSize %d(%s)\n", host->pagesize,
+ match_page_type_to_str(info->pagetype));
+
+ return FMC_CFG_PAGE_SIZE(match_page_type_to_reg(info->pagetype));
+}
+
+/*****************************************************************************/
+static unsigned int hifmc100_get_block_reg(struct hifmc_host *host,
+ struct nand_config_info *info)
+{
+ unsigned int block_reg = 0, page_per_block;
+ struct mtd_info *mtd = host->mtd;
+
+ host->block_page_mask = ((mtd->erasesize / mtd->writesize) - 1);
+ page_per_block = mtd->erasesize / match_page_type_to_size(info->pagetype);
+ switch (page_per_block) {
+ case 64:
+ block_reg = BLOCK_SIZE_64_PAGE;
+ break;
+ case 128:
+ block_reg = BLOCK_SIZE_128_PAGE;
+ break;
+ case 256:
+ block_reg = BLOCK_SIZE_256_PAGE;
+ break;
+ case 512:
+ block_reg = BLOCK_SIZE_512_PAGE;
+ break;
+ default:
+ DB_MSG("Can't support block %#x and page %#x size\n",
+ mtd->erasesize, mtd->writesize);
+ }
+
+ return FMC_CFG_BLOCK_SIZE(block_reg);
+}
+
+/*****************************************************************************/
+static void hifmc100_set_fmc_cfg_reg(struct hifmc_host *host,
+ struct nand_config_info *type_info, struct nand_dev_t *nand_dev)
+{
+ unsigned int page_reg, ecc_reg, block_reg, reg_fmc_cfg;
+
+ ecc_reg = hifmc100_get_ecc_reg(host, type_info, nand_dev);
+ page_reg = hifmc100_get_page_reg(host, type_info);
+ block_reg = hifmc100_get_block_reg(host, type_info);
+
+ if (hifmc100_nand_support_randomizer(host->pagesize, host->ecctype))
+ host->flags |= IS_NAND_RANDOM(nand_dev);
+
+ /*
+ * Check if hardware enable randomizer PIN, But NAND does not need
+ * randomizer. We will notice user.
+ */
+ if (IS_NAND_RANDOM(host) &&
+ !hifmc100_nand_support_randomizer(host->pagesize, host->ecctype))
+ DB_BUG(ERSTR_HARDWARE
+ "This NAND flash does not support `randomizer`, "
+ "Please don't configure hardware randomizer PIN.");
+
+ /* Save value of FMC_CFG and FMC_CFG_ECC0 to turn on/off ECC */
+ reg_fmc_cfg = hifmc_readl(host, FMC_CFG);
+ reg_fmc_cfg &= ~(PAGE_SIZE_MASK | ECC_TYPE_MASK | BLOCK_SIZE_MASK);
+ reg_fmc_cfg |= ecc_reg | page_reg | block_reg;
+ host->nand_cfg = reg_fmc_cfg;
+ host->nand_cfg_ecc0 = (host->nand_cfg & ~ECC_TYPE_MASK) | ECC_TYPE_0BIT;
+ FMC_PR(BT_DBG, "\t|-Save FMC_CFG[%#x]: %#x and FMC_CFG_ECC0: %#x\n",
+ FMC_CFG, host->nand_cfg, host->nand_cfg_ecc0);
+
+ /* pass pagesize and ecctype to kernel when spiflash startup. */
+ host->enable_ecc_randomizer(host, ENABLE, ENABLE);
+
+ /*
+ * If it want to support the 'read retry' feature, the 'randomizer'
+ * feature must be support first.
+ */
+ host->read_retry = NULL;
+
+ if (host->read_retry && !IS_NAND_RANDOM(host)) {
+ DB_BUG(ERSTR_HARDWARE
+ "This Nand flash need to enable 'randomizer' feature. "
+ "Please configure hardware randomizer PIN.");
+ }
+}
+
+/*****************************************************************************/
+static void hifmc100_set_oob_info(struct mtd_info *mtd,
+ struct nand_config_info *info, struct nand_dev_t *nand_dev)
+{
+ int buffer_len;
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hifmc_host *host = chip->priv;
+ struct mtd_oob_region hifmc_oobregion = {0, 0};
+
+ if (info->ecctype != NAND_ECC_0BIT)
+ mtd->oobsize = info->oobsize;
+ mtd->oobavail = HIFMC100_NAND_OOBSIZE_FOR_YAFFS;
+
+ host->oobsize = mtd->oobsize;
+
+ buffer_len = host->pagesize + host->oobsize;
+ host->buffer = dmam_alloc_coherent(host->dev, buffer_len,
+ &host->dma_buffer, GFP_KERNEL);
+ if (WARN_ON(!host->buffer)) {
+ dev_err(host->dev, "failed to allocate host->buffer\n");
+ return;
+ }
+
+ memset(host->buffer, 0xff, buffer_len);
+ host->dma_oob = host->dma_buffer + host->pagesize;
+
+ host->bbm = (unsigned char *)(host->buffer + host->pagesize
+ + HIFMC100_BAD_BLOCK_POS);
+
+ info->ooblayout_ops->free(mtd, 0, &hifmc_oobregion);
+
+ mtd_set_ooblayout(mtd, info->ooblayout_ops);
+
+ /* EB bits locate in the bottom two of CTRL(30) */
+ host->epm = (u_short *)(host->buffer + host->pagesize
+ + hifmc_oobregion.offset + 28);
+
+#ifdef CONFIG_HISI_NAND_FS_MAY_NO_YAFFS2
+ if (best->ecctype == NAND_ECC_16BIT) {
+ if (host->pagesize == _2K) {
+ /* EB bits locate in the bottom two of CTRL(4) */
+ host->epm = (u_short *)(host->buffer + host->pagesize
+ + hifmc_oobregion.offset + 4);
+ } else if (host->pagesize == _4K) {
+ /* EB bit locate in the bottom two of CTRL(14) */
+ host->epm = (u_short *)(host->buffer + host->pagesize
+ + hifmc_oobregion.offset + 12);
+ }
+ }
+#endif
+}
+/*****************************************************************************/
+static int hifmc100_set_config_info(struct mtd_info *mtd,
+ struct nand_chip *chip, struct nand_dev_t *dev)
+{
+ struct hifmc_host *host = chip->priv;
+ struct nand_dev_t *nand_dev = &g_nand_dev;
+ struct nand_config_info *type_info = NULL;
+
+ FMC_PR(BT_DBG, "\t*-Start config Block Page OOB and Ecc\n");
+
+ type_info = hifmc100_get_config_type_info(mtd, nand_dev);
+ BUG_ON(!type_info);
+
+ FMC_PR(BT_DBG, "\t|-%s Config, PageSize %s EccType %s OobSize %d\n",
+ nand_dev->start_type, nand_page_name(type_info->pagetype),
+ nand_ecc_name(type_info->ecctype), type_info->oobsize);
+
+ /* Set the page_size, ecc_type, block_size of FMC_CFG[0x0] register */
+ hifmc100_set_fmc_cfg_reg(host, type_info, nand_dev);
+
+ hifmc100_set_oob_info(mtd, type_info, nand_dev);
+
+ if (mtd->writesize > NAND_MAX_PAGESIZE
+ || mtd->oobsize > NAND_MAX_OOBSIZE) {
+ DB_BUG(ERSTR_DRIVER
+ "Driver does not support this Nand Flash. Please " \
+ "increase NAND_MAX_PAGESIZE and NAND_MAX_OOBSIZE.\n");
+ }
+
+ /* Some Nand Flash devices have subpage structure */
+ if (mtd->writesize != host->pagesize) {
+ unsigned int shift = 0;
+ unsigned int writesize = mtd->writesize;
+
+ while (writesize > host->pagesize) {
+ writesize >>= 1;
+ shift++;
+ }
+ chip->chipsize = chip->chipsize >> shift;
+ mtd->erasesize = mtd->erasesize >> shift;
+ mtd->writesize = host->pagesize;
+ pr_info("Nand divide into 1/%u\n", (1 << shift));
+ }
+
+ FMC_PR(BT_DBG, "\t*-End config Block Page Oob and Ecc\n");
+
+ return 0;
+}
+
+/*****************************************************************************/
+static void hifmc100_chip_init(struct nand_chip *chip)
+{
+ memset((char *)chip->IO_ADDR_R, 0xff, NAND_BUFFER_LEN);
+
+ chip->read_byte = hifmc100_read_byte;
+ chip->read_word = hifmc100_read_word;
+ chip->write_buf = hifmc100_write_buf;
+ chip->read_buf = hifmc100_read_buf;
+
+ chip->select_chip = hifmc100_select_chip;
+
+ chip->cmd_ctrl = hifmc100_cmd_ctrl;
+ chip->dev_ready = hifmc100_dev_ready;
+
+ chip->chip_delay = FMC_CHIP_DELAY;
+
+ chip->options = NAND_NEED_READRDY | NAND_BROKEN_XD
+ | NAND_SKIP_BBTSCAN;
+
+ chip->ecc.mode = NAND_ECC_NONE;
+}
+
+/*****************************************************************************/
+static int hifmc100_host_init(struct hifmc_host *host)
+{
+ unsigned int reg, flash_type;
+
+ FMC_PR(BT_DBG, "\t *-Start nand host init\n");
+
+ reg = hifmc_readl(host, FMC_CFG);
+ FMC_PR(BT_DBG, "\t |-Read FMC CFG[%#x]%#x\n", FMC_CFG, reg);
+ flash_type = GET_SPI_FLASH_TYPE(reg);
+ if (flash_type != FLASH_TYPE_NAND) {
+ DB_MSG("Error: Flash type isn't Nand flash. reg[%#x]\n", reg);
+ reg |= FMC_CFG_FLASH_SEL(FLASH_TYPE_NAND);
+ FMC_PR(BT_DBG, "\t |-Change flash type to Nand flash\n");
+ }
+
+ if ((reg & FMC_CFG_OP_MODE_MASK) == FMC_CFG_OP_MODE_BOOT) {
+ reg |= FMC_CFG_OP_MODE(FMC_CFG_OP_MODE_NORMAL);
+ FMC_PR(BT_DBG, "\t |-Controller enter normal mode\n");
+ }
+ hifmc_writel(host, FMC_CFG, reg);
+ FMC_PR(BT_DBG, "\t |-Set CFG[%#x]%#x\n", FMC_CFG, reg);
+
+ host->nand_cfg = reg;
+ host->nand_cfg_ecc0 = (reg & ~ECC_TYPE_MASK) | ECC_TYPE_0BIT;
+
+ reg = hifmc_readl(host, FMC_GLOBAL_CFG);
+ FMC_PR(BT_DBG, "\t |-Read global CFG[%#x]%#x\n", FMC_GLOBAL_CFG, reg);
+ if (reg & FMC_GLOBAL_CFG_RANDOMIZER_EN) {
+ host->flags &= ~NAND_RANDOMIZER;
+ FMC_PR(BT_DBG, "\t |-Default disable randomizer\n");
+ reg &= ~FMC_GLOBAL_CFG_RANDOMIZER_EN;
+ hifmc_writel(host, FMC_GLOBAL_CFG, reg);
+ FMC_PR(BT_DBG, "\t |-Set global CFG[%#x]%#x\n", FMC_GLOBAL_CFG, reg);
+ }
+
+#ifdef CONFIG_HIFMC100_NAND_EDO_MODE
+ /* enable EDO node */
+ reg = hifmc_readl(host, FMC_GLOBAL_CFG);
+ hifmc_writel(host, FMC_GLOBAL_CFG, SET_NAND_EDO_MODE_EN(reg));
+#endif
+
+ host->addr_cycle = 0;
+ host->addr_value[0] = 0;
+ host->addr_value[1] = 0;
+ host->cache_addr_value[0] = ~0;
+ host->cache_addr_value[1] = ~0;
+
+ host->send_cmd_pageprog = hifmc100_send_cmd_write;
+ host->send_cmd_status = hifmc100_send_cmd_status;
+ host->send_cmd_readstart = hifmc100_send_cmd_read;
+ host->send_cmd_erase = hifmc100_send_cmd_erase;
+ host->send_cmd_readid = hifmc100_send_cmd_readid;
+ host->send_cmd_reset = hifmc100_send_cmd_reset;
+
+ /*
+ * check if start from nand.
+ * This register REG_SYSSTAT is set in start.S
+ * When start in NAND (Auto), the ECC/PAGESIZE driver don't detect.
+ */
+ host->flags |= NANDC_HW_AUTO;
+
+ if (GET_SYS_BOOT_MODE(reg) == BOOT_FROM_NAND) {
+ host->flags |= NANDC_CONFIG_DONE;
+ FMC_PR(BT_DBG, "\t |-Auto config pagesize and ecctype\n");
+ }
+
+ host->enable_ecc_randomizer = hifmc100_ecc_randomizer;
+
+ FMC_PR(BT_DBG, "\t *-End nand host init\n");
+
+ return 0;
+}
+
+/*****************************************************************************/
+int hifmc100_nand_init(struct nand_chip *chip)
+{
+ struct hifmc_host *host = chip->priv;
+
+ /* enable and set system clock */
+ clk_prepare_enable(host->clk);
+
+ /* fmc ip version check */
+ host->version = hifmc_readl(host, FMC_VERSION);
+ if (host->version != HIFMC_VER_100)
+ return -EFAULT;
+ pr_info("Found Flash Memory Controller v100 Nand Driver\n");
+
+ /* hifmc host init */
+ if (hifmc100_host_init(host)) {
+ DB_MSG("Error: Nand host init failed!\n");
+ return -EFAULT;
+ }
+ host->chip = chip;
+
+ hifmc_writel(host, FMC_PND_PWIDTH_CFG, PWIDTH_CFG_RW_HCNT(CONFIG_RW_H_WIDTH)
+ | PWIDTH_CFG_R_LCNT(CONFIG_R_L_WIDTH)
+ | PWIDTH_CFG_W_LCNT(CONFIG_W_L_WIDTH));
+
+ /* hifmc nand_chip struct init */
+ hifmc100_chip_init(chip);
+
+ hifmc_spl_ids_register();
+ hinfc_param_adjust = hifmc100_set_config_info;
+
+ return 0;
+}
+
+#ifdef CONFIG_PM
+/*****************************************************************************/
+void hifmc100_nand_config(struct hifmc_host *host)
+{
+ /* enable system clock */
+ clk_prepare_enable(host->clk);
+ FMC_PR(PM_DBG, "\t |-enable system clock\n");
+}
+#endif /* CONFIG_PM */
diff --git a/drivers/mtd/nand/hifmc100_nand/hifmc100_nand.h b/drivers/mtd/nand/hifmc100_nand/hifmc100_nand.h
new file mode 100644
index 0000000..9f7bbb9
--- /dev/null
+++ b/drivers/mtd/nand/hifmc100_nand/hifmc100_nand.h
@@ -0,0 +1,164 @@
+/*
+ * The Flash Memory Controller v100 Device Driver for hisilicon
+ *
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#ifndef __HIFMC100_NAND_H__
+#define __HIFMC100_NAND_H__
+
+#include
+
+/******************************************************************************/
+/* These macroes are for debug only, reg option is slower then dma option */
+#undef HIFMC100_NAND_SUPPORT_REG_READ
+/* #define HIFMC100_NAND_SUPPORT_REG_READ */
+
+#undef HIFMC100_NAND_SUPPORT_REG_WRITE
+/* #define HIFMC100_NAND_SUPPORT_REG_WRITE */
+
+/*****************************************************************************/
+#define HIFMC100_ECC_ERR_NUM0_BUF0 0xc0
+#define HIFMC100_ECC_ERR_NUM1_BUF0 0xc4
+#define HIFMC100_ECC_ERR_NUM0_BUF1 0xc8
+#define HIFMC100_ECC_ERR_NUM1_BUF1 0xcc
+
+#define GET_ECC_ERR_NUM(_i, _reg) (((_reg) >> ((_i) * 8)) & 0xff)
+
+/*****************************************************************************/
+#define NAND_MAX_PAGESIZE 32768
+#define NAND_MAX_OOBSIZE 4800
+
+#define CONFIG_SUPPORT_YAFFS
+#define HIFMC100_NAND_OOBSIZE_FOR_YAFFS 32
+
+/*****************************************************************************/
+#define REG_CNT_HIGH_BLOCK_NUM_SHIFT 10
+
+#define REG_CNT_BLOCK_NUM_MASK 0x3ff
+#define REG_CNT_BLOCK_NUM_SHIFT 22
+
+#define REG_CNT_PAGE_NUM_MASK 0x3f
+#define REG_CNT_PAGE_NUM_SHIFT 16
+
+#define REG_CNT_WRAP_MASK 0xf
+#define REG_CNT_WRAP_SHIFT 12
+
+#define REG_CNT_ECC_OFFSET_MASK 0xfff
+#define REG_CNT_ECC_8BIT_OFFSET 1054
+#define REG_CNT_ECC_16BIT_OFFSET 1056
+#define REG_CNT_ECC_24BIT_OFFSET 1082
+
+/*****************************************************************************/
+#define HIFMC100_ADDR_CYCLE_MASK 0x4
+
+#define NAND_EDO_MODE_SHIFT 9
+#define NAND_EDO_MODE_MASK (1<.
+ *
+ */
+
+#include
+
+#include "hifmc100_nand_os.h"
+#include "hifmc100_nand.h"
+#include
+
+/*****************************************************************************/
+static inline int mtd_has_partitions(void) { return 1; }
+
+/*****************************************************************************/
+static int hisi_nand_os_probe(struct platform_device *pltdev)
+{
+ int len, result = 0;
+ struct hifmc_host *host;
+ struct nand_chip *chip;
+ struct mtd_info *mtd;
+ int nr_parts = 0;
+ struct mtd_partition *parts = NULL;
+ struct device *dev = &pltdev->dev;
+ struct device_node *np = NULL;
+ struct hisi_fmc *fmc = dev_get_drvdata(dev->parent);
+
+ len = sizeof(struct hifmc_host) + sizeof(struct nand_chip)
+ + sizeof(struct mtd_info);
+ host = devm_kzalloc(dev, len, GFP_KERNEL);
+ if (!host)
+ return -ENOMEM;
+ memset((char *)host, 0, len);
+ platform_set_drvdata(pltdev, host);
+
+ host->dev = &pltdev->dev;
+ host->chip = chip = (struct nand_chip *)&host[1];
+ host->mtd = mtd = nand_to_mtd(chip);
+ host->regbase = fmc->regbase;
+ host->iobase = fmc->iobase;
+ host->clk = fmc->clk;
+ chip->IO_ADDR_R = chip->IO_ADDR_W = host->iobase;
+
+ /* hifmc Nand host init */
+ chip->priv = host;
+ result = hifmc100_nand_init(chip);
+ if (result) {
+ DB_MSG("Error: host init failed! result: %d\n", result);
+ goto fail;
+ }
+
+ np = of_get_next_available_child(dev->of_node, NULL);
+ mtd->name = np->name;
+ mtd->type = MTD_NANDFLASH;
+ mtd->priv = chip;
+ mtd->flags = MTD_CAP_NANDFLASH;
+ mtd->owner = THIS_MODULE;
+
+ if (nand_scan(mtd, CONFIG_HIFMC100_MAX_NAND_CHIP)) {
+ result = -ENXIO;
+ goto fail;
+ }
+
+ result = mtd_device_register(host->mtd, parts, nr_parts);
+ if (result) {
+ kfree(parts);
+ parts = NULL;
+ }
+
+ return (1 == result) ? -ENODEV : 0;
+
+fail:
+ clk_disable_unprepare(host->clk);
+ nand_release(mtd);
+ return result;
+}
+
+/*****************************************************************************/
+static int hisi_nand_os_remove(struct platform_device *pltdev)
+{
+ struct hifmc_host *host = platform_get_drvdata(pltdev);
+
+ clk_disable_unprepare(host->clk);
+ nand_release(host->mtd);
+
+ return 0;
+}
+
+#ifdef CONFIG_PM
+/*****************************************************************************/
+static int hifmc100_nand_os_suspend(struct platform_device *pltdev,
+ pm_message_t state)
+{
+ struct hifmc_host *host = platform_get_drvdata(pltdev);
+ if (!host)
+ return 0;
+
+ while ((hifmc_readl(host, FMC_OP) & FMC_OP_REG_OP_START))
+ _cond_resched();
+
+ while ((hifmc_readl(host, FMC_OP_CTRL) & OP_CTRL_DMA_OP_READY))
+ _cond_resched();
+
+ clk_disable_unprepare(host->clk);
+ FMC_PR(PM_DBG, "\t|-disable system clock\n");
+ return 0;
+}
+
+/*****************************************************************************/
+static int hifmc100_nand_os_resume(struct platform_device *pltdev)
+{
+ int cs;
+ struct hifmc_host *host = platform_get_drvdata(pltdev);
+ struct nand_chip *chip = host->chip;
+
+ if (!host)
+ return 0;
+
+ for (cs = 0; cs < chip->numchips; cs++)
+ host->send_cmd_reset(host);
+
+ hifmc100_nand_config(host);
+ return 0;
+}
+#endif /* CONFIG_PM */
+
+/*****************************************************************************/
+static const struct of_device_id hisi_nand_dt_ids[] = {
+ { .compatible = "hisilicon,hisi_nand" },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, hisi_nand_dt_ids);
+
+static struct platform_driver hisi_nand_driver = {
+ .driver = {
+ .name = "hisi_nand",
+ .of_match_table = hisi_nand_dt_ids,
+ },
+ .probe = hisi_nand_os_probe,
+ .remove = hisi_nand_os_remove,
+#ifdef CONFIG_PM
+ .suspend = hifmc100_nand_os_suspend,
+ .resume = hifmc100_nand_os_resume,
+#endif
+};
+module_platform_driver(hisi_nand_driver);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("BVT_BSP");
+MODULE_DESCRIPTION("Hisilicon Flash Memory Controller V100 Nand Driver");
diff --git a/drivers/mtd/nand/hifmc100_nand/hifmc100_nand_os.h b/drivers/mtd/nand/hifmc100_nand/hifmc100_nand_os.h
new file mode 100644
index 0000000..b6d9807
--- /dev/null
+++ b/drivers/mtd/nand/hifmc100_nand/hifmc100_nand_os.h
@@ -0,0 +1,74 @@
+/*
+ * The Flash Memory Controller v100 Device Driver for hisilicon
+ *
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#ifndef __HIFMC100_NAND_OS_H__
+#define __HIFMC100_NAND_OS_H__
+
+/*****************************************************************************/
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 5))
+ #include "../../mtdcore.h"
+#endif
+
+/*****************************************************************************/
+#define DEFAULT_NAND_PAGESIZE 2048
+#define DEFAULT_NAND_OOBSIZE 64
+
+#define NAND_BUFFER_LEN (DEFAULT_NAND_PAGESIZE + DEFAULT_NAND_OOBSIZE)
+
+/*****************************************************************************/
+#ifndef CONFIG_RW_H_WIDTH
+ #define CONFIG_RW_H_WIDTH (10)
+ #warning NOT config CONFIG_RW_H_WIDTH, used default value, maybe invalid.
+#endif
+
+#ifndef CONFIG_R_L_WIDTH
+ #define CONFIG_R_L_WIDTH (10)
+ #warning NOT config CONFIG_R_L_WIDTH, used default value, maybe invalid.
+#endif
+
+#ifndef CONFIG_W_L_WIDTH
+ #define CONFIG_W_L_WIDTH (10)
+ #warning NOT config CONFIG_W_L_WIDTH, used default value, maybe invalid.
+#endif
+
+extern void hifmc100_nand_controller_enable(int enable);
+
+#endif /* End of __HIFMC100_NAND_OS_H__ */
diff --git a/drivers/mtd/nand/hifmc100_nand/hifmc_nand_spl_ids.c b/drivers/mtd/nand/hifmc100_nand/hifmc_nand_spl_ids.c
new file mode 100644
index 0000000..e0d7a39
--- /dev/null
+++ b/drivers/mtd/nand/hifmc100_nand/hifmc_nand_spl_ids.c
@@ -0,0 +1,942 @@
+/*
+ * The Flash Memory Controller v100 Device Driver for hisilicon
+ *
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include
+#include
+#include
+
+#include "../hinfc_gen.h"
+#include "hifmc100_nand.h"
+
+/*****************************************************************************/
+#define _768K (_256K + _512K)
+
+/*****************************************************************************/
+struct nand_flash_special_dev {
+ unsigned char id[8];
+ int length; /* length of id. */
+ unsigned long long chipsize;
+ struct nand_flash_dev *(*probe)(unsigned char *id);
+ char *name;
+
+ unsigned long pagesize;
+ unsigned long erasesize;
+ unsigned long oobsize;
+ unsigned long options;
+ unsigned int read_retry_type;
+
+#define BBP_LAST_PAGE 0x01
+#define BBP_FIRST_PAGE 0x02
+ unsigned int badblock_pos;
+ int flags;
+};
+
+/*****************************************************************************/
+/* this is nand probe function. */
+/*****************************************************************************/
+
+static struct nand_flash_dev *hynix_probe_v02(unsigned char *id)
+{
+ struct nand_flash_dev *type = &g_nand_dev.flash_dev;
+
+ int pagesizes[] = {_2K, _4K, _8K, 0};
+ int oobsizes[] = {128, 224, 448, 0, 0, 0, 0, 0};
+ int blocksizes[] = {_128K, _256K, _512K, _768K, _1M, _2M, 0, 0};
+
+ int blocktype = (((id[3] >> 5) & 0x04) | ((id[3] >> 4) & 0x03));
+ int oobtype = (((id[3] >> 2) & 0x03) | ((id[3] >> 4) & 0x04));
+
+ type->options = 0;
+ type->pagesize = pagesizes[(id[3] & 0x03)];
+ type->erasesize = blocksizes[blocktype];
+ type->oobsize = oobsizes[oobtype];
+
+ return type;
+}
+
+/*****************************************************************************/
+static struct nand_flash_dev *samsung_probe_v02(unsigned char *id)
+{
+ struct nand_flash_dev *type = &g_nand_dev.flash_dev;
+
+ int pagesizes[] = {_2K, _4K, _8K, 0};
+ int oobsizes[] = {0, 128, 218, 400, 436, 0, 0, 0};
+ int blocksizes[] = {_128K, _256K, _512K, _1M, 0, 0, 0, 0};
+
+ int blocktype = (((id[3] >> 5) & 0x04) | ((id[3] >> 4) & 0x03));
+ int oobtype = (((id[3] >> 4) & 0x04) | ((id[3] >> 2) & 0x03));
+
+ type->options = 0;
+ type->pagesize = pagesizes[(id[3] & 0x03)];
+ type->erasesize = blocksizes[blocktype];
+ type->oobsize = oobsizes[oobtype];
+
+ return type;
+}
+
+/*****************************************************************************/
+
+#define DRV_VERSION "1.39"
+
+/*****************************************************************************/
+/*
+ * samsung: 27nm need randomizer, 21nm need read retry;
+ * micron: 25nm need read retry, datasheet will explain read retry.
+ * toshaba 32nm need randomizer, 24nm need read retry.
+ * hynix: 2xnm need read retry.
+ *
+ * The special nand flash ID table version 1.39
+ *
+ * manufactory | type | name | ecc_type | version_tag
+ * Micron | MLC | MT29F64G08CBABA | 40bit/1k | 1.36
+ * Micron | MLC | MT29F32G08CBADA | 40bit/1k |
+ * Micron | SLC | MT29F8G08ABxBA | 4bit/512 |
+ * Micron | MLC | MT29F16G08CBABx | 12bit/512 |
+ * Micron | MLC | MT29F16G08CBACA | 24bit/1k |
+ * Micron | MLC | MT29F32G08CBACA | 24bit/1k |
+ * Micron | MLC | MT29F64G08CxxAA | 24bit/1k |
+ * Micron | MLC | MT29F256G08CJAAA | 24bit/1k | 2CE
+ * Micron | MLC | MT29F256G08CMCBB | 24bit/1k |
+ * Micron | SLC | MT29F8G08ABACA | 8bit/512 |
+ * Micron | SLC | MT29F4G08ABAEA | 8bit/512 |
+ * Micron | SLC | MT29F2G08ABAFA | 8bit/512 |
+ * Micron | SLC | MT29F16G08ABACA | 8bit/512 |
+ * Toshiba | MLC | TC58NVG4D2FTA00 | 24bit/1k |
+ * Toshiba | MLC | TH58NVG6D2FTA20 | 24bit/1k | 2CE
+ * Toshiba | MLC | TC58NVG5D2HTA00 | 40bit/1k |
+ * Toshiba | MLC | TC58NVG6D2GTA00 | 40bit/1k |
+ * Toshiba | MLC | TC58NVG6DCJTA00 | |
+ * Toshiba | MLC | TC58TEG5DCJTA00 | |
+ * Toshiba | SLC | TC58NVG0S3HTA00 | 8bit/512 |
+ * Toshiba | SLC | TC58NVG1S3HTA00 | 8bit/512 |
+ * Toshiba | SLC | TC58NVG1S3ETA00 | 4bit/512 |
+ * Toshiba | SLC | TC58NVG3S0FTA00 | 4bit/512 |
+ * Toshiba | SLC | TC58NVG2S0FTA00 | 4bit/512 |
+ * Toshiba | SLC | TH58NVG2S3HTA00 | 4bit/512 |
+ * Toshiba | TLC | TC58NVG5T2JTA00 | 60bit/1k |
+ * Toshiba | TLC | TC58TEG5DCKTAx0 | 60bit/1k |
+ * Toshiba | MLC | Tx58TEGxDDKTAx0 | |
+ * Samsung | MLC | K9LB(HC/PD/MD)G08U0(1)D | 8bit/512B |
+ * Samsung | MLC | K9GAG08U0E | 24bit/1KB |
+ * Samsung | MLC | K9LBG08U0E | 24bit/1KB |
+ * Samsung | MLC | K9G8G08U0C | 24bit/1KB |
+ * Samsung | MLC | K9GAG08U0F | 24bit/1KB |
+ * Samsung | MLC | K9LBG08U0M | |
+ * Samsung | MLC | K9GBG08U0A | 24bit/1KB |
+ * Samsung | MLC | K9GBG08U0B | 40bit/1KB |
+ * Hynix | MLC | H27UAG8T2A | |
+ * Hynix | MLC | H27UAG8T2B | |
+ * Hynix | MLC | H27UBG8T2A | |
+ * Hynix | MLC | H27UBG8T2BTR | 24bit/1KB |
+ * Hynix | MLC | H27UCG8T2A | 40bit/1KB |
+ * Hynix | MLC | H27UBG8T2C | 40bit/1KB |
+ * MISC | MLC | P1UAGA30AT-GCA | 8bit/512 |
+ * MISC | MLC | PSU8GA30AT-GIA/ASU8GA30IT-G30CA | 4bit/512 |
+ * MISC | SLC | PSU2GA30AT | 1bit/512 | 1.36
+ * Toshiba | SLC | TC58NVG2S0HTA00 | 24bit/1K | 1.37
+ * Toshiba | SLC | TC58NVG3S0HTA00 | 24bit/1K | 1.37
+ * Micron | SLC | MT29F2G08ABAEA | 4bit/512 |
+ * Spansion | SLC | S34ML02G200TFI000 | 24bit/1K |
+ * Spansion | SLC | S34ML04G200TFI000 | 24bit/1K | 1.38
+ * MXIC Macronix| SLC | MX30UF2G18AC 1.8V | 4bit/512 | 1.39
+ *
+ */
+static struct nand_flash_special_dev nand_flash_special_table[] = {
+
+ /************************* 1.8V MXIC Macronix **************************/
+ { /* SLC 4bit/512 1.8V */
+ .name = "MX30UF2G18AC",
+ .id = {0xC2, 0xAA, 0x90, 0x15, 0x06},
+ .length = 5,
+ .chipsize = _256M,
+ .probe = NULL,
+ .pagesize = _2K,
+ .erasesize = _128K,
+ .oobsize = 64,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+
+ /****************************** Spansion *******************************/
+
+ { /* SLC S34ML02G200TFI000 */
+ .name = "S34ML02G200TFI000",
+ .id = {0x01, 0xDA, 0x90, 0x95, 0x46, 0x00, 0x00, 0x00},
+ .length = 5,
+ .chipsize = _256M,
+ .probe = NULL,
+ .pagesize = _2K,
+ .erasesize = _128K,
+ .oobsize = 128,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+
+ { /* SLC S34ML04G200TFI000 */
+ .name = "S34ML04G200TFI000",
+ .id = {0x01, 0xDC, 0x90, 0x95, 0x56, 0x00, 0x00, 0x00},
+ .length = 5,
+ .chipsize = _512M,
+ .probe = NULL,
+ .pagesize = _2K,
+ .erasesize = _128K,
+ .oobsize = 128,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+
+ /****************************** Micron *******************************/
+
+ { /* MLC 40bit/1k */
+ .name = "MT29F64G08CBABA",
+ .id = {0x2C, 0x64, 0x44, 0x4B, 0xA9, 0x00, 0x00, 0x00},
+ .length = 8,
+ .chipsize = _8G,
+ .probe = NULL,
+ .pagesize = _8K,
+ .erasesize = _2M,
+ .oobsize = 744,
+ .options = 0,
+ .read_retry_type = NAND_RR_MICRON,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = NAND_RANDOMIZER | NAND_CHIP_MICRON,
+ },
+ { /* MLC 40bit/1k */
+ .name = "MT29F32G08CBADA",
+ .id = {0x2C, 0x44, 0x44, 0x4B, 0xA9, 0x00, 0x00, 0x00},
+ .length = 8,
+ .chipsize = _4G,
+ .probe = NULL,
+ .pagesize = _8K,
+ .erasesize = _2M,
+ .oobsize = 744,
+ .options = 0,
+ .read_retry_type = NAND_RR_MICRON,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = NAND_RANDOMIZER,
+ },
+ { /* SLC 4bit/512 */
+ .name = "MT29F8G08ABxBA",
+ .id = {0x2C, 0x38, 0x00, 0x26, 0x85, 0x00, 0x00, 0x00},
+ .length = 8,
+ .chipsize = _1G,
+ .probe = NULL,
+ .pagesize = _4K,
+ .erasesize = _512K,
+ .oobsize = 224,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+ { /* MLC 12bit/512 */
+ .name = "MT29F16G08CBABx",
+ .id = {0x2C, 0x48, 0x04, 0x46, 0x85, 0x00, 0x00, 0x00},
+ .length = 8,
+ .chipsize = _2G,
+ .probe = NULL,
+ .pagesize = _4K,
+ .erasesize = _1M,
+ .oobsize = 224,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+ { /* MLC 24bit/1k */
+ .name = "MT29F16G08CBACA",
+ .id = {0x2C, 0x48, 0x04, 0x4A, 0xA5, 0x00, 0x00, 0x00},
+ .length = 8,
+ .chipsize = _2G,
+ .probe = NULL,
+ .pagesize = _4K,
+ .erasesize = _1M,
+ .oobsize = 224,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+ { /* MLC 24bit/1k */
+ .name = "MT29F32G08CBACA",
+ .id = {0x2C, 0x68, 0x04, 0x4A, 0xA9, 0x00, 0x00, 0x00},
+ .length = 8,
+ .chipsize = _4G,
+ .probe = NULL,
+ .pagesize = _4K,
+ .erasesize = _1M,
+ .oobsize = 224,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+ { /* MLC 24bit/1k */
+ .name = "MT29F64G08CxxAA",
+ .id = {0x2C, 0x88, 0x04, 0x4B, 0xA9, 0x00, 0x00, 0x00},
+ .length = 8,
+ .chipsize = _8G,
+ .probe = NULL,
+ .pagesize = _8K,
+ .erasesize = _2M,
+ .oobsize = 448,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = NAND_RANDOMIZER,
+ },
+ { /* MLC 24bit/1k 2CE */
+ .name = "MT29F256G08CJAAA",
+ .id = {0x2C, 0xA8, 0x05, 0xCB, 0xA9, 0x00, 0x00, 0x00},
+ .length = 8,
+ .chipsize = _16G,
+ .probe = NULL,
+ .pagesize = _8K,
+ .erasesize = _2M,
+ .oobsize = 448,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = NAND_RANDOMIZER,
+ },
+ { /* MLC 40bit/1k */
+ .name = "MT29F256G08CMCBB",
+ .id = {0x2C, 0x64, 0x44, 0x4B, 0xA9, 0x00, 0x00, 0x00},
+ .length = 8,
+ .chipsize = _8G,
+ .probe = NULL,
+ .pagesize = _8K,
+ .erasesize = _2M,
+ .oobsize = 744,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+ { /* SLC 8bit/512 */
+ .name = "MT29F8G08ABACA",
+ .id = {0x2C, 0xD3, 0x90, 0xA6, 0x64, 0x00, 0x00, 0x00},
+ .length = 5,
+ .chipsize = _1G,
+ .probe = NULL,
+ .pagesize = _4K,
+ .erasesize = _256K,
+ .oobsize = 224,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+ { /* SLC 8bit/512 */
+ .name = "MT29F4G08ABAEA",
+ .id = {0x2C, 0xDC, 0x90, 0xA6, 0x54, 0x00, 0x00, 0x00},
+ .length = 5,
+ .chipsize = _512M,
+ .probe = NULL,
+ .pagesize = _4K,
+ .erasesize = _256K,
+ .oobsize = 224,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+ { /* SLC 8bit/512 */
+ .name = "MT29F2G08ABAFA",
+ .id = {0x2C, 0xDA, 0x90, 0x95, 0x04, 0x00, 0x00, 0x00},
+ .length = 5,
+ .chipsize = _256M,
+ .probe = NULL,
+ .pagesize = _2K,
+ .erasesize = _128K,
+ .oobsize = 224,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+ { /* SLC MT29F2G08ABAEA */
+ .name = "MT29F2G08ABAEA",
+ .id = {0x2C, 0xDA, 0x90, 0x95, 0x06, 0x00, 0x00, 0x00},
+ .length = 5,
+ .chipsize = _256M,
+ .probe = NULL,
+ .pagesize = _2K,
+ .erasesize = _128K,
+ .oobsize = 64,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+ { /* SLC 8bit/512 */
+ .name = "MT29F16G08ABACA",
+ .id = {0x2C, 0x48, 0x00, 0x26, 0xA9, 0x00, 0x00, 0x00},
+ .length = 5,
+ .chipsize = _2G,
+ .probe = NULL,
+ .pagesize = _4K,
+ .erasesize = _512K,
+ .oobsize = 224,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+
+ /****************************** Toshaba *******************************/
+
+ { /* MLC 24bit/1k 32nm */
+ .name = "TC58NVG4D2FTA00",
+ .id = {0x98, 0xD5, 0x94, 0x32, 0x76, 0x55, 0x00, 0x00},
+ .length = 6,
+ .chipsize = _2G,
+ .probe = NULL,
+ .pagesize = _8K,
+ .erasesize = _1M,
+ .oobsize = 448,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = 0,
+ },
+ { /* MLC 24bit/1k 32nm 2CE*/
+ .name = "TH58NVG6D2FTA20",
+ .id = {0x98, 0xD7, 0x94, 0x32, 0x76, 0x55, 0x00, 0x00},
+ .length = 6,
+ .chipsize = _4G,
+ .probe = NULL,
+ .pagesize = _8K,
+ .erasesize = _1M,
+ .oobsize = 448,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = 0,
+ },
+ { /* MLC 40bit/1k 24nm */
+ .name = "TC58NVG5D2HTA00 24nm",
+ .id = {0x98, 0xD7, 0x94, 0x32, 0x76, 0x56, 0x08, 0x00},
+ .length = 6,
+ .chipsize = _4G,
+ .probe = NULL,
+ .pagesize = _8K,
+ .erasesize = _1M,
+ .oobsize = 640,
+ .options = 0,
+ .read_retry_type = NAND_RR_TOSHIBA_24nm,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = NAND_RANDOMIZER,
+ },
+ { /* MLC 40bit/1k */
+ .name = "TC58NVG6D2GTA00",
+ .id = {0x98, 0xDE, 0x94, 0x82, 0x76, 0x00, 0x00, 0x00},
+ .length = 5,
+ .chipsize = _8G,
+ .probe = NULL,
+ .pagesize = _8K,
+ .erasesize = _2M,
+ .oobsize = 640,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = 0,
+ },
+ { /* MLC 19nm */
+ .name = "TC58NVG6DCJTA00 19nm",
+ .id = {0x98, 0xDE, 0x84, 0x93, 0x72, 0x57, 0x08, 0x04},
+ .length = 8,
+ .chipsize = _8G,
+ .probe = NULL,
+ .pagesize = _16K,
+ .erasesize = _4M,
+ .oobsize = 1280,
+ .options = 0,
+ .read_retry_type = NAND_RR_TOSHIBA_24nm,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = NAND_RANDOMIZER,
+ },
+ { /* MLC 19nm */
+ .name = "TC58TEG5DCJTA00 19nm",
+ .id = {0x98, 0xD7, 0x84, 0x93, 0x72, 0x57, 0x08, 0x04},
+ .length = 6,
+ .chipsize = _4G,
+ .probe = NULL,
+ .pagesize = _16K,
+ .erasesize = _4M,
+ .oobsize = 1280,
+ .options = 0,
+ .read_retry_type = NAND_RR_TOSHIBA_24nm,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = NAND_RANDOMIZER | NAND_CHIP_TOSHIBA_TOGGLE_10,
+ },
+ { /* SLC 8bit/512 */
+ .name = "TC58NVG0S3HTA00",
+ .id = {0x98, 0xF1, 0x80, 0x15, 0x72, 0x00, 0x00, 0x00},
+ .length = 5,
+ .chipsize = _128M,
+ .probe = NULL,
+ .pagesize = _2K,
+ .erasesize = _128K,
+ .oobsize = 128,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ /*
+ * Datasheet: read one column of any page in each block. If the
+ * data of the column is 00 (Hex), define the block as a bad
+ * block.
+ */
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+ { /* SLC 8bit/512 */
+ .name = "TC58NVG1S3HTA00",
+ .id = {0x98, 0xDA, 0x90, 0x15, 0x76, 0x16, 0x08, 0x00},
+ .length = 7,
+ .chipsize = _256M,
+ .probe = NULL,
+ .pagesize = _2K,
+ .erasesize = _128K,
+ .oobsize = 128,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+ { /* SLC 4bit/512 */
+ .name = "TC58NVG1S3ETA00",
+ .id = {0x98, 0xDA, 0x90, 0x15, 0x76, 0x14, 0x03, 0x00},
+ .length = 7,
+ .chipsize = _256M,
+ .probe = NULL,
+ .pagesize = _2K,
+ .erasesize = _128K,
+ .oobsize = 64,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+ { /* SLC 4bit/512 */
+ .name = "TC58NVG3S0FTA00",
+ .id = {0x98, 0xD3, 0x90, 0x26, 0x76, 0x15, 0x02, 0x08},
+ .length = 8,
+ .chipsize = _1G,
+ .probe = NULL,
+ .pagesize = _4K,
+ .erasesize = _256K,
+ .oobsize = 232,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+ { /* SLC 24bit/1k */
+ .name = "TC58NVG3S0HTA00",
+ .id = {0x98, 0xD3, 0x91, 0x26, 0x76, 0x16, 0x08, 0x00},
+ .length = 8,
+ .chipsize = _1G,
+ .probe = NULL,
+ .pagesize = _4K,
+ .erasesize = _256K,
+ .oobsize = 256,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+ { /* SLC 24bit/1k */
+ .name = "TC58NVG2S0HTA00",
+ .id = {0x98, 0xDC, 0x90, 0x26, 0x76, 0x16, 0x08, 0x00},
+ .length = 8,
+ .chipsize = _512M,
+ .probe = NULL,
+ .pagesize = _4K,
+ .erasesize = _256K,
+ .oobsize = 256,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+ { /* SLC 4bit/512 */
+ .name = "TC58NVG2S0FTA00",
+ .id = {0x98, 0xDC, 0x90, 0x26, 0x76, 0x15, 0x01, 0x08},
+ .length = 8,
+ .chipsize = _512M,
+ .probe = NULL,
+ .pagesize = _4K,
+ .erasesize = _256K,
+ .oobsize = 224,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+ { /* SLC 4bit/512 */
+ .name = "TH58NVG2S3HTA00",
+ .id = {0x98, 0xDC, 0x91, 0x15, 0x76},
+ .length = 5,
+ .chipsize = _512M,
+ .probe = NULL,
+ .pagesize = _2K,
+ .erasesize = _128K,
+ .oobsize = 128,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE,
+ .flags = 0,
+ },
+ { /* TLC 60bit/1k 19nm */
+ .name = "TC58NVG5T2JTA00 19nm TLC",
+ /* datasheet says 6 ids id data, but really has 8 ids. */
+ .id = {0x98, 0xD7, 0x98, 0x92, 0x72, 0x57, 0x08, 0x10},
+ .length = 6,
+ .chipsize = _4G,
+ .probe = NULL,
+ .pagesize = _8K,
+ .erasesize = _4M,
+ .oobsize = 1024,
+ .options = 0,
+ .read_retry_type = NAND_RR_TOSHIBA_24nm,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = NAND_RANDOMIZER,
+ },
+ { /* TLC 60bit/1k 19nm */
+ .name = "TC58TEG5DCKTAx0 19nm MLC",
+ /* datasheet says 6 ids id data, but really has 8 ids. */
+ .id = {0x98, 0xD7, 0x84, 0x93, 0x72, 0x50, 0x08, 0x04},
+ .length = 6,
+ .chipsize = _4G,
+ .probe = NULL,
+ .pagesize = _16K,
+ .erasesize = _4M,
+ .oobsize = 1280,
+ .options = 0,
+ .read_retry_type = NAND_RR_TOSHIBA_19nm,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = NAND_RANDOMIZER,
+ },
+ {
+ .name = "Tx58TEGxDDKTAx0 19nm MLC",
+ .id = {0x98, 0xDE, 0x94, 0x93, 0x76, 0x50},
+ .length = 6,
+ .chipsize = _4G,
+ .probe = NULL,
+ .pagesize = _16K,
+ .erasesize = _4M,
+ .oobsize = 1280,
+ .options = 0,
+ .read_retry_type = NAND_RR_TOSHIBA_19nm,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = NAND_RANDOMIZER,
+ },
+ /******************************* Samsung ******************************/
+ { /* MLC 8bit/512B */
+ .name = "K9LB(HC/PD/MD)G08U0(1)D",
+ .id = {0xEC, 0xD7, 0xD5, 0x29, 0x38, 0x41, 0x00, 0x00},
+ .length = 6,
+ .chipsize = _4G,
+ .probe = samsung_probe_v02,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_LAST_PAGE,
+ .flags = 0,
+ },
+ { /* MLC 24bit/1KB */
+ .name = "K9GAG08U0E",
+ .id = {0xEC, 0xD5, 0x84, 0x72, 0x50, 0x42, 0x00, 0x00},
+ .length = 6,
+ .chipsize = _2G,
+ .probe = samsung_probe_v02,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = 0,
+ },
+ { /* MLC 24bit/1KB */
+ .name = "K9LBG08U0E",
+ .id = {0xEC, 0xD7, 0xC5, 0x72, 0x54, 0x42, 0x00, 0x00},
+ .length = 6,
+ .chipsize = _4G,
+ .probe = samsung_probe_v02,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = 0,
+ },
+ { /* MLC 24bit/1KB */
+ .name = "K9G8G08U0C",
+ .id = {0xEC, 0xD3, 0x84, 0x72, 0x50, 0x42, 0x00, 0x00},
+ .length = 6,
+ .chipsize = _1G,
+ .probe = samsung_probe_v02,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = 0,
+ },
+ { /* MLC 24bit/1k */
+ .name = "K9GAG08U0F",
+ .id = {0xEC, 0xD5, 0x94, 0x76, 0x54, 0x43, 0x00, 0x00},
+ .length = 6,
+ .chipsize = _2G,
+ .probe = NULL,
+ .pagesize = _8K,
+ .erasesize = _1M,
+ .oobsize = 512,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = 0,
+ },
+ { /* MLC */
+ .name = "K9LBG08U0M",
+ .id = {0xEC, 0xD7, 0x55, 0xB6, 0x78, 0x00, 0x00, 0x00},
+ .length = 5,
+ .chipsize = _4G,
+ .probe = NULL,
+ .pagesize = _4K,
+ .erasesize = _512K,
+ .oobsize = 128,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_LAST_PAGE,
+ .flags = 0,
+ },
+ { /* MLC 24bit/1k */
+ .name = "K9GBG08U0A 20nm",
+ .id = {0xEC, 0xD7, 0x94, 0x7A, 0x54, 0x43, 0x00, 0x00},
+ .length = 6,
+ .chipsize = _4G,
+ .probe = NULL,
+ .pagesize = _8K,
+ .erasesize = _1M,
+ .oobsize = 640,
+ .options = 0,
+ .read_retry_type = NAND_RR_SAMSUNG,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = NAND_RANDOMIZER,
+ },
+ { /* MLC 40bit/1k */
+ .name = "K9GBG08U0B",
+ .id = {0xEC, 0xD7, 0x94, 0x7E, 0x64, 0x44, 0x00, 0x00},
+ .length = 6,
+ .chipsize = _4G,
+ .probe = NULL,
+ .pagesize = _8K,
+ .erasesize = _1M,
+ .oobsize = 1024,
+ .options = 0,
+ .read_retry_type = NAND_RR_SAMSUNG,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = NAND_RANDOMIZER,
+ },
+
+ /*********************************** Hynix ****************************/
+ { /* MLC */
+ .name = "H27UAG8T2A",
+ .id = {0xAD, 0xD5, 0x94, 0x25, 0x44, 0x41, },
+ .length = 6,
+ .chipsize = _2G,
+ .probe = hynix_probe_v02,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = 0,
+ },
+ { /* MLC */
+ .name = "H27UAG8T2B",
+ .id = {0xAD, 0xD5, 0x94, 0x9A, 0x74, 0x42, },
+ .length = 6,
+ .chipsize = _2G,
+ .probe = hynix_probe_v02,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = 0,
+ },
+ { /* MLC */
+ .name = "H27UBG8T2A",
+ .id = {0xAD, 0xD7, 0x94, 0x9A, 0x74, 0x42, },
+ .length = 6,
+ .chipsize = _4G,
+ .probe = hynix_probe_v02,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = 0,
+ },
+ { /* MLC 24bit/1K, 26nm TODO: Need read retry, chip is EOS */
+ .name = "H27UBG8T2BTR 26nm",
+ .id = {0xAD, 0xD7, 0x94, 0xDA, 0x74, 0xC3, },
+ .length = 6,
+ .chipsize = _4G,
+ .probe = NULL,
+ .pagesize = _8K,
+ .erasesize = _2M,
+ .oobsize = 640,
+ .options = 0,
+ .read_retry_type = NAND_RR_HYNIX_BG_BDIE,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = NAND_RANDOMIZER,
+ },
+ { /* MLC 40bit/1k */
+ .name = "H27UCG8T2A",
+ .id = {0xAD, 0xDE, 0x94, 0xDA, 0x74, 0xC4, },
+ .length = 6,
+ .chipsize = _8G,
+ .probe = NULL,
+ .pagesize = _8K,
+ .erasesize = _2M,
+ .oobsize = 640,
+ .options = 0,
+ .read_retry_type = NAND_RR_HYNIX_CG_ADIE,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = NAND_RANDOMIZER,
+ },
+ { /* MLC 40bit/1k */
+ .name = "H27UBG8T2C",
+ .id = {0xAD, 0xD7, 0x94, 0x91, 0x60, 0x44, },
+ .length = 6,
+ .chipsize = _4G,
+ .probe = NULL,
+ .pagesize = _8K,
+ .erasesize = _2M,
+ .oobsize = 640,
+ .options = 0,
+ .read_retry_type = NAND_RR_HYNIX_BG_CDIE,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = NAND_RANDOMIZER,
+ },
+
+ /********************** MISC ******************************************/
+ { /* MLC 8bit/512 */
+ .name = "P1UAGA30AT-GCA",
+ .id = {0xC8, 0xD5, 0x14, 0x29, 0x34, 0x01, },
+ .length = 6,
+ .chipsize = _2G,
+ .probe = NULL,
+ .pagesize = _4K,
+ .erasesize = _512K,
+ .oobsize = 218,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = 0,
+ },
+ { /* MLC 4bit/512 */
+ /*
+ * PowerFlash ASU8GA30IT-G30CA ID and MIRA PSU8GA30AT-GIA ID are
+ * the same ID
+ */
+ .name = "PSU8GA30AT-GIA/ASU8GA30IT-G30CA",
+ .id = {0xC8, 0xD3, 0x90, 0x19, 0x34, 0x01, },
+ .length = 6,
+ .chipsize = _1G,
+ .probe = NULL,
+ .pagesize = _4K,
+ .erasesize = _256K,
+ .oobsize = 218,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = 0,
+ },
+ { /* SLC 1bit/512 */
+ .name = "PSU2GA30AT",
+ .id = {0x7F, 0x7F, 0x7F, 0x7F, 0xC8, 0xDA, 0x00, 0x15, },
+ .length = 8,
+ .chipsize = _256M,
+ .probe = NULL,
+ .pagesize = _2K,
+ .erasesize = _128K,
+ .oobsize = 64,
+ .options = 0,
+ .read_retry_type = NAND_RR_NONE,
+ .badblock_pos = BBP_FIRST_PAGE | BBP_LAST_PAGE,
+ .flags = 0,
+ },
+ {{0}, 0, 0, 0, 0, 0, 0, 0, 0},
+};
+
+struct nand_dev_t g_nand_dev;
+/*****************************************************************************/
+struct nand_flash_dev *hifmc_get_spl_flash_type(struct mtd_info *mtd,
+ unsigned char *id)
+{
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct nand_flash_special_dev *spl_dev = nand_flash_special_table;
+ struct nand_flash_dev *type = &g_nand_dev.flash_dev;
+ struct nand_dev_t *nand_dev = &g_nand_dev;
+
+ FMC_PR(BT_DBG, "\t *-Start find special nand flash\n");
+
+ pr_info("Nand ID: %#X %#X %#X %#X %#X %#X %#X %#X\n", id[0], id[1],
+ id[2], id[3], id[4], id[5], id[6], id[7]);
+
+ for (; spl_dev->length; spl_dev++) {
+ if (memcmp(id, spl_dev->id, spl_dev->length))
+ continue;
+
+ FMC_PR(BT_DBG, "\t |-Found special Nand flash: %s\n",
+ spl_dev->name);
+
+ if (spl_dev->probe) {
+ type = spl_dev->probe(id);
+ } else {
+ type->options = spl_dev->options;
+ type->pagesize = spl_dev->pagesize;
+ type->erasesize = spl_dev->erasesize;
+ type->oobsize = spl_dev->oobsize;
+ }
+
+ type->name = spl_dev->name;
+ type->id_len = spl_dev->length;
+ memcpy(type->id, id, type->id_len);
+ type->chipsize = (unsigned int)(spl_dev->chipsize >> 20);
+ FMC_PR(BT_DBG, "\t |-Save struct nand_flash_dev info\n");
+
+ memcpy(nand_dev->ids, id, MAX_NAND_ID_LEN);
+ nand_dev->oobsize = type->oobsize;
+ nand_dev->flags = spl_dev->flags;
+ nand_dev->read_retry_type = spl_dev->read_retry_type;
+ FMC_PR(BT_DBG, "\t |-Save struct nand_dev_t information\n");
+
+ mtd->size = spl_dev->chipsize;
+
+ return type;
+ }
+ nand_dev->read_retry_type = NAND_RR_NONE;
+
+ chip->cmdfunc(mtd, NAND_CMD_READID, 0x00, -1);
+ chip->read_byte(mtd);
+ chip->read_byte(mtd);
+
+ FMC_PR(BT_DBG, "\t *-Not found special nand flash\n");
+
+ return NULL;
+}
+
+/*****************************************************************************/
+void hifmc_spl_ids_register(void)
+{
+ pr_info("Special NAND id table Version %s\n", DRV_VERSION);
+ get_spi_nand_flash_type_hook = hifmc_get_spl_flash_type;
+}
diff --git a/drivers/mtd/nand/hinfc610/Kconfig b/drivers/mtd/nand/hinfc610/Kconfig
new file mode 100644
index 0000000..95d9ce2
--- /dev/null
+++ b/drivers/mtd/nand/hinfc610/Kconfig
@@ -0,0 +1,94 @@
+menuconfig MTD_NAND_HINFC610
+ tristate "Hisilicon NAND Controller v610 Nand devices Support"
+ depends on !MTD_SPI_NAND_HISI_BVT && (ARCH_HI3516A)
+ select YAFFS_FS
+ select MISC_FILESYSTEMS
+ select MTD_BLOCK
+ select YAFFS_YAFFS2
+ help
+ When the config is set, the kernel will support Hisilicon
+ NAND Controller v610 devices. It means that the kernel would
+ control the nand flash with the nand controller v610 device
+ in operation.
+
+if MTD_NAND_HINFC610
+
+config HINFC610_MAX_CHIP
+ int "number of nand flash chip (1,4)"
+ range 1 4
+ default 1
+ help
+ nand controller v610 device only support 1 or 2 nand flash chip,
+ your should not config other value.
+
+config HINFC610_DBG_NAND_DEBUG
+ bool "Debug: create debug file to control debug type"
+ default y
+ help
+ When the config is set, the kernel will add the "debug" file
+ to control debug type. When the config is set, we could choose
+ the debugging type to display the informations of the nand controller
+ v610 device in operation.
+
+config HINFC610_DBG_NAND_DUMP
+ bool "Debug: display read/write/erase process nand data"
+ depends on HINFC610_DBG_NAND_DEBUG
+ default y
+ default n if (ARCH_HI3516A)
+ help
+ When the config is set, the kernel will add "dump" file to
+ display all nand operation and data.When the "HINFC610_DBG_NAND_DEBUG"
+ has been set, the nand controller v610 device will display
+ all the operations and data.
+
+config HINFC610_DBG_NAND_ERASE_COUNT
+ bool "Debug: display last erase count"
+ depends on HINFC610_DBG_NAND_DEBUG
+ default y
+ default n if (ARCH_HI3516A)
+ help
+ When the config is set, the kernel will add "erase_count" file
+ to display last erase count. When the "HINFC610_DBG_NAND_DEBUG"
+ has been set, the nand controller v610 device will display
+ the last erase count.
+
+config HINFC610_DBG_NAND_ECC_COUNT
+ bool "Debug: display last ecc count."
+ depends on HINFC610_DBG_NAND_DEBUG
+ default y
+ default n if (ARCH_HI3516A)
+ help
+ When the config is set, the kernel will add "ecc_count"
+ to display last ecc count. When the "HINFC610_DBG_NAND_DEBUG"
+ has been set, the nand controller v610 device will display
+ the last ecc count.
+
+config HINFC610_DBG_NAND_READ_RETRY
+ bool "Debug: display read_retry process"
+ depends on HINFC610_DBG_NAND_DEBUG
+ default y
+ default n if (ARCH_HI3516A)
+ help
+ When the config is set, the kernel will add read_retry file
+ to display read_retry process.
+
+choice
+ prompt "Pagesize and Ecc Type Select"
+ default HINFC610_AUTO_PAGESIZE_ECC if ARCH_HI3516A
+
+config HINFC610_AUTO_PAGESIZE_ECC
+ bool "Auto"
+ help
+ When the config is set, pagesize and ecc type will use
+ hardware config. When we replace the flash, the
+ controller will identify the pagesize and ecc type of
+ the flash.
+
+config HINFC610_PAGESIZE_AUTO_ECC_NONE
+ bool "Pagesize Auto, Ecc None"
+ help
+ select pagesize 2K, ecc none.
+
+endchoice
+
+endif # MTD_NAND_HINFC610
diff --git a/drivers/mtd/nand/hinfc610/Makefile b/drivers/mtd/nand/hinfc610/Makefile
new file mode 100644
index 0000000..9ef9acd
--- /dev/null
+++ b/drivers/mtd/nand/hinfc610/Makefile
@@ -0,0 +1,19 @@
+
+obj-$(CONFIG_MTD_NAND_HINFC610) += hinfc610.o hinfc610_os.o hinfc610_gen.o \
+ hinfc620_gen.o hinfc610_dbg_inf.o \
+ hinfc610_read_retry_hynix_bg_cdie.o \
+ hinfc610_read_retry_hynix_bg_bdie.o \
+ hinfc610_read_retry_hynix_cg_adie.o \
+ hinfc610_read_retry_micron.o \
+ hinfc610_read_retry_samsung.o \
+ hinfc610_read_retry_toshiba.o \
+ hinfc610_read_retry.o \
+ hinfc610_sync.o \
+ hinfc610_sync_onfi_23.o \
+ hinfc610_sync_toggle.o
+
+obj-$(CONFIG_HINFC610_DBG_NAND_DEBUG) += hinfc610_dbg.o hinfc610_dbg_ecc_dump.o
+obj-$(CONFIG_HINFC610_DBG_NAND_DUMP) += hinfc610_dbg_dump.o
+obj-$(CONFIG_HINFC610_DBG_NAND_ERASE_COUNT) += hinfc610_dbg_erase_count.o
+obj-$(CONFIG_HINFC610_DBG_NAND_ECC_COUNT) += hinfc610_dbg_ecc_count.o
+obj-$(CONFIG_HINFC610_DBG_NAND_READ_RETRY) += hinfc610_dbg_read_retry.o
diff --git a/drivers/mtd/nand/hinfc610/hinfc610.c b/drivers/mtd/nand/hinfc610/hinfc610.c
new file mode 100644
index 0000000..eb8cb7f
--- /dev/null
+++ b/drivers/mtd/nand/hinfc610/hinfc610.c
@@ -0,0 +1,1196 @@
+/*
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#define pr_fmt(fmt) "hinfc610: " fmt
+
+#include "hinfc610_os.h"
+#include "hinfc610.h"
+#include "hinfc610_dbg_inf.h"
+#include "hinfc610_gen.h"
+#include "hinfc620_gen.h"
+#include "hinfc610_sync.h"
+#include "hinfc610_read_retry.h"
+
+/*****************************************************************************/
+static unsigned int get_8bits(unsigned char byte)
+{
+ int ix = 0;
+ int num = 0;
+
+ if (byte == 0xFF)
+ return 8;
+ if (!byte)
+ return 0;
+
+ while (ix++ < 8) {
+ if ((byte & 1))
+ num++;
+ byte = (byte >> 1);
+ }
+ return num;
+}
+/*****************************************************************************/
+
+static unsigned int get_16bits(unsigned short byte)
+{
+ int ix = 0;
+ int num = 0;
+
+ if (byte == 0xFFFF)
+ return 16;
+ if (!byte)
+ return 0;
+
+ while (ix++ < 16) {
+ if ((byte & 1))
+ num++;
+ byte = (byte >> 1);
+ }
+ return num;
+}
+/*****************************************************************************/
+
+static void hinfc610_dma_transfer(struct hinfc_host *host, int todev)
+{
+ unsigned long reg_val;
+ unsigned int dma_addr = (unsigned int)host->dma_buffer;
+
+ hinfc_write(host, dma_addr, HINFC610_DMA_ADDR_DATA);
+
+ dma_addr += HINFC610_DMA_ADDR_OFFSET;
+ hinfc_write(host, dma_addr, HINFC610_DMA_ADDR_DATA1);
+
+ dma_addr += HINFC610_DMA_ADDR_OFFSET;
+ hinfc_write(host, dma_addr, HINFC610_DMA_ADDR_DATA2);
+
+ dma_addr += HINFC610_DMA_ADDR_OFFSET;
+ hinfc_write(host, dma_addr, HINFC610_DMA_ADDR_DATA3);
+
+ /* 32K PAGESIZE need below. */
+ dma_addr += HINFC610_DMA_ADDR_OFFSET;
+ hinfc_write(host, dma_addr, HINFC610_DMA_ADDR_DATA4);
+
+ dma_addr += HINFC610_DMA_ADDR_OFFSET;
+ hinfc_write(host, dma_addr, HINFC610_DMA_ADDR_DATA5);
+
+ dma_addr += HINFC610_DMA_ADDR_OFFSET;
+ hinfc_write(host, dma_addr, HINFC610_DMA_ADDR_DATA6);
+
+ dma_addr += HINFC610_DMA_ADDR_OFFSET;
+ hinfc_write(host, dma_addr, HINFC610_DMA_ADDR_DATA7);
+
+ hinfc_write(host, host->dma_oob, HINFC610_DMA_ADDR_OOB);
+
+ if (host->ecctype == NAND_ECC_NONE) {
+ hinfc_write(host,
+ ((host->oobsize & HINFC610_DMA_LEN_OOB_MASK)
+ << HINFC610_DMA_LEN_OOB_SHIFT),
+ HINFC610_DMA_LEN);
+
+ hinfc_write(host,
+ HINFC610_DMA_PARA_DATA_RW_EN
+ | HINFC610_DMA_PARA_OOB_RW_EN,
+ HINFC610_DMA_PARA);
+ } else
+ hinfc_write(host,
+ HINFC610_DMA_PARA_DATA_RW_EN
+ | HINFC610_DMA_PARA_OOB_RW_EN
+ | HINFC610_DMA_PARA_DATA_EDC_EN
+ | HINFC610_DMA_PARA_OOB_EDC_EN,
+ HINFC610_DMA_PARA);
+
+ reg_val = (HINFC610_DMA_CTRL_DMA_START
+ | HINFC610_DMA_CTRL_BURST4_EN
+ | HINFC610_DMA_CTRL_BURST8_EN
+ | HINFC610_DMA_CTRL_BURST16_EN
+ | ((host->addr_cycle == 4 ? 1 : 0)
+ << HINFC610_DMA_CTRL_ADDR_NUM_SHIFT)
+ | (((unsigned int)host->chipselect & HINFC610_DMA_CTRL_CS_MASK)
+ << HINFC610_DMA_CTRL_CS_SHIFT));
+
+ if (todev)
+ reg_val |= HINFC610_DMA_CTRL_WE;
+
+ hinfc_write(host, reg_val, HINFC610_DMA_CTRL);
+
+ do {
+ unsigned int timeout = 0xF0000000;
+
+ while ((hinfc_read(host, HINFC610_DMA_CTRL))
+ & HINFC610_DMA_CTRL_DMA_START && timeout) {
+ _cond_resched();
+ timeout--;
+ }
+ if (!timeout)
+ PR_BUG("Wait DMA finish timeout.\n");
+ } while (0);
+}
+/*****************************************************************************/
+
+static void hinfc610_sync_entry(struct hinfc_host *host)
+{
+ struct nand_sync *sync = host->sync;
+ struct nand_chip *chip = host->chip;
+
+ if (!sync) {
+ PR_BUG("this NAND not support sync feature.\n");
+ return;
+ }
+
+ if (HINFC610_IS_SYNC(host)) {
+ PR_BUG("this NAND not support sync feature.\n");
+ return;
+ }
+
+ if (sync->enable)
+ sync->enable(chip);
+
+ clk_prepare_enable(host->clk);
+
+ switch (sync->type) {
+ case NAND_TYPE_TOGGLE_10:
+ host->NFC_CON |= HINFC610_CON_NF_MODE_TOGGLE;
+ host->NFC_CON_ECC_NONE |= HINFC610_CON_NF_MODE_TOGGLE;
+ break;
+
+ case NAND_TYPE_ONFI_23:
+ host->NFC_CON |= HINFC610_CON_NF_MODE_ONFI_23;
+ host->NFC_CON_ECC_NONE |= HINFC610_CON_NF_MODE_ONFI_23;
+ break;
+
+ case NAND_TYPE_ONFI_30:
+ host->NFC_CON |= HINFC610_CON_NF_MODE_ONFI_30;
+ host->NFC_CON_ECC_NONE |= HINFC610_CON_NF_MODE_ONFI_30;
+ break;
+
+ default:
+ PR_BUG("Unsupport sync type 0x%08X.\n", sync->type);
+ break;
+ }
+}
+/*****************************************************************************/
+
+static void hinfc610_sync_exit(struct hinfc_host *host)
+{
+ struct nand_sync *sync = host->sync;
+ struct nand_chip *chip = host->chip;
+
+ if (!HINFC610_IS_SYNC(host)) {
+ PR_BUG("Current already exit from sync feature.\n");
+ return;
+ }
+
+ if (sync->disable)
+ sync->disable(chip);
+
+ host->NFC_CON &= ~HINFC610_CON_NF_MODE_MASK;
+ host->NFC_CON_ECC_NONE &= ~HINFC610_CON_NF_MODE_MASK;
+
+ clk_disable_unprepare(host->clk);
+}
+/*****************************************************************************/
+
+void hinfc610_cmd_ctrl(struct mtd_info *mtd, int dat, unsigned int ctrl)
+{
+ int is_cache_invalid = 1;
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hinfc_host *host = chip->priv;
+
+ if (ctrl & NAND_ALE) {
+ unsigned int addr_value = 0;
+ unsigned int addr_offset = 0;
+
+ if (ctrl & NAND_CTRL_CHANGE) {
+ host->addr_cycle = 0x0;
+ host->addr_value[0] = 0x0;
+ host->addr_value[1] = 0x0;
+ }
+ addr_offset = host->addr_cycle << 3;
+
+ if (host->addr_cycle >= HINFC610_ADDR_CYCLE_MASK) {
+ addr_offset =
+ (host->addr_cycle - HINFC610_ADDR_CYCLE_MASK) << 3;
+ addr_value = 1;
+ }
+
+ host->addr_value[addr_value] |=
+ ((dat & 0xff) << addr_offset);
+
+ host->addr_cycle++;
+ }
+
+ if ((ctrl & NAND_CLE) && (ctrl & NAND_CTRL_CHANGE)) {
+ host->command = dat & 0xff;
+ switch (host->command) {
+ case NAND_CMD_PAGEPROG:
+ host->send_cmd_pageprog(host);
+ hinfc610_dbg_write(host);
+ break;
+
+ case NAND_CMD_READSTART:
+ is_cache_invalid = 0;
+ host->send_cmd_readstart(host);
+ hinfc610_dbg_read(host);
+
+ break;
+
+ case NAND_CMD_ERASE2:
+ host->send_cmd_erase(host);
+ hinfc610_dbg_erase(host);
+
+ break;
+
+ case NAND_CMD_READID:
+ memset((unsigned char *)(chip->IO_ADDR_R), 0, 0x10);
+ host->send_cmd_readid(host);
+ break;
+
+ case NAND_CMD_STATUS:
+ host->send_cmd_status(host);
+ break;
+
+ case NAND_CMD_SEQIN:
+ case NAND_CMD_ERASE1:
+ case NAND_CMD_READ0:
+ break;
+ case NAND_CMD_RESET:
+ host->send_cmd_reset(host, host->chipselect);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if ((dat == NAND_CMD_NONE) && host->addr_cycle) {
+ if (host->command == NAND_CMD_SEQIN ||
+ host->command == NAND_CMD_READ0 ||
+ host->command == NAND_CMD_READID) {
+ host->offset = 0x0;
+ host->column = (host->addr_value[0] & 0xffff);
+ }
+ }
+
+ if (is_cache_invalid) {
+ host->cache_addr_value[0] = ~0;
+ host->cache_addr_value[1] = ~0;
+ }
+}
+/*****************************************************************************/
+
+static int hinfc610_send_cmd_pageprog(struct hinfc_host *host)
+{
+ if (*host->bbm != 0xFF && *host->bbm != 0x00)
+ pr_warn("Attempt to write an invalid bbm. page: 0x%08x, mark: 0x%02x, current process(pid): %s(%d).\n",
+ GET_PAGE_INDEX(host), *host->bbm,
+ current->comm, current->pid);
+
+ if (IS_NAND_SYNC_ASYNC(host))
+ hinfc610_sync_entry(host);
+
+ host->enable_ecc_randomizer(host, ENABLE, ENABLE);
+
+ hinfc_write(host, host->addr_value[0] & 0xffff0000, HINFC610_ADDRL);
+ hinfc_write(host, host->addr_value[1], HINFC610_ADDRH);
+ hinfc_write(host,
+ ((NAND_CMD_STATUS << 16) | (NAND_CMD_PAGEPROG << 8) |
+ NAND_CMD_SEQIN),
+ HINFC610_CMD);
+
+ *host->epm = 0x0000;
+
+ hinfc610_dma_transfer(host, 1);
+
+ if (IS_NAND_SYNC_ASYNC(host))
+ hinfc610_sync_exit(host);
+
+ return 0;
+}
+/*****************************************************************************/
+
+static int hinfc610_get_data_status(struct hinfc_host *host)
+{
+ unsigned int page_status = 0;
+
+ if (IS_PS_UN_ECC(host))
+ page_status = HINFC610_PS_UC_ECC;
+
+ /* this is block start address */
+ if (!((host->addr_value[0] >> 16) & host->block_page_mask)) {
+
+ /* it is a bad block */
+ if (*host->bbm == 0x00) {
+ page_status |= HINFC610_PS_BAD_BLOCK;
+ goto out;
+ }
+
+ if (*host->bbm != 0xFF) {
+ page_status |= HINFC610_PS_BBM_ERROR;
+
+ /*
+ * if there are more than 2 bits flipping, it is
+ * maybe a bad block
+ */
+ if (!IS_PS_UN_ECC(host) || get_8bits(*host->bbm) < 6) {
+ page_status |= HINFC610_PS_BAD_BLOCK;
+ goto out;
+ }
+ }
+ }
+
+ if (*host->epm == 0x0000)
+ goto out;
+
+ if (*host->epm == 0xFFFF) {
+ page_status |= HINFC610_PS_EMPTY_PAGE;
+ goto out;
+ }
+
+ page_status |= HINFC610_PS_EPM_ERROR;
+
+ if (IS_PS_UN_ECC(host) && get_16bits(*host->epm) > 12) {
+ page_status |= HINFC610_PS_EMPTY_PAGE;
+ goto out;
+ }
+
+out:
+ return page_status;
+}
+/*****************************************************************************/
+
+static int hinfc610_do_read_retry(struct hinfc_host *host)
+{
+ int ix;
+
+ for (ix = 1; IS_PS_UN_ECC(host) && ix < host->read_retry->count; ix++) {
+
+ hinfc_write(host, HINFC610_INTCLR_UE | HINFC610_INTCLR_CE,
+ HINFC610_INTCLR);
+
+ host->enable_ecc_randomizer(host, DISABLE, DISABLE);
+ host->read_retry->set_rr_param(host, ix);
+
+ /* enable ecc and randomizer */
+ host->enable_ecc_randomizer(host, ENABLE, ENABLE);
+
+ hinfc_write(host, HINFC610_INTCLR_UE | HINFC610_INTCLR_CE,
+ HINFC610_INTCLR);
+ hinfc_write(host, host->NFC_CON, HINFC610_CON);
+ hinfc_write(host, host->addr_value[0] & 0xffff0000,
+ HINFC610_ADDRL);
+ hinfc_write(host, host->addr_value[1], HINFC610_ADDRH);
+ hinfc_write(host,
+ HINFC_CMD_SEQ(NAND_CMD_READ0, NAND_CMD_READSTART),
+ HINFC610_CMD);
+
+ hinfc610_dma_transfer(host, 0);
+
+ if (hinfc_read(host, HINFC610_INTS) & HINFC610_INTS_UE)
+ host->page_status |= HINFC610_PS_UC_ECC;
+ else
+ host->page_status &= ~HINFC610_PS_UC_ECC;
+ }
+
+ host->page_status = hinfc610_get_data_status(host);
+
+ hinfc610_dbg_read_retry(host, ix);
+
+ host->enable_ecc_randomizer(host, DISABLE, DISABLE);
+ host->read_retry->reset_rr_param(host);
+
+ return 0;
+}
+/*****************************************************************************/
+
+static int hinfc610_send_cmd_readstart(struct hinfc_host *host)
+{
+ if ((host->addr_value[0] == host->cache_addr_value[0]) &&
+ (host->addr_value[1] == host->cache_addr_value[1]))
+ return 0;
+
+ if (IS_NAND_SYNC_ASYNC(host))
+ hinfc610_sync_entry(host);
+
+ host->page_status = 0;
+
+ host->enable_ecc_randomizer(host, ENABLE, ENABLE);
+
+ hinfc_write(host, HINFC610_INTCLR_UE | HINFC610_INTCLR_CE,
+ HINFC610_INTCLR);
+ hinfc_write(host, host->NFC_CON, HINFC610_CON);
+ hinfc_write(host, host->addr_value[0] & 0xffff0000, HINFC610_ADDRL);
+ hinfc_write(host, host->addr_value[1], HINFC610_ADDRH);
+ hinfc_write(host, NAND_CMD_READSTART << 8 | NAND_CMD_READ0,
+ HINFC610_CMD);
+
+ hinfc610_dma_transfer(host, 0);
+
+ if (hinfc_read(host, HINFC610_INTS) & HINFC610_INTS_UE)
+ host->page_status |= HINFC610_PS_UC_ECC;
+
+ if (host->read_retry || IS_NAND_RANDOM(host)) {
+ host->page_status |= hinfc610_get_data_status(host);
+
+ if (IS_PS_EMPTY_PAGE(host)) {
+ /*
+ * oob area used by yaffs2 only 32 bytes,
+ * so we only fill 32 bytes.
+ */
+ if (IS_NAND_RANDOM(host))
+ memset(host->buffer, 0xFF,
+ host->pagesize + host->oobsize);
+
+ } else if (!IS_PS_BAD_BLOCK(host)) {
+ /* if NAND chip support read retry */
+ if (IS_PS_UN_ECC(host) && host->read_retry)
+ hinfc610_do_read_retry(host);
+
+ } /* 'else' NAND have a bad block, do nothing. */
+ }
+
+ if (IS_NAND_SYNC_ASYNC(host))
+ hinfc610_sync_exit(host);
+
+ host->cache_addr_value[0] = host->addr_value[0];
+ host->cache_addr_value[1] = host->addr_value[1];
+
+ return 0;
+}
+/*****************************************************************************/
+
+static int hinfc610_send_cmd_erase(struct hinfc_host *host)
+{
+ unsigned int regval;
+
+ /* Don't case the read retry config */
+ host->enable_ecc_randomizer(host, DISABLE, DISABLE);
+
+ hinfc_write(host, host->addr_value[0], HINFC610_ADDRL);
+ hinfc_write(host, (NAND_CMD_ERASE2 << 8) | NAND_CMD_ERASE1,
+ HINFC610_CMD);
+
+ regval = HINFC610_OP_WAIT_READY_EN
+ | HINFC610_OP_CMD2_EN
+ | HINFC610_OP_CMD1_EN
+ | HINFC610_OP_ADDR_EN
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK)
+ << HINFC610_OP_NF_CS_SHIFT)
+ | ((host->addr_cycle & HINFC610_OP_ADDR_CYCLE_MASK)
+ << HINFC610_OP_ADDR_CYCLE_SHIFT);
+
+ hinfc_write(host, regval, HINFC610_OP);
+
+ WAIT_CONTROLLER_FINISH();
+
+ return 0;
+}
+/*****************************************************************************/
+
+static int hinfc610_send_cmd_sync_readid(struct hinfc_host *host)
+{
+ unsigned int regval;
+
+ host->enable_ecc_randomizer(host, DISABLE, DISABLE);
+
+ hinfc_write(host, HINFC610_NANDINFO_LEN, HINFC610_DATA_NUM);
+ hinfc_write(host, NAND_CMD_READID, HINFC610_CMD);
+ hinfc_write(host, 0, HINFC610_ADDRL);
+
+ /* no need to config HINFC610_OP_WAIT_READY_EN, here not config. */
+ regval = HINFC610_OP_CMD1_EN
+ | HINFC610_OP_ADDR_EN
+ | HINFC610_OP_READ_DATA_EN
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK)
+ << HINFC610_OP_NF_CS_SHIFT)
+ | (1 << HINFC610_OP_ADDR_CYCLE_SHIFT)
+ | HINFC610_OP_READID_EN
+ | HINFC610_OP_RW_REG_EN;
+
+ hinfc_write(host, regval, HINFC610_OP);
+
+ host->addr_cycle = 0x0;
+
+ WAIT_CONTROLLER_FINISH();
+
+ return 0;
+}
+/*****************************************************************************/
+
+static int hinfc610_send_cmd_async_readid(struct hinfc_host *host)
+{
+ unsigned int regval;
+
+ host->enable_ecc_randomizer(host, DISABLE, DISABLE);
+
+ hinfc_write(host, HINFC610_NANDINFO_LEN, HINFC610_DATA_NUM);
+ hinfc_write(host, NAND_CMD_READID, HINFC610_CMD);
+ hinfc_write(host, 0, HINFC610_ADDRL);
+
+ /* no need to config HINFC610_OP_WAIT_READY_EN, here not config. */
+ regval = HINFC610_OP_CMD1_EN
+ | HINFC610_OP_ADDR_EN
+ | HINFC610_OP_READ_DATA_EN
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK)
+ << HINFC610_OP_NF_CS_SHIFT)
+ | (1 << HINFC610_OP_ADDR_CYCLE_SHIFT);
+
+ hinfc_write(host, regval, HINFC610_OP);
+
+ host->addr_cycle = 0x0;
+
+ WAIT_CONTROLLER_FINISH();
+
+ return 0;
+}
+/*****************************************************************************/
+
+static int hinfc610_send_cmd_readid(struct hinfc_host *host)
+{
+ if (HINFC610_IS_SYNC(host))
+ return hinfc610_send_cmd_sync_readid(host);
+ else
+ return hinfc610_send_cmd_async_readid(host);
+}
+/*****************************************************************************/
+
+static int hinfc610_enable_ecc_randomizer(struct hinfc_host *host, int ecc_en,
+ int randomizer_en)
+{
+ unsigned int nfc_con;
+
+ if (IS_NAND_RANDOM(host)) {
+ if (randomizer_en) {
+ host->NFC_CON |= HINFC610_CON_RANDOMIZER_EN;
+ host->NFC_CON_ECC_NONE |= HINFC610_CON_RANDOMIZER_EN;
+ } else {
+ host->NFC_CON &= ~HINFC610_CON_RANDOMIZER_EN;
+ host->NFC_CON_ECC_NONE &= ~HINFC610_CON_RANDOMIZER_EN;
+ }
+ }
+
+ nfc_con = (ecc_en ? host->NFC_CON : host->NFC_CON_ECC_NONE);
+
+ hinfc_write(host, nfc_con, HINFC610_CON);
+
+ return 0;
+}
+/*****************************************************************************/
+
+static int hinfc610_send_cmd_status(struct hinfc_host *host)
+{
+ unsigned int regval;
+
+ host->enable_ecc_randomizer(host, DISABLE, DISABLE);
+
+ hinfc_write(host, HINFC610_NANDINFO_LEN, HINFC610_DATA_NUM);
+ hinfc_write(host, NAND_CMD_STATUS, HINFC610_CMD);
+
+ /* no need config HINFC610_OP_WAIT_READY_EN, here not config */
+ regval = HINFC610_OP_CMD1_EN
+ | HINFC610_OP_READ_DATA_EN
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK)
+ << HINFC610_OP_NF_CS_SHIFT);
+
+ hinfc_write(host, regval, HINFC610_OP);
+
+ WAIT_CONTROLLER_FINISH();
+
+ return 0;
+}
+
+/*****************************************************************************/
+static int hinfc610_send_cmd_async_reset(struct hinfc_host *host,
+ int chipselect)
+{
+ unsigned int regval;
+
+ hinfc_write(host, NAND_CMD_RESET, HINFC610_CMD);
+
+ /* need to config HINFC610_OP_WAIT_READY_EN */
+ regval = HINFC610_OP_CMD1_EN
+ | ((((unsigned int)chipselect & HINFC610_OP_NF_CS_MASK)
+ << HINFC610_OP_NF_CS_SHIFT)
+ | HINFC610_OP_WAIT_READY_EN);
+
+ hinfc_write(host, regval, HINFC610_OP);
+
+ WAIT_CONTROLLER_FINISH();
+
+ return 0;
+}
+/*****************************************************************************/
+
+static int hinfc610_send_cmd_sync_reset(struct hinfc_host *host,
+ int chipselect)
+{
+ unsigned int regval;
+
+ /*
+ * Regarding the ONFI chip sync mode,
+ * NAND_CMD_SYNC_RESET make chip remain sync mode.
+ * But NAND_CMD_RESET will change chip mode to async mode.
+ */
+ hinfc_write(host, NAND_CMD_SYNC_RESET, HINFC610_CMD);
+
+ /* need to config HINFC610_OP_WAIT_READY_EN */
+ regval = HINFC610_OP_CMD1_EN
+ | (((unsigned int)chipselect & HINFC610_OP_NF_CS_MASK)
+ << HINFC610_OP_NF_CS_SHIFT)
+ | HINFC610_OP_WAIT_READY_EN;
+
+ hinfc_write(host, regval, HINFC610_OP);
+
+ WAIT_CONTROLLER_FINISH();
+
+ return 0;
+}
+/*****************************************************************************/
+
+static int hinfc610_send_cmd_reset(struct hinfc_host *host, int chipselect)
+{
+ if (HINFC610_IS_SYNC(host))
+ return hinfc610_send_cmd_sync_reset(host, chipselect);
+ else
+ return hinfc610_send_cmd_async_reset(host, chipselect);
+}
+/*****************************************************************************/
+
+int hinfc610_dev_ready(struct mtd_info *mtd)
+{
+ return 0x1;
+}
+/*****************************************************************************/
+
+void hinfc610_select_chip(struct mtd_info *mtd, int chipselect)
+{
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hinfc_host *host = chip->priv;
+
+ if (chipselect < 0)
+ return;
+
+ if (chipselect > CONFIG_HINFC610_MAX_CHIP)
+ PR_BUG("invalid chipselect: %d\n", chipselect);
+
+ host->chipselect = chipselect;
+}
+/*****************************************************************************/
+
+uint8_t hinfc610_read_byte(struct mtd_info *mtd)
+{
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hinfc_host *host = chip->priv;
+
+ if (host->command == NAND_CMD_STATUS)
+ return readb(chip->IO_ADDR_R);
+
+ host->offset++;
+
+ if (host->command == NAND_CMD_READID)
+ return readb(chip->IO_ADDR_R + host->offset - 1);
+
+ return readb(host->buffer + host->column + host->offset - 1);
+}
+/*****************************************************************************/
+
+u16 hinfc610_read_word(struct mtd_info *mtd)
+{
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hinfc_host *host = chip->priv;
+
+ host->offset += 2;
+ return readw(host->buffer + host->column + host->offset - 2);
+}
+/*****************************************************************************/
+
+void hinfc610_write_buf(struct mtd_info *mtd, const uint8_t *buf,
+ int len)
+{
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hinfc_host *host = chip->priv;
+
+ memcpy(host->buffer + host->column + host->offset, buf, len);
+ host->offset += len;
+}
+/*****************************************************************************/
+static void hinfc610_ecc_err_num_count(struct mtd_info *mtd,
+ uint8_t ecc_st, int reg)
+{
+ u_char err_num;
+
+ if (ecc_st > 4)
+ ecc_st = 4;
+
+ while (ecc_st) {
+ err_num = GET_ECC_ERR_NUM(--ecc_st, reg);
+ if (err_num == 0xff)
+ mtd->ecc_stats.failed++;
+ else
+ mtd->ecc_stats.corrected += err_num;
+ }
+}
+
+/*****************************************************************************/
+
+void hinfc610_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
+{
+ struct nand_chip *chip = mtd_to_nand(mtd);
+ struct hinfc_host *host = chip->priv;
+ int reg;
+ uint8_t ecc_step = host->pagesize >> 10;
+
+ memcpy(buf, host->buffer + host->column + host->offset, len);
+ host->offset += len;
+
+ /* 2K or 4K or 8K(1) or 16K(1-1) pagesize */
+ reg = hinfc_read(host, HINFC_ECC_ERR_NUM0_BUF0);
+ hinfc610_ecc_err_num_count(mtd, ecc_step, reg);
+
+ if (ecc_step > 4) {
+ /* 8K(2) or 16K(1-2) pagesize */
+ reg = hinfc_read(host, HINFC_ECC_ERR_NUM1_BUF0);
+ hinfc610_ecc_err_num_count(mtd, ecc_step, reg);
+ if (ecc_step > 8) {
+ /* 16K(2-1) pagesize */
+ reg = hinfc_read(host, HINFC_ECC_ERR_NUM0_BUF1);
+ hinfc610_ecc_err_num_count(mtd, ecc_step, reg);
+ /* 16K(2-2) pagesize */
+ reg = hinfc_read(host, HINFC_ECC_ERR_NUM1_BUF1);
+ hinfc610_ecc_err_num_count(mtd, ecc_step, reg);
+ }
+ }
+}
+/*****************************************************************************/
+/*
+ * 'host->epm' only use the first oobfree[0] field, it looks very simple, But...
+ */
+
+/* Default OOB area layout */
+static int hinfc_ooblayout_ecc_64(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *oobregion)
+{
+ if (section)
+ return -ERANGE;
+
+ oobregion->length = 32;
+ oobregion->offset = 32;
+
+ return 0;
+}
+
+static int hinfc_ooblayout_free_64(struct mtd_info *mtd, int section,
+ struct mtd_oob_region *oobregion)
+{
+ if (section)
+ return -ERANGE;
+
+ oobregion->length = 30;
+ oobregion->offset = 2;
+
+ return 0;
+}
+
+static struct mtd_ooblayout_ops hinfc_ooblayout_64_ops = {
+ .ecc = hinfc_ooblayout_ecc_64,
+ .free = hinfc_ooblayout_free_64,
+};
+
+/*****************************************************************************/
+
+static struct nand_config_info hinfc610_soft_auto_config_table[] = {
+ {NAND_PAGE_16K, NAND_ECC_64BIT, 60, 1824/*1824*/, &hinfc_ooblayout_64_ops},
+ {NAND_PAGE_16K, NAND_ECC_40BIT, 40, 1200/*1152*/, &hinfc_ooblayout_64_ops},
+ {NAND_PAGE_16K, NAND_ECC_NONE, 0, 32, &hinfc_ooblayout_64_ops},
+
+ {NAND_PAGE_8K, NAND_ECC_64BIT, 60, 928 /*928*/, &hinfc_ooblayout_64_ops},
+ {NAND_PAGE_8K, NAND_ECC_40BIT, 40, 600 /*592*/, &hinfc_ooblayout_64_ops},
+ {NAND_PAGE_8K, NAND_ECC_24BIT, 24, 368 /*368*/, &hinfc_ooblayout_64_ops},
+ {NAND_PAGE_8K, NAND_ECC_NONE, 0, 32, &hinfc_ooblayout_64_ops},
+
+ {NAND_PAGE_4K, NAND_ECC_24BIT, 24, 200 /*200*/, &hinfc_ooblayout_64_ops},
+ {NAND_PAGE_4K, NAND_ECC_4BIT_512, 8, 128 /*88*/, &hinfc_ooblayout_64_ops},
+ {NAND_PAGE_4K, NAND_ECC_NONE, 0, 32, &hinfc_ooblayout_64_ops},
+
+ {NAND_PAGE_2K, NAND_ECC_24BIT, 24, 128 /*116*/, &hinfc_ooblayout_64_ops},
+ {NAND_PAGE_2K, NAND_ECC_4BIT_512, 8, 64 /*60*/, &hinfc_ooblayout_64_ops},
+ {NAND_PAGE_2K, NAND_ECC_NONE, 0, 32, &hinfc_ooblayout_64_ops},
+
+ {0, 0, 0, 0, NULL},
+};
+/*****************************************************************************/
+/* used the best correct arithmetic. */
+struct nand_config_info *hinfc610_get_best_ecc(struct mtd_info *mtd)
+{
+ struct nand_config_info *best = NULL;
+ struct nand_config_info *config = hinfc610_soft_auto_config_table;
+
+ for (; config->ooblayout_ops; config++) {
+ if (nandpage_type2size(config->pagetype) != mtd->writesize)
+ continue;
+
+ if (mtd->oobsize < config->oobsize)
+ continue;
+
+ if (!best || (best->ecctype < config->ecctype))
+ best = config;
+ }
+
+ if (!best)
+ PR_BUG(ERSTR_DRIVER
+ "Driver does not support the pagesize(%d) "
+ "and oobsize(%d).\n",
+ mtd->writesize, mtd->oobsize);
+
+ return best;
+}
+/*****************************************************************************/
+/* force the pagesize and ecctype */
+struct nand_config_info *hinfc610_force_ecc(struct mtd_info *mtd, int pagetype,
+ int oobsize, char *cfgmsg,
+ int allow_pagediv)
+{
+ struct nand_config_info *fit = NULL;
+ struct nand_config_info *config = hinfc610_soft_auto_config_table;
+
+ for (; config->ooblayout_ops; config++) {
+ if (config->pagetype == pagetype
+ && config->oobsize <= oobsize) {
+ fit = config;
+ break;
+ }
+ }
+
+ if (!fit) {
+ PR_BUG(ERSTR_DRIVER
+ "Driver(%s mode) does not support this Nand Flash "
+ "pagesize:%s, oobsize:%d\n",
+ cfgmsg,
+ nand_page_name(pagetype),
+ oobsize);
+ return NULL;
+ }
+ return fit;
+}
+/*****************************************************************************/
+static unsigned int nand_otp_len;
+static unsigned char nand_otp[128] = {0};
+
+/* Get NAND parameter table. */
+static int __init parse_nand_param(const struct tag *tag)
+{
+ if (tag->hdr.size <= 2)
+ return 0;
+
+ nand_otp_len = ((tag->hdr.size << 2) - sizeof(struct tag_header));
+
+ if (nand_otp_len > sizeof(nand_otp)) {
+ pr_warn("%s(%d): Get Nand OTP from tag fail.\n",
+ __func__, __LINE__);
+ return 0;
+ }
+ memcpy(nand_otp, &tag->u, nand_otp_len);
+ return 0;
+}
+/* 0x48694E77 equal to fastoot ATAG_NAND_PARAM */
+__tagtable(0x48694E77, parse_nand_param);
+
+/*****************************************************************************/
+int hinfc610_ecc_type2reg_intf(int type, struct hinfc_host *host)
+{
+ if (HINFC_VER_620 == host->version)
+ return hinfc620_ecc_type2reg(type);
+ else
+ return hinfc610_ecc_type2reg(type);
+}
+/*****************************************************************************/
+int hinfc610_ecc_reg2type_intf(int reg, struct hinfc_host *host)
+{
+ if (HINFC_VER_620 == host->version)
+ return hinfc620_ecc_reg2type(reg);
+ else
+ return hinfc610_ecc_reg2type(reg);
+}
+
+/*****************************************************************************/
+static int hinfc610_param_adjust(struct mtd_info *mtd, struct nand_chip *chip,
+ struct nand_dev_t *nand_dev)
+{
+ int pagetype;
+ int oobsize;
+ int regval;
+ char *start_type = "unknown";
+ struct nand_config_info *best = NULL;
+ struct hinfc_host *host = chip->priv;
+ struct mtd_oob_region *hinfc_oobregion;
+
+ hinfc_oobregion = kmalloc(sizeof(struct mtd_oob_region), GFP_KERNEL);
+ if (!hinfc_oobregion) {
+ PR_BUG("failed to allocate hinfc_oobregion structure.\n");
+ return -ENOMEM;
+ }
+
+ if (IS_NANDC_HW_AUTO(host))
+ start_type = "HW-Auto";
+ else
+ start_type = "HW-Reg";
+
+ if ((mtd->writesize == SZ_8K)
+ || (mtd->writesize == SZ_16K)
+ || (mtd->writesize == SZ_32K))
+ host->flags |= NAND_RANDOMIZER;
+
+ pagetype = nandpage_size2type(mtd->writesize);
+ oobsize = mtd->oobsize;
+
+ best = hinfc610_force_ecc(mtd, pagetype, oobsize,
+ start_type, 0);
+
+#ifdef CONFIG_HINFC610_PAGESIZE_AUTO_ECC_NONE
+# ifdef CONFIG_HINFC610_AUTO_PAGESIZE_ECC
+# error you SHOULD NOT define CONFIG_HINFC610_PAGESIZE_AUTO_ECC_NONE \
+ and CONFIG_HINFC610_AUTO_PAGESIZE_ECC at the same time
+# endif
+# ifdef CONFIG_HINFC610_HARDWARE_PAGESIZE_ECC
+# error you SHOULD NOT define CONFIG_HINFC610_PAGESIZE_AUTO_ECC_NONE \
+ and CONFIG_HINFC610_HARDWARE_PAGESIZE_ECC at the same time
+# endif
+
+ pagetype = nandpage_size2type(mtd->writesize);
+ oobsize = 32;
+ best = hinfc610_force_ecc(mtd, pagetype, oobsize,
+ "force config", 0);
+ start_type = "AutoForce";
+
+#endif /* CONFIG_HINFC610_PAGESIZE_AUTO_ECC_NONE */
+
+ if (!best) {
+ kfree(hinfc_oobregion);
+ PR_BUG(ERSTR_HARDWARE
+ "Please configure Nand Flash pagesize and ecctype!\n");
+ return -1;
+ }
+
+ /* only in case fastboot check randomizer failed.
+ * Update fastboot or configure hardware randomizer pin
+ * fix this problem.
+ */
+ if (IS_NAND_RANDOM(nand_dev) && !(IS_NAND_RANDOM(host)))
+ PR_BUG(ERSTR_HARDWARE
+ "Hardware is not configure randomizer, "
+ "but it is more suitable for this Nand Flash. "
+ "1. Please configure hardware randomizer PIN."
+ "2. Please updata fastboot.\n");
+
+ host->flags |= (IS_NAND_RANDOM(nand_dev) |
+ IS_NAND_SYNC_ASYNC(nand_dev) |
+ IS_NAND_ONLY_SYNC(nand_dev) |
+ IS_NAND_ONFI(nand_dev));
+
+ /* only for print nand info. */
+ nand_dev->flags |= (IS_NANDC_HW_AUTO(host) |
+ IS_NANDC_SYNC_BOOT(host));
+
+ /* only in case fastboot check sync boot pin failed.
+ * Update fastboot or configure hardware sync boot pin fix this problem.
+ */
+ if (IS_NANDC_SYNC_BOOT(host)) {
+ /* But NAND do not support sync mode, warning ! */
+ if (!IS_NAND_ONLY_SYNC(nand_dev))
+ PR_BUG(ERSTR_HARDWARE
+ "Hardware SYNC BOOT PIN has configured sync mode, "
+ "but the Nand Flash is async mode.\n"
+ "1. DO NOT configure SYNC BOOT PIN. "
+ "2. Update fastboot.\n");
+ } else {
+ if (IS_NAND_ONLY_SYNC(nand_dev))
+ PR_BUG(ERSTR_HARDWARE
+ "Hardware SYNC BOOT PIN has configured async mode, "
+ "but the Nand Flash only support sync mode.\n"
+ "1. Please configure SYNC BOOT PIN."
+ "2. Update fastboot.\n");
+ }
+
+ if (IS_NAND_SYNC_ASYNC(nand_dev))
+ hinfc610_get_sync_info(host);
+
+ if (best->ecctype != NAND_ECC_NONE)
+ mtd->oobsize = best->oobsize;
+
+ if (best->ooblayout_ops->free)
+ best->ooblayout_ops->free(mtd, 0, hinfc_oobregion);
+
+ host->ecctype = best->ecctype;
+ host->pagesize = nandpage_type2size(best->pagetype);
+ host->oobsize = mtd->oobsize;
+ host->block_page_mask = ((mtd->erasesize / mtd->writesize) - 1);
+
+ host->buffer = dma_alloc_coherent(host->dev,
+ (host->pagesize + host->oobsize),
+ &host->dma_buffer, GFP_KERNEL);
+ if (!host->buffer) {
+ kfree(hinfc_oobregion);
+ PR_BUG("Can't malloc memory for NAND driver.");
+ return -EIO;
+ }
+ memset(host->buffer, 0xff, (host->pagesize + host->oobsize));
+
+ host->dma_oob = host->dma_buffer + host->pagesize;
+ host->bbm = (unsigned char *)(host->buffer
+ + host->pagesize + HINFC_BAD_BLOCK_POS);
+
+ host->epm = (unsigned short *)(host->buffer
+ + host->pagesize + hinfc_oobregion->offset + 28);
+
+ regval = ~(HINFC610_CON_PAGESIZE_MASK << HINFC610_CON_PAGEISZE_SHIFT);
+ host->NFC_CON &= regval;
+ host->NFC_CON_ECC_NONE &= regval;
+ regval = (hinfc610_page_type2reg(best->pagetype)
+ & HINFC610_CON_PAGESIZE_MASK) << HINFC610_CON_PAGEISZE_SHIFT;
+ host->NFC_CON |= regval;
+ host->NFC_CON_ECC_NONE |= regval;
+
+ regval = ~(HINFC610_CON_ECCTYPE_MASK << HINFC610_CON_ECCTYPE_SHIFT);
+ host->NFC_CON &= regval;
+ host->NFC_CON_ECC_NONE &= regval;
+ regval = (hinfc610_ecc_type2reg_intf(best->ecctype, host)
+ & HINFC610_CON_ECCTYPE_MASK) << HINFC610_CON_ECCTYPE_SHIFT;
+ host->NFC_CON |= regval;
+
+ if (mtd->writesize > NAND_MAX_PAGESIZE ||
+ mtd->oobsize > NAND_MAX_OOBSIZE) {
+ PR_BUG(ERSTR_DRIVER
+ "Driver does not support this Nand Flash. "
+ "Please increase NAND_MAX_PAGESIZE and NAND_MAX_OOBSIZE.\n");
+ }
+
+ if (mtd->writesize != host->pagesize) {
+ unsigned int shift = 0;
+ unsigned int writesize = mtd->writesize;
+
+ while (writesize > host->pagesize) {
+ writesize >>= 1;
+ shift++;
+ }
+ chip->chipsize = chip->chipsize >> shift;
+ mtd->erasesize = mtd->erasesize >> shift;
+ mtd->writesize = host->pagesize;
+ PR_MSG("Nand divide into 1/%u\n", (1 << shift));
+ }
+
+ nand_dev->start_type = start_type;
+ nand_dev->ecctype = host->ecctype;
+ nand_dev->oobsize = mtd->oobsize;
+
+ host->read_retry = NULL;
+ if (nand_dev->read_retry_type != NAND_RR_NONE) {
+ host->read_retry
+ = hinfc610_find_read_retry(nand_dev->read_retry_type);
+ if (!host->read_retry) {
+ PR_BUG(ERSTR_DRIVER
+ "This Nand Flash need to enable the "
+ "'read retry' feature. "
+ "but the driver dose not offer the feature");
+ }
+
+ if (nand_otp_len)
+ memcpy(host->rr_data, nand_otp, nand_otp_len);
+ }
+
+ /*
+ * If it want to support the 'read retry' feature, the 'randomizer'
+ * feature must be support first.
+ */
+ if (host->read_retry && !IS_NAND_RANDOM(host)) {
+ PR_BUG(ERSTR_HARDWARE
+ "This Nand flash need to enable 'randomizer' feature. "
+ "Please configure hardware randomizer PIN.");
+ }
+
+
+ mtd_set_ooblayout(mtd, &hinfc_ooblayout_64_ops);
+ hinfc610_dbg_init(host);
+
+ kfree(hinfc_oobregion);
+
+ return 0;
+}
+/*****************************************************************************/
+
+int hinfc610_nand_init(struct hinfc_host *host, struct nand_chip *chip)
+{
+ unsigned int regval;
+
+ host->version = hinfc_read(host, HINFC610_VERSION);
+
+ host->addr_cycle = 0;
+ host->addr_value[0] = 0;
+ host->addr_value[1] = 0;
+ host->cache_addr_value[0] = ~0;
+ host->cache_addr_value[1] = ~0;
+ host->chipselect = 0;
+
+ host->send_cmd_pageprog = hinfc610_send_cmd_pageprog;
+ host->send_cmd_readstart = hinfc610_send_cmd_readstart;
+ host->send_cmd_erase = hinfc610_send_cmd_erase;
+ host->send_cmd_readid = hinfc610_send_cmd_readid;
+ host->send_cmd_status = hinfc610_send_cmd_status;
+ host->send_cmd_reset = hinfc610_send_cmd_reset;
+
+ host->flags = 0;
+
+ regval = hinfc_read(host, HINFC610_CON);
+
+ host->NFC_CON = (regval
+ | HINFC610_CON_OP_MODE_NORMAL
+ | HINFC610_CON_READY_BUSY_SEL);
+
+ host->NFC_CON_ECC_NONE = host->NFC_CON
+ & (~(HINFC610_CON_ECCTYPE_MASK
+ << HINFC610_CON_ECCTYPE_SHIFT))
+ & (~HINFC610_CON_RANDOMIZER_EN);
+
+ hinfc_write(host,
+ (SET_HINFC610_PWIDTH(CONFIG_HINFC610_W_LATCH,
+ CONFIG_HINFC610_R_LATCH,
+ CONFIG_HINFC610_RW_LATCH)),
+ HINFC610_PWIDTH);
+
+ host->flags |= NANDC_HW_AUTO;
+
+ /* check if chip is sync mode. */
+ if (regval & HINFC610_BOOT_CFG_SYC_NAND_PAD) {
+ host->flags |= NANDC_IS_SYNC_BOOT;
+
+ /*
+ * NAND default is sync mode, and read id, reset in sync mode.
+ */
+ host->NFC_CON |= HINFC610_CON_NF_MODE_TOGGLE;
+ host->NFC_CON_ECC_NONE |= HINFC610_CON_NF_MODE_TOGGLE;
+
+ /* set synchronous clock and timing. */
+ clk_prepare_enable(host->clk);
+ }
+
+ memset((char *)chip->IO_ADDR_R,
+ 0xff, HINFC610_BUFFER_BASE_ADDRESS_LEN);
+
+ host->enable_ecc_randomizer = hinfc610_enable_ecc_randomizer;
+ hinfc_param_adjust = hinfc610_param_adjust;
+
+ return 0;
+}
diff --git a/drivers/mtd/nand/hinfc610/hinfc610.h b/drivers/mtd/nand/hinfc610/hinfc610.h
new file mode 100644
index 0000000..18d90fd
--- /dev/null
+++ b/drivers/mtd/nand/hinfc610/hinfc610.h
@@ -0,0 +1,512 @@
+/*
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#ifndef HINFCV610H
+#define HINFCV610H
+/******************************************************************************/
+
+#ifndef CONFIG_HINFC610_W_LATCH
+ #define CONFIG_HINFC610_W_LATCH (5)
+#endif /* CONFIG_HINFC610_W_LATCH */
+
+#ifndef CONFIG_HINFC610_R_LATCH
+ #define CONFIG_HINFC610_R_LATCH (7)
+#endif /* CONFIG_HINFC610_R_LATCH */
+
+#ifndef CONFIG_HINFC610_RW_LATCH
+ #define CONFIG_HINFC610_RW_LATCH (3)
+#endif /* CONFIG_HINFC610_RW_LATCH */
+
+#ifndef CONFIG_HINFC610_MAX_CHIP
+ #define CONFIG_HINFC610_MAX_CHIP (1)
+ #warning NOT config CONFIG_HINFC610_MAX_CHIP, \
+ used default value, maybe invalid.
+#endif /* CONFIG_HINFC610_MAX_CHIP */
+/*****************************************************************************/
+#define HINFC_ECC_ERR_NUM0_BUF0 0xa0
+#define HINFC_ECC_ERR_NUM1_BUF0 0xa4
+#define HINFC_ECC_ERR_NUM0_BUF1 0xa8
+#define HINFC_ECC_ERR_NUM1_BUF1 0xcc
+
+#define GET_ECC_ERR_NUM(_i, _reg) (((_reg) >> ((_i) * 8)) & 0xff)
+
+/*****************************************************************************/
+#define HINFC610_REG_BASE_ADDRESS_LEN (0x100)
+#define HINFC610_BUFFER_BASE_ADDRESS_LEN (2048 + 128)
+
+#define HINFC610_CHIP_DELAY (25)
+
+#define HINFC610_ADDR_CYCLE_MASK 0x4
+#define HINFC610_DMA_ADDR_OFFSET 4096
+/*****************************************************************************/
+#define HINFC610_CON 0x00
+#define HINFC610_CON_OP_MODE_NORMAL (1U << 0)
+#define HINFC610_CON_PAGEISZE_SHIFT (1)
+#define HINFC610_CON_PAGESIZE_MASK (0x07)
+#define HINFC610_CON_BUS_WIDTH (1U << 4)
+#define HINFC610_CON_READY_BUSY_SEL (1U << 8)
+#define HINFC610_CON_ECCTYPE_SHIFT (9)
+#define HINFC610_CON_ECCTYPE_MASK (0x0f)
+#define HINFC610_CON_RANDOMIZER_EN (1 << 14)
+#define HINFC610_CON_NF_MODE_SHIFT 15
+#define HINFC610_CON_NF_MODE_MASK (3 << HINFC610_CON_NF_MODE_SHIFT)
+#define HINFC610_CON_NF_MODE_TOGGLE (1 << HINFC610_CON_NF_MODE_SHIFT)
+#define HINFC610_CON_NF_MODE_ONFI_23 (2 << HINFC610_CON_NF_MODE_SHIFT)
+#define HINFC610_CON_NF_MODE_ONFI_30 (3 << HINFC610_CON_NF_MODE_SHIFT)
+
+#define HINFC610_PWIDTH 0x04
+#define SET_HINFC610_PWIDTH(_w_lcnt, _r_lcnt, _rw_hcnt) \
+ ((_w_lcnt) | (((_r_lcnt) & 0x0F) << 4) | (((_rw_hcnt) & 0x0F) << 8))
+
+#define HINFC610_CMD 0x0C
+#define HINFC610_ADDRL 0x10
+#define HINFC610_ADDRH 0x14
+#define HINFC610_DATA_NUM 0x18
+
+#define HINFC610_OP 0x1C
+#define HINFC610_OP_READ_STATUS_EN (1U << 0)
+#define HINFC610_OP_READ_DATA_EN (1U << 1)
+#define HINFC610_OP_WAIT_READY_EN (1U << 2)
+#define HINFC610_OP_CMD2_EN (1U << 3)
+#define HINFC610_OP_WRITE_DATA_EN (1U << 4)
+#define HINFC610_OP_ADDR_EN (1U << 5)
+#define HINFC610_OP_CMD1_EN (1U << 6)
+#define HINFC610_OP_NF_CS_SHIFT (7)
+#define HINFC610_OP_NF_CS_MASK (3)
+#define HINFC610_OP_ADDR_CYCLE_SHIFT (9)
+#define HINFC610_OP_ADDR_CYCLE_MASK (7)
+#define HINFC610_OP_READID_EN (1U << 12)
+#define HINFC610_OP_RW_REG_EN (1U << 13)
+
+#define HINFC610_STATUS 0x20
+
+#define HINFC610_INTS 0x28
+#define HINFC610_INTS_UE (1U << 6)
+#define HINFC610_INTCLR 0x2C
+#define HINFC610_INTCLR_UE (1U << 6)
+#define HINFC610_INTCLR_CE (1U << 5)
+
+#define HINFC610_DMA_CTRL 0x60
+#define HINFC610_DMA_CTRL_DMA_START (1U << 0)
+#define HINFC610_DMA_CTRL_WE (1U << 1)
+#define HINFC610_DMA_CTRL_BURST4_EN (1U << 4)
+#define HINFC610_DMA_CTRL_BURST8_EN (1U << 5)
+#define HINFC610_DMA_CTRL_BURST16_EN (1U << 6)
+#define HINFC610_DMA_CTRL_ADDR_NUM_SHIFT (7)
+#define HINFC610_DMA_CTRL_ADDR_NUM_MASK (1)
+#define HINFC610_DMA_CTRL_CS_SHIFT (8)
+#define HINFC610_DMA_CTRL_CS_MASK (0x03)
+
+#define HINFC610_DMA_ADDR_DATA 0x64
+#define HINFC610_DMA_ADDR_OOB 0x68
+#define HINFC610_DMA_ADDR_DATA1 0xB4
+#define HINFC610_DMA_ADDR_DATA2 0xB8
+#define HINFC610_DMA_ADDR_DATA3 0xBC
+#define HINFC610_DMA_ADDR_DATA4 0xEC
+#define HINFC610_DMA_ADDR_DATA5 0xF0
+#define HINFC610_DMA_ADDR_DATA6 0xF4
+#define HINFC610_DMA_ADDR_DATA7 0xF8
+
+#define HINFC610_DMA_LEN 0x6C
+#define HINFC610_DMA_LEN_OOB_SHIFT (16)
+#define HINFC610_DMA_LEN_OOB_MASK (0x1FFF)
+
+#define HINFC610_DMA_PARA 0x70
+#define HINFC610_DMA_PARA_DATA_RW_EN (1U << 0)
+#define HINFC610_DMA_PARA_OOB_RW_EN (1U << 1)
+#define HINFC610_DMA_PARA_DATA_EDC_EN (1U << 2)
+#define HINFC610_DMA_PARA_OOB_EDC_EN (1U << 3)
+#define HINFC610_DMA_PARA_EXT_LEN_SHIFT (6)
+#define HINFC610_DMA_PARA_EXT_LEN_MASK (0x03)
+
+#define HINFC610_VERSION 0x74
+#define HINFC610_LOG_READ_ADDR 0x7C
+#define HINFC610_LOG_READ_LEN 0x80
+
+#define HINFC610_ECC_REG0 0xA0
+#define HINFC610_ECC_REG1 0xA4
+#define HINFC610_ECC_REG2 0xA8
+#define HINFC610_ECC_REG3 0xAC
+
+#define HINFC610_RANDOMIZER 0xC0
+#define HINFC610_RANDOMIZER_PAD 0x02
+#define HINFC610_RANDOMIZER_ENABLE 0x01
+/* read nand id or nand status, return from nand data length */
+#define HINFC610_NANDINFO_LEN 0x10
+
+#define HINFC610_BOOT_CFG 0xC4
+#define HINFC610_BOOT_CFG_RANDOMIZER_PAD 0x01
+#define HINFC610_BOOT_CFG_SAVE_PIN_MODE_SHIFT 13
+#define HINFC610_BOOT_CFG_SAVE_PIN_MODE \
+ (1U << HINFC610_BOOT_CFG_SAVE_PIN_MODE_SHIFT)
+#define HINFC610_BOOT_CFG_SYC_NAND_PAD_SHIFT 12
+#define HINFC610_BOOT_CFG_SYC_NAND_PAD \
+ (1U << HINFC610_BOOT_CFG_SYC_NAND_PAD_SHIFT)
+
+#define HINFC610_SYNC_TIMING 0xD0
+
+/* ONFI: sync nand timing config */
+#define HINFC610_SYNC_ONFI_T_CAD (0xF << 24)
+#define HINFC610_SYNC_ONFI_T_DQZ (0xF << 20)
+
+/* TOGGLE: sync nand timing config */
+#define HINFC610_SYNC_TOGGLE_PRE_RDQS (0xF << 16)
+#define HINFC610_SYNC_TOGGLE_POST_RDQS (0xF << 12)
+#define HINFC610_SYNC_TOGGLE_PRE_WDQS (0xF << 8)
+#define HINFC610_SYNC_TOGGLE_POST_WDQS (0xF << 4)
+#define HINFC610_SYNC_TOGGLE_RW_PSTH (0xF << 0)
+
+/*****************************************************************************/
+/*
+ * This constant declares the max. oobsize / page, which
+ * is supported now. If you add a chip with bigger oobsize/page
+ * adjust this accordingly.
+ */
+#define NAND_MAX_OOBSIZE 4800
+#define NAND_MAX_PAGESIZE 32768
+
+/* DMA address align with 32 bytes. */
+#define HINFC610_DMA_ALIGN 64
+/*****************************************************************************/
+#include "../hinfc_gen.h"
+
+#undef READ
+#define READ 1
+
+#undef WRITE
+#define WRITE 0
+
+#undef FALSE
+#define FALSE 0
+
+#undef TRUE
+#define TRUE 1
+
+#undef ENABLE
+#define ENABLE 1
+
+#undef DISABLE
+#define DISABLE 0
+/*****************************************************************************/
+
+struct hinfc_host {
+ struct nand_chip *chip;
+ struct mtd_info *mtd;
+ void __iomem *iobase;
+ struct device *dev;
+
+ unsigned int offset;
+ unsigned int command;
+
+ int chipselect;
+
+ unsigned int n24bit_ext_len;
+ int ecctype;
+
+/* Current system has already gone to sync mode */
+#define HINFC610_IS_SYNC(_host) ((_host)->NFC_CON & HINFC610_CON_NF_MODE_MASK)
+ unsigned long NFC_CON;
+ unsigned long NFC_CON_ECC_NONE;
+
+ unsigned int addr_cycle;
+ unsigned int addr_value[2];
+ unsigned int cache_addr_value[2];
+ unsigned int column;
+ unsigned int block_page_mask;
+
+ unsigned int dma_oob;
+ unsigned int dma_buffer;
+ unsigned int pagesize;
+ unsigned int oobsize;
+ /* This is maybe an un-aligment address, only for malloc or free */
+ char *buforg;
+ char *buffer;
+
+ int need_rr_data;
+#define HINFC_READ_RETRY_DATA_LEN 128
+ char rr_data[HINFC_READ_RETRY_DATA_LEN];
+ int version;
+ int add_partition;
+
+ /* BOOTROM read two bytes to detect the bad block flag */
+#define HINFC_BAD_BLOCK_POS 0
+ unsigned char *bbm; /* nand bad block mark */
+ unsigned short *epm; /* nand empty page mark */
+ unsigned int flags;
+
+#define HINFC610_PS_UC_ECC 0x01 /* page has ecc error */
+#define HINFC610_PS_BAD_BLOCK 0x02 /* bad block */
+#define HINFC610_PS_EMPTY_PAGE 0x04 /* page is empty */
+#define HINFC610_PS_EPM_ERROR 0x0100 /* empty page mark word has ecc error*/
+#define HINFC610_PS_BBM_ERROR 0x0200 /* bad block mark word has ecc error*/
+ unsigned int page_status;
+
+ struct clk *clk;
+
+ int (*send_cmd_pageprog)(struct hinfc_host *host);
+ int (*send_cmd_status)(struct hinfc_host *host);
+ int (*send_cmd_readstart)(struct hinfc_host *host);
+ int (*send_cmd_erase)(struct hinfc_host *host);
+ int (*send_cmd_readid)(struct hinfc_host *host);
+ int (*send_cmd_reset)(struct hinfc_host *host, int chipselect);
+ int (*enable)(struct hinfc_host *host, int enable);
+
+ int (*enable_ecc_randomizer)(struct hinfc_host *host,
+ int ecc_en, int randomizer_en);
+
+ struct read_retry_t *read_retry;
+ struct nand_sync *sync;
+};
+
+#define HINFC610_UC_ECC 0x01
+#define HINFC610_BAD_BLOCK 0x02
+#define HINFC610_EMPTY_PAGE 0x04
+
+#define IS_PS_EMPTY_PAGE(_host) ((_host)->page_status & HINFC610_PS_EMPTY_PAGE)
+#define IS_PS_BAD_BLOCK(_host) ((_host)->page_status & HINFC610_PS_BAD_BLOCK)
+#define IS_PS_UN_ECC(_host) ((_host)->page_status & HINFC610_PS_UC_ECC)
+#define IS_PS_EPM_ERR(_host) ((_host)->page_status & HINFC610_PS_EPM_ERROR)
+#define IS_PS_BBM_ERR(_host) ((_host)->page_status & HINFC610_PS_BBM_ERROR)
+
+/*****************************************************************************/
+
+#define HINFC610_READ_1CMD_0ADD_NODATA \
+ (HINFC610_OP_CMD1_EN \
+ | ((host->chipselect & HINFC610_OP_NF_CS_MASK) \
+ << HINFC610_OP_NF_CS_SHIFT))
+
+#define HINFC610_READ_1CMD_1ADD_DATA \
+ (HINFC610_OP_CMD1_EN \
+ | HINFC610_OP_ADDR_EN \
+ | HINFC610_OP_READ_DATA_EN \
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK) \
+ << HINFC610_OP_NF_CS_SHIFT) \
+ | (1 << HINFC610_OP_ADDR_CYCLE_SHIFT))
+
+#define HINFC610_READ_1CMD_1ADD_DATA_WAIT_READY \
+ (HINFC610_OP_CMD1_EN \
+ | HINFC610_OP_ADDR_EN \
+ | HINFC610_OP_READ_DATA_EN \
+ | HINFC610_OP_WAIT_READY_EN \
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK) \
+ << HINFC610_OP_NF_CS_SHIFT) \
+ | (1 << HINFC610_OP_ADDR_CYCLE_SHIFT))
+
+#define HINFC610_READ_1CMD_1ADD_DATA_SYNC \
+ (HINFC610_OP_CMD1_EN \
+ | HINFC610_OP_ADDR_EN \
+ | HINFC610_OP_READ_DATA_EN \
+ | HINFC610_OP_WAIT_READY_EN \
+ | HINFC610_OP_RW_REG_EN \
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK) \
+ << HINFC610_OP_NF_CS_SHIFT) \
+ | (1 << HINFC610_OP_ADDR_CYCLE_SHIFT))
+
+#define HINFC610_READ_2CMD_5ADD \
+ (HINFC610_OP_CMD1_EN \
+ | HINFC610_OP_CMD2_EN \
+ | HINFC610_OP_ADDR_EN \
+ | HINFC610_OP_READ_DATA_EN \
+ | HINFC610_OP_WAIT_READY_EN \
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK) \
+ << HINFC610_OP_NF_CS_SHIFT) \
+ | (5 << HINFC610_OP_ADDR_CYCLE_SHIFT))
+
+#define HINFC610_WRITE_0CMD_1ADD_DATA \
+ (HINFC610_OP_ADDR_EN \
+ | HINFC610_OP_WRITE_DATA_EN \
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK) \
+ << HINFC610_OP_NF_CS_SHIFT) \
+ | (1 << HINFC610_OP_ADDR_CYCLE_SHIFT))
+
+#define HINFC610_WRITE_0CMD_1ADD_DATA_WAIT_READY \
+ (HINFC610_OP_ADDR_EN \
+ | HINFC610_OP_WRITE_DATA_EN \
+ | HINFC610_OP_WAIT_READY_EN \
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK) \
+ << HINFC610_OP_NF_CS_SHIFT) \
+ | (1 << HINFC610_OP_ADDR_CYCLE_SHIFT))
+
+#define HINFC610_WRITE_0CMD_1ADD_DATA_SYNC \
+ (HINFC610_OP_ADDR_EN \
+ | HINFC610_OP_WRITE_DATA_EN \
+ | HINFC610_OP_RW_REG_EN \
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK) \
+ << HINFC610_OP_NF_CS_SHIFT) \
+ | (1 << HINFC610_OP_ADDR_CYCLE_SHIFT))
+
+#define HINFC610_WRITE_0CMD_1ADD_DATA_SYNC_WAIT_READY \
+ (HINFC610_OP_ADDR_EN \
+ | HINFC610_OP_WRITE_DATA_EN \
+ | HINFC610_OP_RW_REG_EN \
+ | HINFC610_OP_WAIT_READY_EN \
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK) \
+ << HINFC610_OP_NF_CS_SHIFT) \
+ | (1 << HINFC610_OP_ADDR_CYCLE_SHIFT))
+
+#define HINFC610_WRITE_1CMD_1ADD_DATA \
+ (HINFC610_OP_CMD1_EN \
+ | HINFC610_OP_ADDR_EN \
+ | HINFC610_OP_WRITE_DATA_EN \
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK) \
+ << HINFC610_OP_NF_CS_SHIFT) \
+ | (1 << HINFC610_OP_ADDR_CYCLE_SHIFT))
+
+#define HINFC610_WRITE_1CMD_1ADD_DATA_WAIT_READY \
+ (HINFC610_OP_CMD1_EN \
+ | HINFC610_OP_ADDR_EN \
+ | HINFC610_OP_WRITE_DATA_EN \
+ | HINFC610_OP_WAIT_READY_EN \
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK) \
+ << HINFC610_OP_NF_CS_SHIFT) \
+ | (1 << HINFC610_OP_ADDR_CYCLE_SHIFT))
+
+#define HINFC610_WRITE_1CMD_1ADD_DATA_SYNC \
+ (HINFC610_OP_CMD1_EN \
+ | HINFC610_OP_ADDR_EN \
+ | HINFC610_OP_WRITE_DATA_EN \
+ | HINFC610_OP_RW_REG_EN \
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK) \
+ << HINFC610_OP_NF_CS_SHIFT) \
+ | (1 << HINFC610_OP_ADDR_CYCLE_SHIFT))
+
+#define HINFC610_WRITE_1CMD_1ADD_DATA_SYNC_WAIT_READY \
+ (HINFC610_OP_CMD1_EN \
+ | HINFC610_OP_ADDR_EN \
+ | HINFC610_OP_WRITE_DATA_EN \
+ | HINFC610_OP_WAIT_READY_EN \
+ | HINFC610_OP_RW_REG_EN \
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK) \
+ << HINFC610_OP_NF_CS_SHIFT) \
+ | (1 << HINFC610_OP_ADDR_CYCLE_SHIFT))
+
+#define HINFC610_WRITE_1CMD_2ADD_DATA \
+ (HINFC610_OP_CMD1_EN \
+ | HINFC610_OP_ADDR_EN \
+ | HINFC610_OP_WRITE_DATA_EN \
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK) \
+ << HINFC610_OP_NF_CS_SHIFT) \
+ | (2 << HINFC610_OP_ADDR_CYCLE_SHIFT))
+
+#define HINFC610_WRITE_1CMD_2ADD_DATA_SYNC \
+ (HINFC610_OP_CMD1_EN \
+ | HINFC610_OP_ADDR_EN \
+ | HINFC610_OP_WRITE_DATA_EN \
+ | HINFC610_OP_RW_REG_EN \
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK) \
+ << HINFC610_OP_NF_CS_SHIFT) \
+ | (2 << HINFC610_OP_ADDR_CYCLE_SHIFT))
+
+#define HINFC610_WRITE_2CMD_0ADD_NODATA \
+ (HINFC610_OP_CMD1_EN \
+ | HINFC610_OP_CMD2_EN \
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK) \
+ << HINFC610_OP_NF_CS_SHIFT))
+
+#define HINFC610_WRITE_2CMD_0ADD_NODATA_SYNC \
+ (HINFC610_OP_CMD1_EN \
+ | HINFC610_OP_CMD2_EN \
+ | HINFC610_OP_RW_REG_EN \
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK) \
+ << HINFC610_OP_NF_CS_SHIFT))
+
+#define HINFC610_WRITE_1CMD_0ADD_NODATA \
+ (HINFC610_OP_CMD1_EN \
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK) \
+ << HINFC610_OP_NF_CS_SHIFT))
+
+#define HINFC610_WRITE_1CMD_0ADD_NODATA_WAIT_READY \
+ (HINFC610_OP_CMD1_EN \
+ | HINFC610_OP_WAIT_READY_EN \
+ | (((unsigned int)host->chipselect & HINFC610_OP_NF_CS_MASK) \
+ << HINFC610_OP_NF_CS_SHIFT))
+
+/*****************************************************************************/
+
+#define WAIT_CONTROLLER_FINISH() \
+do { \
+ unsigned int timeout = 0x800000; \
+ while ((hinfc_read(host, HINFC610_STATUS) & 0x1) == 0x0 && timeout) \
+ timeout--; \
+ if (!timeout) \
+ PR_ERR("Wait NAND controller finish timeout.\n"); \
+} while (0)
+
+/*****************************************************************************/
+
+#define hinfc_read(_host, _reg) \
+ readl((char *)_host->iobase + (_reg))
+
+#define hinfc_write(_host, _value, _reg) \
+ writel((_value), (char *)_host->iobase + (_reg))
+
+#define HINFC_CMD_SEQ(_cmd0, _cmd1) \
+ (((_cmd0) & 0xFF) | ((_cmd1) & 0xFF) << 8)
+/*****************************************************************************/
+
+#define GET_PAGE_INDEX(host) \
+ ((host->addr_value[0] >> 16) | (host->addr_value[1] << 16))
+
+/*****************************************************************************/
+
+void hinfc610_cmd_ctrl(struct mtd_info *mtd, int dat, unsigned int ctrl);
+int hinfc610_dev_ready(struct mtd_info *mtd);
+void hinfc610_select_chip(struct mtd_info *mtd, int chipselect);
+uint8_t hinfc610_read_byte(struct mtd_info *mtd);
+u16 hinfc610_read_word(struct mtd_info *mtd);
+void hinfc610_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len);
+void hinfc610_read_buf(struct mtd_info *mtd, uint8_t *buf, int len);
+int hinfc610_nand_init(struct hinfc_host *host, struct nand_chip *chip);
+/******************************************************************************/
+
+extern struct nand_sync hinfc610_sync_onfi_23;
+extern struct nand_sync hinfc610_sync_onfi_30;
+extern struct nand_sync hinfc610_sync_toggle_10;
+extern struct read_retry_t hinfc610_hynix_bg_cdie_read_retry;
+extern struct read_retry_t hinfc610_hynix_bg_bdie_read_retry;
+extern struct read_retry_t hinfc610_hynix_cg_adie_read_retry;
+extern struct read_retry_t hinfc610_micron_read_retry;
+extern struct read_retry_t hinfc610_toshiba_24nm_read_retry;
+extern struct read_retry_t hinfc610_samsung_read_retry;
+
+#if 0
+#ifdef CONFIG_MTD_PART_CHANGE
+extern int register_mtd_partdev(struct mtd_info *mtd);
+extern int unregister_mtd_partdev(struct mtd_info *mtd);
+#else
+int register_mtd_partdev(struct mtd_info *mtd)
+{
+ return 0;
+};
+
+int unregister_mtd_partdev(struct mtd_info *mtd)
+{
+ return 0;
+};
+#endif
+
+void hinfc610_controller_enable(struct hinfc_host *host, int enable);
+#endif
+
+extern int hinfc610_dbgfs_debug_init(struct hinfc_host *host);
+
+#ifdef CONFIG_HINFC610_DBG_NAND_DEBUG
+extern struct hinfc610_dbg_inf_t *hinfc610_dbg_inf[];
+#endif
+
+#endif /* HINFCV610H */
diff --git a/drivers/mtd/nand/hinfc610/hinfc610_dbg.c b/drivers/mtd/nand/hinfc610/hinfc610_dbg.c
new file mode 100644
index 0000000..ee25956
--- /dev/null
+++ b/drivers/mtd/nand/hinfc610/hinfc610_dbg.c
@@ -0,0 +1,294 @@
+/*
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "hinfc610_os.h"
+#include "hinfc610.h"
+#include "hinfc610_dbg.h"
+
+struct hinfc610_dbg_inf_t *hinfc610_dbg_inf[] = {
+ &hinfc610_dbg_inf_ecc_notice,
+ &hinfc610_dbg_inf_read_retry_notice,
+#ifdef CONFIG_HINFC610_DBG_NAND_DUMP
+ &hinfc610_dbg_inf_dump,
+#endif
+#ifdef CONFIG_HINFC610_DBG_NAND_ERASE_COUNT
+ &hinfc610_dbg_inf_erase_count,
+#endif
+#ifdef CONFIG_HINFC610_DBG_NAND_ECC_COUNT
+ &hinfc610_dbg_inf_ecc_count,
+#endif
+#ifdef CONFIG_HINFC610_DBG_NAND_READ_RETRY
+ &hinfc610_dbg_inf_read_retry,
+#endif
+ NULL,
+};
+
+static struct dentry *dbgfs_root;
+static struct hinfc_host *dbgfs_host;
+
+/*****************************************************************************/
+static ssize_t dbgfs_debug_read(struct file *filp, char __user *buffer,
+ size_t count, loff_t *ppos)
+{
+ char *msg, *p;
+ struct hinfc610_dbg_inf_t **inf;
+
+ if (*ppos != 0)
+ return 0;
+
+ msg = (char *)__get_free_page(GFP_TEMPORARY);
+ if (!msg)
+ return -ENOMEM;
+
+ p = msg;
+ if (count > PAGE_SIZE)
+ count = PAGE_SIZE;
+
+ for (inf = hinfc610_dbg_inf; *inf; inf++) {
+ if ((p - msg) + MAX_OPTION_SIZE + 2 > count) {
+ PR_ERR("Not enough memory.\n");
+ break;
+ }
+ p += snprintf(p, (MAX_OPTION_SIZE + 2), "%c%s,",
+ ((*inf)->enable ? '+' : '-'),
+ (*inf)->name);
+ }
+
+ p += sprintf(p, "\n");
+ count = (p - msg);
+ if (copy_to_user(buffer, msg, count)) {
+ free_page((unsigned long) msg);
+ return -EFAULT;
+ }
+
+ free_page((unsigned long) msg);
+
+ *ppos += count;
+ return count;
+}
+/*****************************************************************************/
+
+static void dbgfs_debug_do_cmd(struct hinfc610_dbg_inf_t **dbg_inf,
+ const char *cmd, unsigned int length, int enable)
+{
+ int ret = 0;
+ struct hinfc610_dbg_inf_t **inf;
+
+ if (length >= sizeof((*inf)->name))
+ return;
+
+ for (inf = dbg_inf; *inf; inf++) {
+ if (!(*inf)->name[length] &&
+ !memcmp((*inf)->name, cmd, length))
+ break;
+ }
+
+ if (!(*inf) || (*inf)->enable == enable)
+ return;
+
+ if (enable) {
+ if ((*inf)->init)
+ ret = (*inf)->init(dbgfs_root, dbgfs_host);
+ } else {
+ if ((*inf)->uninit)
+ ret = (*inf)->uninit();
+ }
+
+ if (!ret)
+ (*inf)->enable = enable;
+}
+/*****************************************************************************/
+
+static void dbgfs_debug_ops(const char *options,
+ struct hinfc610_dbg_inf_t **dbg_inf)
+{
+ int enable;
+ const char *pos, *cmd;
+
+ pos = options;
+
+ while (*pos) {
+
+ while (*pos && *pos != '+' && *pos != '-')
+ pos++;
+
+ switch (*pos++) {
+ case '+':
+ enable = 1;
+ break;
+ case '-':
+ enable = 0;
+ break;
+ default:
+ return;
+ }
+
+ cmd = pos;
+ while (*pos == '_' || isalpha(*pos))
+ pos++;
+
+ if (*cmd && pos > cmd)
+ dbgfs_debug_do_cmd(dbg_inf, cmd, (pos - cmd), enable);
+
+ while (isspace(*pos) || *pos == ',' || *pos == ';')
+ pos++;
+ }
+}
+/*****************************************************************************/
+/*
+ * echo "+dump, +read_retry, +ecc_count, +erase_count" > debug
+ */
+static ssize_t dbgfs_debug_write(struct file *filp, const char __user *buffer,
+ size_t count, loff_t *ppos)
+{
+ char *options;
+ size_t num = count;
+
+ if (count > PAGE_SIZE)
+ num = (PAGE_SIZE - 1);
+
+ options = (char *)__get_free_page(GFP_TEMPORARY);
+ if (!options)
+ return -ENOMEM;
+
+ if (copy_from_user(options, buffer, num)) {
+ free_page((unsigned long) options);
+ return -EFAULT;
+ }
+
+ options[num] = 0;
+
+ dbgfs_debug_ops(options, hinfc610_dbg_inf);
+
+ free_page((unsigned long) options);
+
+ *ppos += count;
+ return count;
+}
+/*****************************************************************************/
+
+static const struct file_operations dbgfs_debug_fops = {
+ .owner = THIS_MODULE,
+ .read = dbgfs_debug_read,
+ .write = dbgfs_debug_write,
+};
+/*****************************************************************************/
+
+int hinfc610_dbgfs_debug_init(struct hinfc_host *host)
+{
+ struct dentry *dentry;
+
+ if (dbgfs_root)
+ return 0;
+
+ dbgfs_root = debugfs_create_dir("nand", NULL);
+ if (!dbgfs_root) {
+ PR_ERR("Can't create 'nand' dir.\n");
+ return -ENOENT;
+ }
+
+ dentry = debugfs_create_file("debug", S_IFREG | S_IRUSR | S_IWUSR,
+ dbgfs_root, NULL, &dbgfs_debug_fops);
+ if (!dentry) {
+ PR_ERR("Can't create 'debug' file.\n");
+ goto fail;
+ }
+
+ dbgfs_host = host;
+
+ if (nand_dbgfs_options)
+ dbgfs_debug_ops(nand_dbgfs_options, hinfc610_dbg_inf);
+
+ return 0;
+
+fail:
+ debugfs_remove_recursive(dbgfs_root);
+ dbgfs_root = NULL;
+
+ return -ENOENT;
+}
+/*****************************************************************************/
+
+static int dbgfs_read_retry_notice_init(struct dentry *root,
+ struct hinfc_host *host)
+{
+ if (!host->read_retry) {
+ pr_warn("read_retry_notice: The NAND not support this interface.\n");
+ return -1;
+ }
+
+ return 0;
+}
+
+static void hinfc610_dbg_read_retry_notice(struct hinfc_host *host, int index)
+{
+ pr_warn("Page 0x%08x do read retry (%d/%d) %s.\n",
+ GET_PAGE_INDEX(host), index, host->read_retry->count,
+ (IS_PS_UN_ECC(host) ? "Fail" : "Success"));
+}
+
+struct hinfc610_dbg_inf_t hinfc610_dbg_inf_read_retry_notice = {
+ "read_retry_notice", 0,
+ dbgfs_read_retry_notice_init,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ hinfc610_dbg_read_retry_notice,
+};
+/*****************************************************************************/
+
+static void hinfc610_dbg_ecc_notice_read(struct hinfc_host *host)
+{
+ unsigned int pageindex = GET_PAGE_INDEX(host);
+
+ if (IS_PS_BAD_BLOCK(host) || IS_PS_EMPTY_PAGE(host)) {
+ if (IS_PS_BBM_ERR(host))
+ pr_warn("page 0x%08x bbm is corruption, bbm: 0x%x.\n",
+ pageindex, *host->bbm);
+
+ if (IS_PS_EPM_ERR(host))
+ pr_warn("page 0x%08x epm is corruption, epm: 0x%x.\n",
+ pageindex, *host->epm);
+
+ return;
+ }
+
+ if (IS_PS_UN_ECC(host))
+ pr_warn("page 0x%08x has uncorrect ecc.\n", pageindex);
+}
+
+struct hinfc610_dbg_inf_t hinfc610_dbg_inf_ecc_notice = {
+ "ecc_notice", 0,
+ NULL,
+ NULL,
+ hinfc610_dbg_ecc_notice_read,
+ NULL,
+ NULL,
+ NULL,
+};
+/*****************************************************************************/
diff --git a/drivers/mtd/nand/hinfc610/hinfc610_dbg.h b/drivers/mtd/nand/hinfc610/hinfc610_dbg.h
new file mode 100644
index 0000000..8fd4deb
--- /dev/null
+++ b/drivers/mtd/nand/hinfc610/hinfc610_dbg.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+
+#ifndef HINFC610_DBGH
+#define HINFC610_DBGH
+/******************************************************************************/
+
+#define MAX_OPTION_SIZE 20
+
+struct hinfc610_dbg_inf_t {
+ const char name[MAX_OPTION_SIZE];
+ int enable;
+ int (*init)(struct dentry *root, struct hinfc_host *host);
+ int (*uninit)(void);
+
+ void (*read)(struct hinfc_host *host);
+ void (*write)(struct hinfc_host *host);
+ void (*erase)(struct hinfc_host *host);
+
+ void (*read_retry)(struct hinfc_host *host, int index);
+};
+
+#define CMD_WORD_OFFSET "offset="
+#define CMD_WORD_LENGTH "length="
+#define CMD_WORD_CLEAN "clear"
+#define CMD_WORD_ON "on"
+#define CMD_WORD_OFF "off"
+
+struct hinfc610_ecc_inf_t {
+ int pagesize;
+ int ecctype;
+ int section;
+ void (*ecc_inf)(struct hinfc_host *host, unsigned char ecc[]);
+};
+
+struct hinfc610_ecc_inf_t *hinfc610_get_ecc_inf(struct hinfc_host *host,
+ int pagesize, int ecctype);
+
+extern struct hinfc610_dbg_inf_t hinfc610_dbg_inf_dump;
+extern struct hinfc610_dbg_inf_t hinfc610_dbg_inf_erase_count;
+extern struct hinfc610_dbg_inf_t hinfc610_dbg_inf_ecc_count;
+extern struct hinfc610_dbg_inf_t hinfc610_dbg_inf_read_retry;
+extern struct hinfc610_dbg_inf_t hinfc610_dbg_inf_read_retry_notice;
+extern struct hinfc610_dbg_inf_t hinfc610_dbg_inf_ecc_notice;
+
+/******************************************************************************/
+#endif /* HINFC610_DBGH */
diff --git a/drivers/mtd/nand/hinfc610/hinfc610_dbg_dump.c b/drivers/mtd/nand/hinfc610/hinfc610_dbg_dump.c
new file mode 100644
index 0000000..e330bb5
--- /dev/null
+++ b/drivers/mtd/nand/hinfc610/hinfc610_dbg_dump.c
@@ -0,0 +1,448 @@
+/*
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "hinfc610_os.h"
+#include "hinfc610.h"
+#include "hinfc610_dbg.h"
+
+#ifndef CONFIG_HINFC610_DBG_NAND_NUM_OF_LOGS
+# define CONFIG_HINFC610_DBG_NAND_NUM_OF_LOGS (80)
+#endif /* CONFIG_HINFC610_DBG_NAND_NUM_OF_LOGS */
+
+#ifndef CONFIG_HINFC610_DBG_NAND_LOG_LENGTH
+# define CONFIG_HINFC610_DBG_NAND_LOG_LENGTH (40)
+#endif /* CONFIG_HINFC610_DBG_NAND_LOG_LENGTH */
+
+struct hinfc610_dbg_dump_item_t {
+ unsigned short hour;
+ unsigned short min;
+ unsigned short sec;
+ unsigned short msec;
+
+ unsigned int cycle;
+
+ unsigned long page;
+ unsigned long offset;
+ unsigned long length;
+
+ char page_status[4];
+ char op;
+
+ unsigned char data[CONFIG_HINFC610_DBG_NAND_LOG_LENGTH];
+};
+
+struct hinfc610_dbg_dump_t {
+
+ struct dentry *dentry;
+ unsigned int index; /* current logs index */
+ int count; /* number of logs */
+
+ unsigned long offset;
+ unsigned long length;
+
+ struct hinfc610_dbg_dump_item_t
+ logs[CONFIG_HINFC610_DBG_NAND_NUM_OF_LOGS];
+
+ unsigned int read_index;
+};
+
+static DEFINE_MUTEX(dbg_dump_mutex);
+static struct hinfc610_dbg_dump_t *dbg_dump;
+
+/*****************************************************************************/
+
+static void do_gettime(unsigned short *hour, unsigned short *min,
+ unsigned short *sec, unsigned short *msec)
+{
+ long val;
+ struct timeval tv;
+
+ do_gettimeofday(&tv);
+ val = tv.tv_sec % 86400; /* the second form 0 hour */
+
+ if (hour)
+ *hour = val / 3600;
+ val %= 3600;
+ if (min)
+ *min = val / 60;
+ if (sec)
+ *sec = val % 60;
+ if (msec)
+ *msec = tv.tv_usec / 1000;
+}
+/*****************************************************************************/
+/*
+ *
+# cat ./debugfs/nand/dump
+Print parameter: "offset=0 length=8"
+UTC Clock op cylce page-offset data
+00:00:33.0321 W 5 0x0000258F-0000 31 18 10 06 18 EF FE 11
+00:00:33.0325 W 5 0x00002740-0000 31 18 10 06 7C D4 B3 0C
+*
+*/
+static ssize_t dbgfs_dump_read(struct file *filp, char __user *buffer,
+ size_t count, loff_t *ppos)
+{
+ int len = 0;
+ char buf[128] = {0};
+ unsigned int read_index;
+ char __user *pusrbuf = buffer;
+ struct hinfc610_dbg_dump_item_t *logs;
+
+ if (*ppos == 0) {
+
+ if (dbg_dump->count
+ < CONFIG_HINFC610_DBG_NAND_NUM_OF_LOGS)
+ dbg_dump->read_index = 0;
+ else
+ dbg_dump->read_index
+ = (dbg_dump->index + 1);
+
+ len = snprintf(buf, sizeof(buf),
+ "Print parameter: \"offset=%ld length=%ld\"\n",
+ dbg_dump->offset, dbg_dump->length);
+
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+
+ pusrbuf += len;
+
+ len += snprintf(buf, sizeof(buf),
+ " UTC Clock op cylce page-offset data\n");
+
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+
+ pusrbuf += len;
+
+ } else if (dbg_dump->read_index == dbg_dump->index)
+ return 0;
+
+ for (read_index = dbg_dump->read_index;
+ (read_index != dbg_dump->index);
+ ++read_index) {
+
+ if (read_index >= CONFIG_HINFC610_DBG_NAND_NUM_OF_LOGS)
+ read_index = 0;
+
+ logs = &dbg_dump->logs[read_index];
+
+ if ((count - (pusrbuf - buffer)) < (50 + logs->length * 3))
+ break;
+
+ len = snprintf(buf, sizeof(buf),
+ "%02d:%02d:%02d.%04d %c %-2u 0x%08lX-%04lX",
+ logs->hour, logs->min, logs->sec, logs->msec,
+ logs->op, logs->cycle,
+ logs->page, logs->offset);
+
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+
+ pusrbuf += len;
+
+ if (logs->op == 'E') {
+
+ len = snprintf(buf, sizeof(buf), " ---");
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+ pusrbuf += len;
+
+ } else {
+
+ int ix;
+
+ len = snprintf(buf, sizeof(buf), "%s",
+ logs->page_status);
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+ pusrbuf += len;
+
+ for (ix = 0; ix < logs->length; ix++) {
+ if ((ix % 16) == 15) {
+ len = snprintf(buf, sizeof(buf),
+ "%02X-",
+ logs->data[ix]);
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+ pusrbuf += len;
+ } else {
+ len = snprintf(buf, sizeof(buf),
+ "%02X ",
+ logs->data[ix]);
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+ pusrbuf += len;
+ }
+ }
+ }
+ len = snprintf(buf, sizeof(buf), "\n");
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+ pusrbuf += len;
+ }
+
+ dbg_dump->read_index = read_index;
+
+ *ppos += (pusrbuf - buffer);
+ return pusrbuf - buffer;
+}
+/*****************************************************************************/
+
+static ssize_t dbgfs_dump_write(struct file *filp, const char __user *buffer,
+ size_t count, loff_t *ppos)
+{
+ char *p;
+ int ret;
+ unsigned long value = 0;
+ char buf[128] = {0};
+ unsigned long pos = 0;
+
+ if (count > sizeof(buf))
+ count = sizeof(buf);
+
+ if (copy_from_user(buf, buffer, count))
+ return -EFAULT;
+
+ while (pos < count) {
+
+ while (pos < count
+ && (buf[pos] == ' ' ||
+ buf[pos] == ',' || buf[pos] == ';'))
+ pos++;
+
+ if (pos >= count)
+ break;
+
+ switch (buf[pos]) {
+ case 'o':
+ if (!memcmp(&buf[pos], CMD_WORD_OFFSET,
+ sizeof(CMD_WORD_OFFSET) - 1)) {
+
+ pos += sizeof(CMD_WORD_OFFSET) - 1;
+ p = (char *)(buf + pos);
+ ret = kstrtoul(p, 10, &value);
+ if (ret < 0)
+ value = 0;
+ dbg_dump->offset = value;
+ }
+ break;
+
+ case 'l':
+ if (!memcmp(&buf[pos], CMD_WORD_LENGTH,
+ sizeof(CMD_WORD_LENGTH) - 1)) {
+
+ pos += sizeof(CMD_WORD_LENGTH) - 1;
+ p = (char *)(buf + pos);
+ ret = kstrtoul(p, 10, &value);
+ if (ret < 0)
+ value = 0;
+ dbg_dump->length = value;
+ }
+ break;
+ }
+
+ while (pos < count &&
+ (buf[pos] != ' ' && buf[pos] != ',' && buf[pos] != ';'))
+ pos++;
+ }
+
+ *ppos += count;
+ return count;
+}
+/*****************************************************************************/
+
+static const struct file_operations dbgfs_dump_fops = {
+ .owner = THIS_MODULE,
+ .read = dbgfs_dump_read,
+ .write = dbgfs_dump_write,
+};
+/*****************************************************************************/
+
+static int dbgfs_dump_init(struct dentry *root, struct hinfc_host *host)
+{
+ struct hinfc610_dbg_dump_t *dump;
+
+ if (dbg_dump)
+ return 0;
+
+ dump = vmalloc(sizeof(struct hinfc610_dbg_dump_t));
+ if (!dump) {
+ PR_ERR("Can't allocate memory.\n");
+ return -ENOMEM;
+ }
+ memset(dump, 0, sizeof(struct hinfc610_dbg_dump_t));
+
+ dump->dentry = debugfs_create_file("dump",
+ S_IFREG | S_IRUSR | S_IWUSR,
+ root, NULL, &dbgfs_dump_fops);
+ if (!dump->dentry) {
+ PR_ERR("Can't create 'dump' file.\n");
+ vfree(dump);
+ return -ENOENT;
+ }
+
+ dump->length = 8;
+
+ dbg_dump = dump;
+
+ return 0;
+}
+/*****************************************************************************/
+
+static int dbgfs_dump_uninit(void)
+{
+ if (!dbg_dump)
+ return 0;
+
+ mutex_lock(&dbg_dump_mutex);
+
+ debugfs_remove(dbg_dump->dentry);
+
+ vfree(dbg_dump);
+ dbg_dump = NULL;
+
+ mutex_unlock(&dbg_dump_mutex);
+
+ return 0;
+}
+/*****************************************************************************/
+
+static void dbg_dump_rw(struct hinfc_host *host, char op)
+{
+ unsigned long buflen;
+ struct hinfc610_dbg_dump_item_t *logs;
+
+ mutex_lock(&dbg_dump_mutex);
+
+ if (!dbg_dump)
+ goto exit;
+
+ buflen = (host->pagesize + host->oobsize);
+ logs = &dbg_dump->logs[dbg_dump->index];
+
+ dbg_dump->count++;
+
+ do_gettime(&logs->hour, &logs->min, &logs->sec, &logs->msec);
+
+ memcpy(logs->page_status, "\x20\x20\x20\x00", 4);
+
+ if (host->page_status) {
+ if (IS_PS_BAD_BLOCK(host))
+ logs->page_status[0] = 'B';
+ else if (IS_PS_EMPTY_PAGE(host))
+ logs->page_status[0] = 'E';
+
+ if (IS_PS_UN_ECC(host))
+ logs->page_status[1] = '*';
+
+ if (IS_PS_EPM_ERR(host) || IS_PS_BBM_ERR(host))
+ logs->page_status[2] = '?';
+ }
+
+ logs->op = op;
+ logs->cycle = host->addr_cycle;
+ logs->length = dbg_dump->length;
+ logs->offset = (host->addr_value[0] & 0xFFFF);
+ logs->page = GET_PAGE_INDEX(host);
+
+ if (!logs->offset)
+ logs->offset = dbg_dump->offset;
+
+ if (logs->offset >= buflen)
+ logs->offset = 0;
+
+ if (logs->length > (buflen - logs->offset))
+ logs->length = (buflen - logs->offset);
+
+ if (logs->length > CONFIG_HINFC610_DBG_NAND_LOG_LENGTH)
+ logs->length = CONFIG_HINFC610_DBG_NAND_LOG_LENGTH;
+
+ memcpy(logs->data, (host->buffer + logs->offset), logs->length);
+
+ if (++dbg_dump->index >= CONFIG_HINFC610_DBG_NAND_NUM_OF_LOGS)
+ dbg_dump->index = 0;
+
+exit:
+ mutex_unlock(&dbg_dump_mutex);
+}
+/*****************************************************************************/
+
+static void dbg_dump_read(struct hinfc_host *host)
+{
+ dbg_dump_rw(host, 'R');
+}
+/*****************************************************************************/
+
+static void dbg_dump_write(struct hinfc_host *host)
+{
+ dbg_dump_rw(host, 'W');
+}
+/*****************************************************************************/
+
+static void dbg_dump_erase(struct hinfc_host *host)
+{
+ struct hinfc610_dbg_dump_item_t *logs;
+
+ mutex_lock(&dbg_dump_mutex);
+
+ if (!dbg_dump)
+ goto exit;
+
+ dbg_dump->count++;
+ logs = &dbg_dump->logs[dbg_dump->index];
+
+ do_gettime(&logs->hour, &logs->min, &logs->sec, &logs->msec);
+
+ memcpy(logs->page_status, "\x20\x20\x20\x00", 4);
+
+ logs->op = 'E';
+ logs->cycle = host->addr_cycle;
+ logs->length = dbg_dump->length;
+
+ logs->offset = 0;
+ logs->page = host->addr_value[0];
+ logs->length = 0;
+
+ if (++dbg_dump->index >= CONFIG_HINFC610_DBG_NAND_NUM_OF_LOGS)
+ dbg_dump->index = 0;
+
+exit:
+ mutex_unlock(&dbg_dump_mutex);
+}
+/*****************************************************************************/
+
+struct hinfc610_dbg_inf_t hinfc610_dbg_inf_dump = {
+ "dump", 0,
+ dbgfs_dump_init,
+ dbgfs_dump_uninit,
+ dbg_dump_read,
+ dbg_dump_write,
+ dbg_dump_erase,
+ NULL,
+};
+/*****************************************************************************/
diff --git a/drivers/mtd/nand/hinfc610/hinfc610_dbg_ecc_count.c b/drivers/mtd/nand/hinfc610/hinfc610_dbg_ecc_count.c
new file mode 100644
index 0000000..b7174ab
--- /dev/null
+++ b/drivers/mtd/nand/hinfc610/hinfc610_dbg_ecc_count.c
@@ -0,0 +1,401 @@
+/*
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "hinfc610_os.h"
+#include "hinfc610.h"
+#include "hinfc610_dbg.h"
+
+#ifndef CONFIG_HINFC610_DBG_ECC_COUNT_NUM
+# define CONFIG_HINFC610_DBG_ECC_COUNT_NUM (100)
+#endif /* CONFIG_HINFC610_DBG_ECC_COUNT_NUM */
+
+struct hinfc610_dbg_ecc_count_item_t {
+ unsigned int page;
+ unsigned int page_status; /* the same as host->page_status */
+ unsigned short hour;
+ unsigned short min;
+ unsigned short sec;
+ unsigned short msec;
+
+ unsigned char ecc[4];
+};
+
+struct hinfc610_dbg_ecc_count_t {
+
+ struct dentry *dentry;
+ unsigned int index; /* current logs index */
+ int count; /* number of logs */
+
+ struct hinfc610_ecc_inf_t *ecc_inf;
+ unsigned int offset;
+ unsigned int length;
+ unsigned int pagecount;
+
+ unsigned char *item;
+
+ unsigned int read_index;
+};
+
+#define GET_ITEM(_ecc_count, _index) \
+ ((struct hinfc610_dbg_ecc_count_item_t *)((_ecc_count)->item + \
+ ((sizeof(struct hinfc610_dbg_ecc_count_item_t) + \
+ (_ecc_count)->ecc_inf->section) * (_index))))
+
+static DEFINE_MUTEX(dbg_ecc_count_mutex);
+static struct hinfc610_dbg_ecc_count_t *dbg_ecc_count;
+/*****************************************************************************/
+
+static void do_gettime(unsigned short *hour, unsigned short *min,
+ unsigned short *sec, unsigned short *msec)
+{
+ long val;
+ struct timeval tv;
+
+ do_gettimeofday(&tv);
+ val = tv.tv_sec % 86400; /* the second form 0 hour */
+
+ if (hour)
+ *hour = val / 3600;
+ val %= 3600;
+ if (min)
+ *min = val / 60;
+ if (sec)
+ *sec = val % 60;
+ if (msec)
+ *msec = tv.tv_usec / 1000;
+}
+/*****************************************************************************/
+
+static ssize_t dbgfs_ecc_count_read(struct file *filp, char __user *buffer,
+ size_t count, loff_t *ppos)
+{
+ int len = 0;
+ char buf[128] = {0};
+ unsigned int read_index;
+ char __user *pusrbuf = buffer;
+ struct hinfc610_dbg_ecc_count_item_t *item;
+
+ if (*ppos == 0) {
+
+ if (dbg_ecc_count->count
+ < CONFIG_HINFC610_DBG_ECC_COUNT_NUM)
+ dbg_ecc_count->read_index = 0;
+ else
+ dbg_ecc_count->read_index
+ = (dbg_ecc_count->index + 1);
+
+ len = snprintf(buf, sizeof(buf),
+ "Print parameter: \"offset=%d length=%d\"\n",
+ dbg_ecc_count->offset,
+ dbg_ecc_count->length);
+
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+
+ pusrbuf += len;
+
+ len = snprintf(buf, sizeof(buf),
+ " UTC Clock page ecc data\n");
+
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+
+ pusrbuf += len;
+
+ } else if (dbg_ecc_count->read_index == dbg_ecc_count->index)
+ return 0;
+
+ for (read_index = dbg_ecc_count->read_index;
+ (read_index != dbg_ecc_count->index); ++read_index) {
+
+ if (read_index >= CONFIG_HINFC610_DBG_ECC_COUNT_NUM)
+ read_index = 0;
+
+ item = GET_ITEM(dbg_ecc_count, read_index);
+
+ if ((count - (pusrbuf - buffer)) < 80)
+ break;
+
+ len = snprintf(buf, sizeof(buf),
+ "%02d:%02d:%02d.%04d 0x%08X ",
+ item->hour, item->min, item->sec, item->msec,
+ item->page);
+
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+
+ pusrbuf += len;
+
+ if (IS_PS_BAD_BLOCK(item) || IS_PS_EMPTY_PAGE(item) ||
+ IS_PS_UN_ECC(item)) {
+ char *ptr = buf;
+
+ if (IS_PS_BAD_BLOCK(item))
+ ptr += snprintf(ptr, 16, "bb ");
+ else if (IS_PS_EMPTY_PAGE(item))
+ ptr += snprintf(ptr, 16, "ep ");
+
+ if (IS_PS_UN_ECC(item))
+ ptr += snprintf(ptr, 16, "ecc ");
+
+ if (IS_PS_EPM_ERR(item) || IS_PS_BBM_ERR(item))
+ ptr += snprintf(ptr, 16, "? ");
+
+ ptr += snprintf(ptr, 16, "\n");
+ len = (ptr - buf);
+
+ } else {
+ int ix;
+ char *ptr = buf;
+
+ for (ix = 0; ix < dbg_ecc_count->ecc_inf->section; ix++)
+ ptr += snprintf(ptr, 16, "%d/", item->ecc[ix]);
+
+ if (IS_PS_EPM_ERR(item))
+ ptr += snprintf(ptr, 16, " ?");
+
+ ptr += snprintf(ptr, 16, "\n");
+ len = (ptr - buf);
+ }
+
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+ pusrbuf += len;
+ }
+
+ dbg_ecc_count->read_index = read_index;
+
+ *ppos += (pusrbuf - buffer);
+ return pusrbuf - buffer;
+}
+/******************************************************************************/
+/*
+ * echo "offset=8192,length=102400" > ecc_count
+ *
+ */
+static ssize_t dbgfs_ecc_count_write(struct file *filp,
+ const char __user *buffer, size_t count,
+ loff_t *ppos)
+{
+ char *str;
+ char buf[128] = {0};
+ int ret;
+ unsigned long value = 0;
+ unsigned long pos = 0;
+
+ if (count > sizeof(buf))
+ count = sizeof(buf);
+
+ if (copy_from_user(buf, buffer, count))
+ return -EFAULT;
+
+ while (pos < count) {
+ while (pos < count &&
+ (buf[pos] == ' ' || buf[pos] == ',' || buf[pos] == ';'))
+ pos++;
+
+ if (pos >= count)
+ break;
+
+ switch (buf[pos]) {
+
+ case 'o':
+
+ if (memcmp(&buf[pos], CMD_WORD_OFFSET,
+ sizeof(CMD_WORD_OFFSET) - 1))
+ break;
+
+ pos += sizeof(CMD_WORD_OFFSET) - 1;
+ str = (char *)(buf + pos);
+ ret = kstrtoul(str, 10, &value);
+
+ if (ret < 0)
+ value = 0;
+ if (value >= dbg_ecc_count->pagecount)
+ value = 0;
+
+ dbg_ecc_count->offset = (value & ~7);
+
+ break;
+
+ case 'l':
+ if (memcmp(&buf[pos], CMD_WORD_LENGTH,
+ sizeof(CMD_WORD_LENGTH) - 1))
+ break;
+
+ pos += sizeof(CMD_WORD_LENGTH) - 1;
+ str = (char *)(buf + pos);
+ ret = kstrtoul(str, 10, &value);
+
+ if (ret < 0)
+ value = dbg_ecc_count->pagecount;
+
+ value = ((value + 7) & ~7);
+
+ if (dbg_ecc_count->offset + value >
+ dbg_ecc_count->pagecount)
+ value = dbg_ecc_count->pagecount
+ - dbg_ecc_count->offset;
+
+ dbg_ecc_count->length = value;
+
+ break;
+ }
+
+ while (pos < count &&
+ (buf[pos] != ' ' && buf[pos] != ',' && buf[pos] != ';'))
+ pos++;
+ }
+
+ return count;
+}
+/******************************************************************************/
+
+static const struct file_operations dbgfs_ecc_count_fops = {
+ .owner = THIS_MODULE,
+ .read = dbgfs_ecc_count_read,
+ .write = dbgfs_ecc_count_write,
+};
+/*****************************************************************************/
+
+static int dbgfs_ecc_count_init(struct dentry *root, struct hinfc_host *host)
+{
+ unsigned int size;
+ unsigned int pagesize;
+ unsigned int chipsize;
+ struct hinfc610_ecc_inf_t *ecc_inf;
+ struct hinfc610_dbg_ecc_count_t *ecc_count;
+
+ if (dbg_ecc_count)
+ return 0;
+
+ ecc_inf = hinfc610_get_ecc_inf(host, host->pagesize, host->ecctype);
+ if (!ecc_inf) {
+ pr_warn("ecc_count: The NAND not support this interface.\n");
+ return -1;
+ }
+
+ size = sizeof(struct hinfc610_dbg_ecc_count_t);
+ size += CONFIG_HINFC610_DBG_ECC_COUNT_NUM *
+ (sizeof(struct hinfc610_dbg_ecc_count_item_t)
+ + ecc_inf->section);
+
+ ecc_count = vmalloc(size);
+ if (!ecc_count) {
+ PR_ERR("Can't allocate memory.\n");
+ return -ENOMEM;
+ }
+ memset(ecc_count, 0, size);
+
+ ecc_count->item = (char *)ecc_count +
+ sizeof(struct hinfc610_dbg_ecc_count_t);
+ ecc_count->ecc_inf = ecc_inf;
+
+ pagesize = (host->pagesize >> 10);
+ chipsize = (unsigned int)(host->chip->chipsize >> 10);
+ ecc_count->pagecount = (chipsize / pagesize);
+ ecc_count->length = ecc_count->pagecount;
+
+ ecc_count->dentry = debugfs_create_file("ecc_count",
+ S_IFREG | S_IRUSR | S_IWUSR,
+ root, NULL, &dbgfs_ecc_count_fops);
+ if (!ecc_count->dentry) {
+ PR_ERR("Can't create 'ecc_count' file.\n");
+ vfree(ecc_count);
+ return -ENOENT;
+ }
+
+ dbg_ecc_count = ecc_count;
+
+ return 0;
+}
+/*****************************************************************************/
+
+static int dbgfs_ecc_count_uninit(void)
+{
+ if (!dbg_ecc_count)
+ return 0;
+
+ mutex_lock(&dbg_ecc_count_mutex);
+
+ debugfs_remove(dbg_ecc_count->dentry);
+
+ vfree(dbg_ecc_count);
+ dbg_ecc_count = NULL;
+
+ mutex_unlock(&dbg_ecc_count_mutex);
+
+ return 0;
+}
+/*****************************************************************************/
+
+static void dbg_ecc_count_read(struct hinfc_host *host)
+{
+ unsigned int page;
+ struct hinfc610_dbg_ecc_count_item_t *item;
+
+ mutex_lock(&dbg_ecc_count_mutex);
+
+ if (!dbg_ecc_count)
+ goto exit;
+
+ page = GET_PAGE_INDEX(host);
+
+ if (page < dbg_ecc_count->offset ||
+ page > (dbg_ecc_count->offset + dbg_ecc_count->length))
+ goto exit;
+
+ item = GET_ITEM(dbg_ecc_count, dbg_ecc_count->index);
+
+ dbg_ecc_count->count++;
+
+ do_gettime(&item->hour, &item->min, &item->sec, &item->msec);
+
+ item->page = page;
+ item->page_status = host->page_status;
+
+ if (!IS_PS_UN_ECC(host))
+ dbg_ecc_count->ecc_inf->ecc_inf(host, item->ecc);
+
+ if (++dbg_ecc_count->index >= CONFIG_HINFC610_DBG_ECC_COUNT_NUM)
+ dbg_ecc_count->index = 0;
+
+exit:
+ mutex_unlock(&dbg_ecc_count_mutex);
+}
+/*****************************************************************************/
+
+struct hinfc610_dbg_inf_t hinfc610_dbg_inf_ecc_count = {
+ "ecc_count", 0,
+ dbgfs_ecc_count_init,
+ dbgfs_ecc_count_uninit,
+ dbg_ecc_count_read,
+ NULL,
+ NULL,
+ NULL,
+};
+/*****************************************************************************/
diff --git a/drivers/mtd/nand/hinfc610/hinfc610_dbg_ecc_dump.c b/drivers/mtd/nand/hinfc610/hinfc610_dbg_ecc_dump.c
new file mode 100644
index 0000000..a1b7eda
--- /dev/null
+++ b/drivers/mtd/nand/hinfc610/hinfc610_dbg_ecc_dump.c
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "hinfc610_os.h"
+#include "hinfc610.h"
+#include "hinfc610_dbg.h"
+
+/*****************************************************************************/
+static inline void hinfc610_detect_ecc(unsigned char ecc[], int begin,
+ int end, unsigned int reg)
+{
+ while (begin < end) {
+ ecc[begin] = (reg & 0xff);
+ reg = (reg >> 8);
+ begin++;
+ }
+}
+/*****************************************************************************/
+
+static void hinfc610_ecc_32k(struct hinfc_host *host, unsigned char ecc[])
+{
+ int ix, jx, kx;
+
+ for (ix = 0, jx = 0; ix < 4; ix ++, jx += 4)
+ hinfc610_detect_ecc(ecc, jx, jx + 4,
+ hinfc_read(host, 0xA0 + jx));
+ kx = jx;
+ for (ix = 0, jx = 0; ix < 4; ix ++, jx += 4)
+ hinfc610_detect_ecc(ecc, kx, kx + 4,
+ hinfc_read(host, 0xDC + jx));
+}
+/*****************************************************************************/
+
+static void hinfc610_ecc_16k(struct hinfc_host *host, unsigned char ecc[])
+{
+ int ix, jx;
+
+ for (ix = 0, jx = 0; ix < 4; ix ++, jx += 4)
+ hinfc610_detect_ecc(ecc, jx, jx + 4,
+ hinfc_read(host, 0xA0 + jx));
+}
+/*****************************************************************************/
+
+static void hinfc610_ecc_8k(struct hinfc_host *host, unsigned char ecc[])
+{
+ int ix, jx;
+
+ for (ix = 0, jx = 0; ix < 2; ix ++, jx += 4)
+ hinfc610_detect_ecc(ecc, jx, jx + 4,
+ hinfc_read(host, 0xA0 + jx));
+}
+/*****************************************************************************/
+
+static void hinfc610_ecc_4k(struct hinfc_host *host, unsigned char ecc[])
+{
+ hinfc610_detect_ecc(ecc, 0, 4, hinfc_read(host, 0xA0));
+}
+/*****************************************************************************/
+
+static void hinfc610_ecc_2k(struct hinfc_host *host, unsigned char ecc[])
+{
+ hinfc610_detect_ecc(ecc, 0, 2, hinfc_read(host, 0xA0));
+}
+/*****************************************************************************/
+
+static struct hinfc610_ecc_inf_t hinfc610_ecc_inf[] = {
+
+ {32768, NAND_ECC_80BIT, 32, hinfc610_ecc_32k},
+ {32768, NAND_ECC_72BIT, 32, hinfc610_ecc_32k},
+ {32768, NAND_ECC_60BIT, 32, hinfc610_ecc_32k},
+ {32768, NAND_ECC_48BIT, 32, hinfc610_ecc_32k},
+ {32768, NAND_ECC_41BIT, 32, hinfc610_ecc_32k},
+
+ {16384, NAND_ECC_80BIT, 16, hinfc610_ecc_16k},
+ {16384, NAND_ECC_72BIT, 16, hinfc610_ecc_16k},
+ {16384, NAND_ECC_60BIT, 16, hinfc610_ecc_16k},
+ {16384, NAND_ECC_48BIT, 16, hinfc610_ecc_16k},
+ {16384, NAND_ECC_41BIT, 16, hinfc610_ecc_16k},
+
+ {8192, NAND_ECC_80BIT, 8, hinfc610_ecc_8k},
+ {8192, NAND_ECC_72BIT, 8, hinfc610_ecc_8k},
+ {8192, NAND_ECC_60BIT, 8, hinfc610_ecc_8k},
+ {8192, NAND_ECC_48BIT, 8, hinfc610_ecc_8k},
+ {8192, NAND_ECC_41BIT, 8, hinfc610_ecc_8k},
+ {8192, NAND_ECC_32BIT, 8, hinfc610_ecc_8k},
+ {8192, NAND_ECC_27BIT, 8, hinfc610_ecc_8k},
+ {8192, NAND_ECC_24BIT, 8, hinfc610_ecc_8k},
+
+
+
+ {4096, NAND_ECC_32BIT, 4, hinfc610_ecc_4k},
+ {4096, NAND_ECC_27BIT, 4, hinfc610_ecc_4k},
+ {4096, NAND_ECC_24BIT, 4, hinfc610_ecc_4k},
+ {4096, NAND_ECC_18BIT, 4, hinfc610_ecc_4k},
+ {4096, NAND_ECC_13BIT, 4, hinfc610_ecc_4k},
+ {4096, NAND_ECC_8BIT, 4, hinfc610_ecc_4k},
+
+ {2048, NAND_ECC_32BIT, 2, hinfc610_ecc_2k},
+ {2048, NAND_ECC_27BIT, 2, hinfc610_ecc_2k},
+ {2048, NAND_ECC_24BIT, 2, hinfc610_ecc_2k},
+ {2048, NAND_ECC_18BIT, 2, hinfc610_ecc_2k},
+ {2048, NAND_ECC_13BIT, 2, hinfc610_ecc_2k},
+ {2048, NAND_ECC_8BIT, 2, hinfc610_ecc_2k},
+ {0, 0, 0},
+};
+/*****************************************************************************/
+
+struct hinfc610_ecc_inf_t *hinfc610_get_ecc_inf(struct hinfc_host *host,
+ int pagesize, int ecctype)
+{
+ struct hinfc610_ecc_inf_t *inf;
+
+ for (inf = hinfc610_ecc_inf; inf->pagesize; inf++)
+ if (inf->pagesize == pagesize && inf->ecctype == ecctype)
+ return inf;
+
+ return NULL;
+}
diff --git a/drivers/mtd/nand/hinfc610/hinfc610_dbg_erase_count.c b/drivers/mtd/nand/hinfc610/hinfc610_dbg_erase_count.c
new file mode 100644
index 0000000..eedbd2b
--- /dev/null
+++ b/drivers/mtd/nand/hinfc610/hinfc610_dbg_erase_count.c
@@ -0,0 +1,317 @@
+/*
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "hinfc610_os.h"
+#include "hinfc610.h"
+#include "hinfc610_dbg.h"
+
+struct hinfc610_dbg_erase_count_t {
+
+ unsigned int index; /* display pos */
+ unsigned int offset; /* display offset */
+ unsigned int length; /* display length */
+
+ struct dentry *dentry;
+
+ unsigned int blocknum;
+ unsigned int page_per_block;
+
+ unsigned int pe[1];
+};
+
+static DEFINE_MUTEX(dbg_erase_count_mutex);
+static struct hinfc610_dbg_erase_count_t *dbg_erase_count;
+
+/*****************************************************************************/
+
+static int dbgfs_erase_count_read(struct file *filp, char __user *buffer,
+ size_t count, loff_t *ppos)
+{
+ int len = 0;
+ int value = 0;
+ unsigned int *pe;
+ unsigned int index;
+ char buf[128] = {0};
+ char __user *pusrbuf = buffer;
+
+ if (*ppos == 0) {
+ dbg_erase_count->index = dbg_erase_count->offset;
+
+ len = snprintf(buf, sizeof(buf),
+ "Print parameter: \"offset=%d length=%d\"\n",
+ dbg_erase_count->offset,
+ dbg_erase_count->length);
+
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+ pusrbuf += len;
+
+ len = snprintf(buf, sizeof(buf),
+ "Block Index ---------------- "
+ "Erase count from system startup ----------------\n");
+
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+ pusrbuf += len;
+ }
+
+ for (index = dbg_erase_count->index;
+ index < (dbg_erase_count->offset + dbg_erase_count->length) &&
+ ((pusrbuf - buffer) < (count - 100));
+ index += 8) {
+
+ pe = &dbg_erase_count->pe[index];
+
+ len = snprintf(buf, sizeof(buf),
+ "%4d: %8u %8u %8u %8u %8u %8u %8u %8u\n",
+ index,
+ pe[0], pe[1], pe[2], pe[3],
+ pe[4], pe[5], pe[6], pe[7]);
+
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+ pusrbuf += len;
+ }
+
+ dbg_erase_count->index = index;
+
+ *ppos += (pusrbuf - buffer);
+ value = pusrbuf - buffer;
+ return value;
+}
+/*****************************************************************************/
+/*
+ * echo "offset=48,length=78" > /sys/kernel/debug/nand/erase_count
+ * echo "clear" > /sys/kernel/debug/nand/erase_count
+ *
+
+ # cat ./debugfs/nand/erase_count
+ Print parameter: "offset=0 length=1024"
+ Block Index ---------------- Erase count from system startup ----------------
+ 0: 0 0 0 0 0 0 0 0
+ 8: 0 0 0 0 0 0 0 0
+ 16: 0 0 0 0 0 0 0 0
+ 24: 0 0 0 0 0 0 0 0
+ 32: 0 0 0 0 0 0 0 0
+ 40: 0 0 0 0 0 0 0 0
+ 48: 0 0 0 0 0 0 0 0
+ 56: 0 0 0 0 0 0 0 0
+ 64: 0 0 0 0 0 0 0 0
+ 72: 0 0 0 0 0 0 0 0
+ 80: 0 0 0 0 0 0 0 0
+
+ */
+static int dbgfs_erase_count_write(struct file *filp,
+ const char __user *buffer,
+ size_t count, loff_t *ppos)
+{
+ char *str;
+ char buf[128] = {0};
+ int ret;
+ unsigned long value = 0;
+ unsigned long pos = 0;
+
+ if (count > sizeof(buf))
+ count = sizeof(buf);
+
+ if (copy_from_user(buf, buffer, count))
+ return -EFAULT;
+
+ while (pos < count) {
+ while (pos < count &&
+ (buf[pos] == ' ' || buf[pos] == ',' || buf[pos] == ';'))
+ pos++;
+
+ if (pos >= count)
+ break;
+
+ switch (buf[pos]) {
+
+ case 'o':
+
+ if (memcmp(&buf[pos], CMD_WORD_OFFSET,
+ sizeof(CMD_WORD_OFFSET) - 1))
+ break;
+
+ pos += sizeof(CMD_WORD_OFFSET) - 1;
+ str = (char *)(buf + pos);
+ ret = kstrtoul(str, 10, &value);
+ if (ret < 0)
+ value = 0;
+ if (value >= dbg_erase_count->blocknum)
+ value = 0;
+
+ dbg_erase_count->offset = (value & ~7);
+
+ break;
+
+ case 'l':
+ if (memcmp(&buf[pos], CMD_WORD_LENGTH,
+ sizeof(CMD_WORD_LENGTH) - 1))
+ break;
+
+ pos += sizeof(CMD_WORD_LENGTH) - 1;
+ str = (char *)(buf + pos);
+ ret = kstrtoul(str, 10, &value);
+ if (ret < 0)
+ value = dbg_erase_count->blocknum;
+
+ value = ((value + 7) & ~7);
+
+ if (dbg_erase_count->offset + value
+ > dbg_erase_count->blocknum)
+ value = dbg_erase_count->blocknum
+ - dbg_erase_count->offset;
+
+ dbg_erase_count->length = value;
+
+ break;
+
+ case 'c':
+ if (memcmp(&buf[pos], CMD_WORD_CLEAN,
+ sizeof(CMD_WORD_CLEAN) - 1))
+ break;
+
+ memset(dbg_erase_count->pe, 0,
+ dbg_erase_count->blocknum *
+ sizeof(struct hinfc610_dbg_erase_count_t));
+
+ return count;
+ }
+
+ while (pos < count &&
+ (buf[pos] != ' ' && buf[pos] != ',' && buf[pos] != ';'))
+ pos++;
+ }
+
+ return count;
+}
+/*****************************************************************************/
+
+static const struct file_operations dbgfs_erase_count_fops = {
+ .owner = THIS_MODULE,
+ .read = dbgfs_erase_count_read,
+ .write = dbgfs_erase_count_write,
+};
+/*****************************************************************************/
+
+static int dbgfs_erase_count_init(struct dentry *root, struct hinfc_host *host)
+{
+ unsigned int size;
+ unsigned int blocknum;
+ unsigned int pagesize;
+ unsigned int blocksize;
+ unsigned int chipsize;
+ struct hinfc610_dbg_erase_count_t *erase_count;
+
+ if (dbg_erase_count)
+ return 0;
+
+ pagesize = (host->pagesize >> 10);
+ blocksize = (host->mtd->erasesize >> 10);
+ chipsize = (unsigned int)(host->chip->chipsize >> 10);
+
+ blocknum = chipsize / blocksize;
+ size = sizeof(int) * blocknum
+ + sizeof(struct hinfc610_dbg_erase_count_t);
+
+ erase_count = vmalloc(size);
+ if (!erase_count) {
+ PR_ERR("Can't allocate memory.\n");
+ return -ENOMEM;
+ }
+ memset(erase_count, 0, size);
+
+ erase_count->blocknum = blocknum;
+ erase_count->page_per_block = blocksize / pagesize;
+ erase_count->length = blocknum;
+
+ erase_count->dentry = debugfs_create_file("erase_count",
+ S_IFREG | S_IRUSR | S_IWUSR,
+ root, NULL, &dbgfs_erase_count_fops);
+ if (!erase_count->dentry) {
+ PR_ERR("Can't create 'erase_count' file.\n");
+ vfree(erase_count);
+ return -ENOENT;
+ }
+
+ dbg_erase_count = erase_count;
+
+ return 0;
+}
+/*****************************************************************************/
+
+static int dbgfs_erase_count_uninit(void)
+{
+ if (!dbg_erase_count)
+ return 0;
+
+ mutex_lock(&dbg_erase_count_mutex);
+
+ debugfs_remove(dbg_erase_count->dentry);
+
+ vfree(dbg_erase_count);
+ dbg_erase_count = NULL;
+
+ mutex_unlock(&dbg_erase_count_mutex);
+
+ return 0;
+}
+/*****************************************************************************/
+
+static void dbg_erase_count_erase(struct hinfc_host *host)
+{
+ unsigned int block_index;
+
+ mutex_lock(&dbg_erase_count_mutex);
+
+ if (!dbg_erase_count)
+ goto exit;
+
+ block_index = (host->addr_value[0] / dbg_erase_count->page_per_block);
+
+ if (block_index > dbg_erase_count->blocknum) {
+ PR_ERR("Block out of range.\n");
+ return;
+ }
+
+ dbg_erase_count->pe[block_index]++;
+
+exit:
+ mutex_unlock(&dbg_erase_count_mutex);
+}
+/*****************************************************************************/
+
+struct hinfc610_dbg_inf_t hinfc610_dbg_inf_erase_count = {
+ "erase_count", 0,
+ dbgfs_erase_count_init,
+ dbgfs_erase_count_uninit,
+ NULL,
+ NULL,
+ dbg_erase_count_erase,
+ NULL,
+};
diff --git a/drivers/mtd/nand/hinfc610/hinfc610_dbg_inf.c b/drivers/mtd/nand/hinfc610/hinfc610_dbg_inf.c
new file mode 100644
index 0000000..f3e7140
--- /dev/null
+++ b/drivers/mtd/nand/hinfc610/hinfc610_dbg_inf.c
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "hinfc610_os.h"
+#include "hinfc610.h"
+#include "hinfc610_dbg.h"
+
+void hinfc610_dbg_write(struct hinfc_host *host)
+{
+#ifdef CONFIG_HINFC610_DBG_NAND_DEBUG
+ struct hinfc610_dbg_inf_t **inf;
+
+ for (inf = hinfc610_dbg_inf; *inf; inf++)
+ if ((*inf)->enable && (*inf)->write)
+ (*inf)->write(host);
+#endif
+}
+
+void hinfc610_dbg_erase(struct hinfc_host *host)
+{
+#ifdef CONFIG_HINFC610_DBG_NAND_DEBUG
+ struct hinfc610_dbg_inf_t **inf;
+
+ for (inf = hinfc610_dbg_inf; *inf; inf++)
+ if ((*inf)->enable && (*inf)->erase)
+ (*inf)->erase(host);
+#endif
+}
+
+void hinfc610_dbg_read(struct hinfc_host *host)
+{
+#ifdef CONFIG_HINFC610_DBG_NAND_DEBUG
+ struct hinfc610_dbg_inf_t **inf;
+
+ for (inf = hinfc610_dbg_inf; *inf; inf++)
+ if ((*inf)->enable && (*inf)->read)
+ (*inf)->read(host);
+#endif
+}
+
+void hinfc610_dbg_read_retry(struct hinfc_host *host, int index)
+{
+#ifdef CONFIG_HINFC610_DBG_NAND_DEBUG
+ struct hinfc610_dbg_inf_t **inf;
+
+ for (inf = hinfc610_dbg_inf; *inf; inf++)
+ if ((*inf)->enable && (*inf)->read_retry)
+ (*inf)->read_retry(host, index);
+#endif
+}
+
+int hinfc610_dbg_init(struct hinfc_host *host)
+{
+#ifdef CONFIG_HINFC610_DBG_NAND_DEBUG
+ return hinfc610_dbgfs_debug_init(host);
+#endif
+ return 0;
+}
diff --git a/drivers/mtd/nand/hinfc610/hinfc610_dbg_inf.h b/drivers/mtd/nand/hinfc610/hinfc610_dbg_inf.h
new file mode 100644
index 0000000..10ac797
--- /dev/null
+++ b/drivers/mtd/nand/hinfc610/hinfc610_dbg_inf.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#ifndef HINFC610_DBG_INFH
+#define HINFC610_DBG_INFH
+/******************************************************************************/
+
+int hinfc610_dbg_init(struct hinfc_host *host);
+
+void hinfc610_dbg_write(struct hinfc_host *host);
+
+void hinfc610_dbg_erase(struct hinfc_host *host);
+
+void hinfc610_dbg_read(struct hinfc_host *host);
+
+void hinfc610_dbg_read_retry(struct hinfc_host *host, int index);
+
+/******************************************************************************/
+#endif /* HINFC610_DBG_INFH */
diff --git a/drivers/mtd/nand/hinfc610/hinfc610_dbg_read_retry.c b/drivers/mtd/nand/hinfc610/hinfc610_dbg_read_retry.c
new file mode 100644
index 0000000..176d9c1
--- /dev/null
+++ b/drivers/mtd/nand/hinfc610/hinfc610_dbg_read_retry.c
@@ -0,0 +1,385 @@
+/*
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "hinfc610_os.h"
+#include "hinfc610.h"
+#include "hinfc610_dbg.h"
+
+#ifndef CONFIG_HINFC610_DBG_READ_RETRY_NUM
+# define CONFIG_HINFC610_DBG_READ_RETRY_NUM (100)
+#endif /* CONFIG_HINFC610_DBG_READ_RETRY_NUM */
+
+struct hinfc610_dbg_read_retry_item_t {
+ unsigned int page;
+
+ unsigned short hour;
+ unsigned short min;
+ unsigned short sec;
+ unsigned short msec;
+
+ unsigned short retry; /* success retry */
+ unsigned short ecc_err;
+};
+
+struct hinfc610_dbg_read_retry_t {
+
+ struct dentry *dentry;
+ unsigned int index; /* current logs index */
+ int count; /* number of logs */
+
+ unsigned int offset;
+ unsigned int length;
+ unsigned int pagecount;
+
+ unsigned int read_index;
+
+ unsigned int max_retry; /* the max read retry times */
+ unsigned int retry[16];
+
+ struct hinfc610_dbg_read_retry_item_t
+ item[CONFIG_HINFC610_DBG_READ_RETRY_NUM];
+};
+
+static DEFINE_MUTEX(dbg_read_retry_mutex);
+static struct hinfc610_dbg_read_retry_t *dbg_read_retry;
+/*****************************************************************************/
+
+static void do_gettime(unsigned short *hour, unsigned short *min,
+ unsigned short *sec, unsigned short *msec)
+{
+ long val;
+ struct timeval tv;
+
+ do_gettimeofday(&tv);
+ val = tv.tv_sec % 86400; /* the second form 0 hour */
+
+ if (hour)
+ *hour = val / 3600;
+ val %= 3600;
+ if (min)
+ *min = val / 60;
+ if (sec)
+ *sec = val % 60;
+ if (msec)
+ *msec = tv.tv_usec / 1000;
+}
+/*****************************************************************************/
+
+static ssize_t dbgfs_read_retry_read(struct file *filp, char __user *buffer,
+ size_t count, loff_t *ppos)
+{
+ int ix;
+ char *ptr;
+ int len = 0;
+ char buf[128] = {0};
+ unsigned int read_index;
+ char __user *pusrbuf = buffer;
+ struct hinfc610_dbg_read_retry_item_t *item;
+
+ if (*ppos == 0) {
+
+ if (dbg_read_retry->count
+ < CONFIG_HINFC610_DBG_READ_RETRY_NUM)
+ dbg_read_retry->read_index = 0;
+ else
+ dbg_read_retry->read_index
+ = (dbg_read_retry->index + 1);
+
+ len = snprintf(buf, sizeof(buf),
+ "Print parameter: \"offset=%d length=%d\"\n",
+ dbg_read_retry->offset,
+ dbg_read_retry->length);
+
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+ pusrbuf += len;
+
+ len = snprintf(buf, sizeof(buf),
+ " UTC Clock page read retry (max: %d)\n",
+ dbg_read_retry->max_retry);
+
+ ptr = buf;
+ ptr += sprintf(ptr, "Read retry: ");
+ for (ix = 1; ix <= dbg_read_retry->max_retry; ix++)
+ ptr += sprintf(ptr, "%d, ", dbg_read_retry->retry[ix]);
+ ptr += sprintf(ptr, "\n");
+
+ len = (ptr - buf);
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+ pusrbuf += len;
+
+
+ len = snprintf(buf, sizeof(buf),
+ " UTC Clock page read retry (max: %d)\n",
+ dbg_read_retry->max_retry);
+
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+ pusrbuf += len;
+
+ } else if (dbg_read_retry->read_index == dbg_read_retry->index)
+ return 0;
+
+ for (read_index = dbg_read_retry->read_index;
+ (read_index != dbg_read_retry->index); ++read_index) {
+
+ if (read_index >= CONFIG_HINFC610_DBG_READ_RETRY_NUM)
+ read_index = 0;
+
+ item = &dbg_read_retry->item[read_index];
+
+ if ((count - (pusrbuf - buffer)) < 80)
+ break;
+
+ len = snprintf(buf, sizeof(buf),
+ "%02d:%02d:%02d.%04d 0x%08X ",
+ item->hour, item->min, item->sec, item->msec,
+ item->page);
+
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+ pusrbuf += len;
+
+ if (!item->ecc_err)
+ len = sprintf(buf, "%d\n", item->retry);
+ else
+ len = sprintf(buf, "fail\n");
+
+ if (copy_to_user(pusrbuf, buf, len))
+ return -EFAULT;
+ pusrbuf += len;
+ }
+
+ dbg_read_retry->read_index = read_index;
+
+ *ppos += (pusrbuf - buffer);
+ return pusrbuf - buffer;
+}
+/******************************************************************************/
+/*
+ * echo "offset=8192,length=102400" > read_retry
+ *
+ */
+static ssize_t dbgfs_read_retry_write(struct file *filp,
+ const char __user *buffer, size_t count,
+ loff_t *ppos)
+{
+ char *str;
+ char buf[128] = {0};
+ int ret;
+ unsigned long value = 0;
+ unsigned long pos = 0;
+
+ if (count > sizeof(buf))
+ count = sizeof(buf);
+
+ if (copy_from_user(buf, buffer, count))
+ return -EFAULT;
+
+ while (pos < count) {
+ while (pos < count &&
+ (buf[pos] == ' ' || buf[pos] == ',' || buf[pos] == ';'))
+ pos++;
+
+ if (pos >= count)
+ break;
+
+ switch (buf[pos]) {
+
+ case 'o':
+
+ if (memcmp(&buf[pos], CMD_WORD_OFFSET,
+ sizeof(CMD_WORD_OFFSET) - 1))
+ break;
+
+ pos += sizeof(CMD_WORD_OFFSET) - 1;
+ str = (char *)(buf + pos);
+ ret = kstrtoul(str, 10, &value);
+
+ if (ret < 0)
+ value = 0;
+ if (value >= dbg_read_retry->pagecount)
+ value = 0;
+
+ dbg_read_retry->offset = (value & ~7);
+
+ break;
+
+ case 'l':
+ if (memcmp(&buf[pos], CMD_WORD_LENGTH,
+ sizeof(CMD_WORD_LENGTH) - 1))
+ break;
+
+ pos += sizeof(CMD_WORD_LENGTH) - 1;
+ str = (char *)(buf + pos);
+ ret = kstrtoul(str, 10, &value);
+
+ if (ret < 0)
+ value = dbg_read_retry->pagecount;
+
+ value = ((value + 7) & ~7);
+
+ if (dbg_read_retry->offset + value >
+ dbg_read_retry->pagecount)
+ value = dbg_read_retry->pagecount
+ - dbg_read_retry->offset;
+
+ dbg_read_retry->length = value;
+
+ break;
+ }
+
+ while (pos < count &&
+ (buf[pos] != ' ' && buf[pos] != ',' && buf[pos] != ';'))
+ pos++;
+ }
+
+ return count;
+}
+/******************************************************************************/
+
+static const struct file_operations dbgfs_read_retry_fops = {
+ .owner = THIS_MODULE,
+ .read = dbgfs_read_retry_read,
+ .write = dbgfs_read_retry_write,
+};
+/*****************************************************************************/
+
+static int dbgfs_read_retry_init(struct dentry *root, struct hinfc_host *host)
+{
+ unsigned int pagesize;
+ unsigned int chipsize;
+ struct hinfc610_dbg_read_retry_t *read_retry;
+
+ if (dbg_read_retry)
+ return 0;
+
+ if (!host->read_retry) {
+ pr_warn("read_retry: The NAND not support this interface.\n");
+ return -1;
+ }
+
+ read_retry = vmalloc(sizeof(struct hinfc610_dbg_read_retry_t));
+ if (!read_retry) {
+ PR_ERR("Can't allocate memory.\n");
+ return -ENOMEM;
+ }
+ memset(read_retry, 0, sizeof(struct hinfc610_dbg_read_retry_t));
+
+ pagesize = (host->pagesize >> 10);
+ chipsize = (unsigned int)(host->chip->chipsize >> 10);
+ read_retry->pagecount = (chipsize / pagesize);
+ read_retry->length = read_retry->pagecount;
+ read_retry->max_retry = host->read_retry->count;
+
+ if (read_retry->max_retry > 16) {
+ vfree(read_retry);
+ PR_ERR("Bug, max_retry too small.\n");
+ return -EFAULT;
+ }
+
+ read_retry->dentry = debugfs_create_file("read_retry",
+ S_IFREG | S_IRUSR | S_IWUSR,
+ root, NULL, &dbgfs_read_retry_fops);
+ if (!read_retry->dentry) {
+ PR_ERR("Can't create 'read_retry' file.\n");
+ vfree(read_retry);
+ return -ENOENT;
+ }
+
+ dbg_read_retry = read_retry;
+
+ return 0;
+}
+/*****************************************************************************/
+
+static int dbgfs_read_retry_uninit(void)
+{
+ if (!dbg_read_retry)
+ return 0;
+
+ mutex_lock(&dbg_read_retry_mutex);
+
+ debugfs_remove(dbg_read_retry->dentry);
+
+ vfree(dbg_read_retry);
+ dbg_read_retry = NULL;
+
+ mutex_unlock(&dbg_read_retry_mutex);
+
+ return 0;
+}
+/*****************************************************************************/
+
+static void hinfc610_dbg_read_retry_rr(struct hinfc_host *host, int index)
+{
+ unsigned int page;
+ struct hinfc610_dbg_read_retry_item_t *item;
+
+ mutex_lock(&dbg_read_retry_mutex);
+
+ if (!dbg_read_retry)
+ goto exit;
+
+ page = GET_PAGE_INDEX(host);
+
+ if (page < dbg_read_retry->offset ||
+ page > (dbg_read_retry->offset + dbg_read_retry->length))
+ goto exit;
+
+ item = &dbg_read_retry->item[dbg_read_retry->index];
+
+ dbg_read_retry->count++;
+
+ do_gettime(&item->hour, &item->min, &item->sec, &item->msec);
+
+ item->page = page;
+ item->retry = index;
+
+ item->ecc_err = IS_PS_UN_ECC(host) ? 1 : 0;
+ if (!item->ecc_err)
+ dbg_read_retry->retry[index]++;
+
+ if (++dbg_read_retry->index >= CONFIG_HINFC610_DBG_READ_RETRY_NUM)
+ dbg_read_retry->index = 0;
+
+exit:
+ mutex_unlock(&dbg_read_retry_mutex);
+}
+/*****************************************************************************/
+
+struct hinfc610_dbg_inf_t hinfc610_dbg_inf_read_retry = {
+ "read_retry", 0,
+ dbgfs_read_retry_init,
+ dbgfs_read_retry_uninit,
+ NULL,
+ NULL,
+ NULL,
+ hinfc610_dbg_read_retry_rr,
+};
+/*****************************************************************************/
diff --git a/drivers/mtd/nand/hinfc610/hinfc610_gen.c b/drivers/mtd/nand/hinfc610/hinfc610_gen.c
new file mode 100644
index 0000000..2b43cf9
--- /dev/null
+++ b/drivers/mtd/nand/hinfc610/hinfc610_gen.c
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include "../match_table.h"
+#include "hinfc610_gen.h"
+
+/*****************************************************************************/
+
+static struct match_reg_type page_type2reg[] = {
+ {
+ hinfc610_pagesize_2K, NAND_PAGE_2K,
+ }, {
+ hinfc610_pagesize_4K, NAND_PAGE_4K,
+ }, {
+ hinfc610_pagesize_8K, NAND_PAGE_8K,
+ }, {
+ hinfc610_pagesize_16K, NAND_PAGE_16K,
+ }, {
+ hinfc610_pagesize_32K, NAND_PAGE_32K,
+ }
+};
+
+enum hinfc610_page_reg hinfc610_page_type2reg(int type)
+{
+ return type2reg(page_type2reg, ARRAY_SIZE(page_type2reg), type, 0);
+}
+
+int hinfc610_page_reg2type(enum hinfc610_page_reg reg)
+{
+ return reg2type(page_type2reg, ARRAY_SIZE(page_type2reg), reg, 0);
+}
+/*****************************************************************************/
+
+static struct match_reg_type ecc_type2reg[] = {
+ {
+ hinfc610_ecc_none, NAND_ECC_NONE,
+ }, {
+ hinfc610_ecc_8bit, NAND_ECC_8BIT,
+ }, {
+ hinfc610_ecc_13bit, NAND_ECC_13BIT,
+ }, {
+ hinfc610_ecc_18bit, NAND_ECC_18BIT,
+ }, {
+ hinfc610_ecc_24bit, NAND_ECC_24BIT,
+ }, {
+ hinfc610_ecc_27bit, NAND_ECC_27BIT,
+ }, {
+ hinfc610_ecc_32bit, NAND_ECC_32BIT,
+ }, {
+ hinfc610_ecc_41bit, NAND_ECC_41BIT,
+ }, {
+ hinfc610_ecc_48bit, NAND_ECC_48BIT,
+ }, {
+ hinfc610_ecc_60bit, NAND_ECC_60BIT,
+ }, {
+ hinfc610_ecc_72bit, NAND_ECC_72BIT,
+ }, {
+ hinfc610_ecc_80bit, NAND_ECC_80BIT,
+ }
+};
+
+enum hinfc610_ecc_reg hinfc610_ecc_type2reg(int type)
+{
+ return type2reg(ecc_type2reg, ARRAY_SIZE(ecc_type2reg), type, 0);
+}
+
+int hinfc610_ecc_reg2type(enum hinfc610_ecc_reg reg)
+{
+ return reg2type(ecc_type2reg, ARRAY_SIZE(ecc_type2reg), reg, 0);
+}
diff --git a/drivers/mtd/nand/hinfc610/hinfc610_gen.h b/drivers/mtd/nand/hinfc610/hinfc610_gen.h
new file mode 100644
index 0000000..c41ff6f
--- /dev/null
+++ b/drivers/mtd/nand/hinfc610/hinfc610_gen.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#ifndef HINFC610_GENH
+#define HINFC610_GENH
+/******************************************************************************/
+
+#include "../hinfc_gen.h"
+
+enum hinfc610_ecc_reg {
+ hinfc610_ecc_none = 0x00,
+ hinfc610_ecc_8bit = 0x01,
+ hinfc610_ecc_13bit = 0x02,
+ hinfc610_ecc_18bit = 0x03,
+ hinfc610_ecc_24bit = 0x04,
+ hinfc610_ecc_27bit = 0x05,
+ hinfc610_ecc_32bit = 0x06,
+ hinfc610_ecc_41bit = 0x07,
+ hinfc610_ecc_48bit = 0x08,
+ hinfc610_ecc_60bit = 0x09,
+ hinfc610_ecc_72bit = 0x0a,
+ hinfc610_ecc_80bit = 0x0b,
+};
+
+enum hinfc610_page_reg {
+ hinfc610_pagesize_2K = 0x01,
+ hinfc610_pagesize_4K = 0x02,
+ hinfc610_pagesize_8K = 0x03,
+ hinfc610_pagesize_16K = 0x04,
+ hinfc610_pagesize_32K = 0x05,
+};
+
+enum hinfc610_page_reg hinfc610_page_type2reg(int type);
+
+int hinfc610_page_reg2type(enum hinfc610_page_reg reg);
+
+enum hinfc610_ecc_reg hinfc610_ecc_type2reg(int type);
+
+int hinfc610_ecc_reg2type(enum hinfc610_ecc_reg reg);
+
+/******************************************************************************/
+#endif /* HINFC610_GENH */
diff --git a/drivers/mtd/nand/hinfc610/hinfc610_os.c b/drivers/mtd/nand/hinfc610/hinfc610_os.c
new file mode 100644
index 0000000..9682000
--- /dev/null
+++ b/drivers/mtd/nand/hinfc610/hinfc610_os.c
@@ -0,0 +1,245 @@
+/*
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+#include
+#include "hinfc610_os.h"
+#include "hinfc610.h"
+
+/*****************************************************************************/
+
+static int hinfc610_nand_pre_probe(struct nand_chip *chip)
+{
+ uint8_t nand_maf_id;
+ struct hinfc_host *host = chip->priv;
+
+ /* Reset the chip first */
+ host->send_cmd_reset(host, 0);
+
+ /* Check the ID */
+ host->offset = 0;
+ memset((unsigned char *)(chip->IO_ADDR_R), 0, 0x10);
+ host->send_cmd_readid(host);
+ nand_maf_id = readb(chip->IO_ADDR_R);
+
+ if (nand_maf_id == 0x00 || nand_maf_id == 0xff) {
+ PR_BUG("\nCannot found a valid Nand Device\n");
+ return 1;
+ }
+
+ return 0;
+}
+/*****************************************************************************/
+
+static int hinfc610_os_probe(struct platform_device *pltdev)
+{
+ int size;
+ int result = 0;
+ struct hinfc_host *host;
+ struct nand_chip *chip;
+ struct mtd_info *mtd;
+ struct resource *rs_reg, *rs_io = NULL;
+ struct device *dev = &pltdev->dev;
+ struct device_node *np = NULL;
+
+ size = sizeof(struct hinfc_host) + sizeof(struct nand_chip)
+ + sizeof(struct mtd_info);
+ host = kmalloc(size, GFP_KERNEL);
+ if (!host) {
+ PR_BUG("failed to allocate device structure.\n");
+ return -ENOMEM;
+ }
+ memset((char *)host, 0, size);
+ platform_set_drvdata(pltdev, host);
+
+ host->dev = dev;
+ host->chip = chip = (struct nand_chip *)&host[1];
+ host->mtd = mtd = (struct mtd_info *)&chip[1];
+
+ host->clk = devm_clk_get(dev, NULL);
+ if (IS_ERR(host->clk))
+ return PTR_ERR(host->clk);
+ /* enable and set system clock */
+ clk_prepare_enable(host->clk);
+
+ rs_reg = platform_get_resource_byname(pltdev, IORESOURCE_MEM,
+ "control");
+ host->iobase = devm_ioremap_resource(dev, rs_reg);
+ if (IS_ERR(host->iobase)) {
+ PR_BUG("Error: Can't get resource for reg address.\n");
+ result = -EIO;
+ goto fail;
+ }
+
+ np = of_get_next_available_child(dev->of_node, NULL);
+
+ mtd->type = MTD_NANDFLASH;
+ mtd = nand_to_mtd(chip);
+ mtd->flags = MTD_CAP_NANDFLASH;
+ mtd->owner = THIS_MODULE;
+ mtd->name = np->name;
+
+ rs_io = platform_get_resource_byname(pltdev, IORESOURCE_MEM,
+ "memory");
+ chip->IO_ADDR_R = chip->IO_ADDR_W = devm_ioremap_resource(dev, rs_io);
+ if (IS_ERR(chip->IO_ADDR_R)) {
+ PR_BUG("Error: Can't get resource for buffer address.\n");
+ result = -EIO;
+ goto fail;
+ }
+
+ host->buffer = dma_alloc_coherent(host->dev,
+ (NAND_MAX_PAGESIZE + NAND_MAX_OOBSIZE),
+ &host->dma_buffer, GFP_KERNEL);
+ if (!host->buffer) {
+ PR_BUG("Can't malloc memory for NAND driver.");
+ result = -EIO;
+ goto fail;
+ }
+
+ chip->priv = host;
+ host->chip = chip;
+ chip->cmd_ctrl = hinfc610_cmd_ctrl;
+ chip->dev_ready = hinfc610_dev_ready;
+ chip->select_chip = hinfc610_select_chip;
+ chip->read_byte = hinfc610_read_byte;
+ chip->read_word = hinfc610_read_word;
+ chip->write_buf = hinfc610_write_buf;
+ chip->read_buf = hinfc610_read_buf;
+
+ chip->chip_delay = HINFC610_CHIP_DELAY;
+ chip->options = NAND_NEED_READRDY
+ | NAND_BROKEN_XD
+ | NAND_SKIP_BBTSCAN;
+ chip->ecc.mode = NAND_ECC_NONE;
+
+ if (hinfc610_nand_init(host, chip)) {
+ PR_BUG("failed to allocate device buffer.\n");
+ result = -EIO;
+ goto fail;
+ }
+
+ if (hinfc610_nand_pre_probe(chip)) {
+ result = -EXDEV;
+ goto fail;
+ }
+
+ if (nand_scan(mtd, CONFIG_HINFC610_MAX_CHIP)) {
+ result = -ENXIO;
+ goto fail;
+ }
+
+ result = mtd_device_register(mtd, NULL, 0);
+ if (result)
+ goto fail;
+
+ return result;
+
+fail:
+ if (host->buffer) {
+ dma_free_coherent(host->dev,
+ (NAND_MAX_PAGESIZE + NAND_MAX_OOBSIZE),
+ host->buffer,
+ host->dma_buffer);
+ host->buffer = NULL;
+ }
+ nand_release(host->mtd);
+ kfree(host);
+ platform_set_drvdata(pltdev, NULL);
+
+ return result;
+}
+/*****************************************************************************/
+
+static int hinfc610_os_remove(struct platform_device *pltdev)
+{
+ struct hinfc_host *host = platform_get_drvdata(pltdev);
+
+ clk_disable_unprepare(host->clk);
+
+ nand_release(host->mtd);
+
+ dma_free_coherent(host->dev,
+ (NAND_MAX_PAGESIZE + NAND_MAX_OOBSIZE),
+ host->buffer,
+ host->dma_buffer);
+ kfree(host);
+ platform_set_drvdata(pltdev, NULL);
+
+ return 0;
+}
+/*****************************************************************************/
+#ifdef CONFIG_PM
+static int hinfc610_os_suspend(struct platform_device *pltdev,
+ pm_message_t state)
+{
+ struct hinfc_host *host = platform_get_drvdata(pltdev);
+
+ while ((hinfc_read(host, HINFC610_STATUS) & 0x1) == 0x0)
+ ;
+
+ while ((hinfc_read(host, HINFC610_DMA_CTRL))
+ & HINFC610_DMA_CTRL_DMA_START)
+ _cond_resched();
+
+ clk_disable_unprepare(host->clk);
+
+ return 0;
+}
+/*****************************************************************************/
+
+static int hinfc610_os_resume(struct platform_device *pltdev)
+{
+ int cs;
+ struct hinfc_host *host = platform_get_drvdata(pltdev);
+ struct nand_chip *chip = host->chip;
+
+ clk_prepare_enable(host->clk);
+ for (cs = 0; cs < chip->numchips; cs++)
+ host->send_cmd_reset(host, cs);
+ hinfc_write(host,
+ SET_HINFC610_PWIDTH(CONFIG_HINFC610_W_LATCH,
+ CONFIG_HINFC610_R_LATCH, CONFIG_HINFC610_RW_LATCH),
+ HINFC610_PWIDTH);
+
+ return 0;
+}
+#endif /* CONFIG_PM */
+/*****************************************************************************/
+static const struct of_device_id hisi_nand_dt_ids[] = {
+ { .compatible = "hisilicon,hisi-parallel-nand" },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, hisi_nand_dt_ids);
+
+static struct platform_driver hisi_nand_driver = {
+ .driver = {
+ .name = "hisi-nand",
+ .of_match_table = hisi_nand_dt_ids,
+ },
+ .probe = hinfc610_os_probe,
+ .remove = hinfc610_os_remove,
+#ifdef CONFIG_PM
+ .suspend = hinfc610_os_suspend,
+ .resume = hinfc610_os_resume,
+#endif
+};
+module_platform_driver(hisi_nand_driver);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("BVT_BSP");
+MODULE_DESCRIPTION("Hisilicon Flash Memory Controller NFC610 Nand Driver");
diff --git a/drivers/mtd/nand/hinfc610/hinfc610_os.h b/drivers/mtd/nand/hinfc610/hinfc610_os.h
new file mode 100644
index 0000000..1dafd9e
--- /dev/null
+++ b/drivers/mtd/nand/hinfc610/hinfc610_os.h
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ *
+ */
+
+
+#ifndef HINFC610_OSH
+#define HINFC610_OSH
+/******************************************************************************/
+
+#include
+#include
+#include
+#include