]> git.sur5r.net Git - u-boot/commitdiff
Merge git://git.denx.de/u-boot-x86
authorTom Rini <trini@konsulko.com>
Fri, 14 Aug 2015 17:43:23 +0000 (13:43 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 14 Aug 2015 20:27:16 +0000 (16:27 -0400)
84 files changed:
arch/arm/cpu/armv7/sunxi/clock_sun4i.c
arch/arm/cpu/armv7/sunxi/clock_sun6i.c
arch/arm/dts/Makefile
arch/arm/dts/axp152.dtsi [new file with mode: 0644]
arch/arm/dts/axp209.dtsi
arch/arm/dts/sun4i-a10-ba10-tvbox.dts
arch/arm/dts/sun4i-a10-chuwi-v7-cw0825.dts
arch/arm/dts/sun4i-a10-cubieboard.dts
arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts [new file with mode: 0644]
arch/arm/dts/sun4i-a10-mini-xplus.dts
arch/arm/dts/sun4i-a10-olinuxino-lime.dts
arch/arm/dts/sun4i-a10.dtsi
arch/arm/dts/sun5i-a10s-auxtek-t003.dts [new file with mode: 0644]
arch/arm/dts/sun5i-a10s-olinuxino-micro.dts
arch/arm/dts/sun5i-a13-hsg-h702.dts
arch/arm/dts/sun5i-a13-olinuxino.dts
arch/arm/dts/sun5i-a13-utoo-p66.dts
arch/arm/dts/sun5i.dtsi
arch/arm/dts/sun6i-a31-colombus.dts
arch/arm/dts/sun6i-a31-m9.dts
arch/arm/dts/sun6i-a31-mele-a1000g-quad.dts
arch/arm/dts/sun6i-a31.dtsi
arch/arm/dts/sun6i-a31s-cs908.dts
arch/arm/dts/sun7i-a20-cubietruck.dts
arch/arm/dts/sun7i-a20-i12-tvbox.dts
arch/arm/dts/sun7i-a20-olinuxino-lime.dts
arch/arm/dts/sun7i-a20-olinuxino-micro.dts
arch/arm/dts/sun7i-a20.dtsi
arch/arm/dts/sun8i-a23-a33.dtsi
arch/arm/dts/sun8i-a23-ippo-q8h-v5.dts
arch/arm/dts/sun8i-a23.dtsi
arch/arm/dts/sun8i-a33-ga10h-v1.1.dts
arch/arm/dts/sun8i-a33-ippo-q8h-v1.2.dts
arch/arm/dts/sun8i-a33-sinlinx-sina33.dts
arch/arm/dts/sun8i-a33.dtsi
arch/arm/dts/sunxi-common-regulators.dtsi
arch/arm/include/asm/arch-sunxi/clock_sun4i.h
arch/arm/include/asm/arch-sunxi/clock_sun6i.h
arch/arm/include/asm/arch-sunxi/display.h
board/cm5200/fwupdate.c
board/inka4x0/MAINTAINERS
board/ipek01/MAINTAINERS
board/sunxi/Kconfig
board/sunxi/MAINTAINERS
configs/Ampe_A76_defconfig
configs/Auxtek-T003_defconfig [new file with mode: 0644]
configs/Bananapi_defconfig
configs/Bananapro_defconfig
configs/Colombus_defconfig
configs/Mele_A1000_defconfig
configs/Mele_M5_defconfig
configs/Mini-X_defconfig
configs/Orangepi_defconfig
configs/Orangepi_mini_defconfig
configs/TZX-Q8-713B7_defconfig
configs/UTOO_P66_defconfig
configs/ba10_tv_box_defconfig
configs/forfun_q88db_defconfig
configs/i12-tvbox_defconfig
configs/iNet_86VS_defconfig
configs/jesurun_q5_defconfig
doc/README.video
drivers/gpio/sunxi_gpio.c
drivers/power/pmic/Kconfig
drivers/power/pmic/pfuze100.c [new file with mode: 0644]
drivers/power/pmic/pmic_pfuze100.c
drivers/video/Kconfig
drivers/video/Makefile
drivers/video/anx9804.c [new file with mode: 0755]
drivers/video/anx9804.h [new file with mode: 0644]
drivers/video/cfb_console.c
drivers/video/sunxi_display.c
include/configs/canmb.h
include/configs/inka4x0.h
include/configs/ipek01.h
include/configs/jupiter.h
include/configs/motionpro.h
include/configs/munices.h
include/configs/pcm030.h
include/configs/socrates.h
include/configs/sunxi-common.h
include/configs/ti_omap5_common.h
include/configs/v38b.h
include/power/pfuze100_pmic.h

index c3e04af36dab671aa0d6e16c63cacd40129c287d..7c8eff959bd47830dd12e8aa0c2794996ea0385a 100644 (file)
@@ -198,6 +198,15 @@ void clock_set_pll3(unsigned int clk)
               CCM_PLL3_CTRL_M(clk / 3000000), &ccm->pll3_cfg);
 }
 
+unsigned int clock_get_pll3(void)
+{
+       struct sunxi_ccm_reg *const ccm =
+               (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+       uint32_t rval = readl(&ccm->pll3_cfg);
+       int m = ((rval & CCM_PLL3_CTRL_M_MASK) >> CCM_PLL3_CTRL_M_SHIFT);
+       return 3000000 * m;
+}
+
 unsigned int clock_get_pll5p(void)
 {
        struct sunxi_ccm_reg *const ccm =
index 3bfa122ec099e257e1a296c78e8522b8ea6ccbea..3ab3b31867807ced4d593bffdb7021211e9e7bf5 100644 (file)
@@ -170,6 +170,47 @@ void clock_set_pll5(unsigned int clk, bool sigma_delta_enable)
        udelay(5500);
 }
 
+#ifdef CONFIG_MACH_SUN6I
+void clock_set_mipi_pll(unsigned int clk)
+{
+       struct sunxi_ccm_reg * const ccm =
+               (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+       unsigned int k, m, n, value, diff;
+       unsigned best_k = 0, best_m = 0, best_n = 0, best_diff = 0xffffffff;
+       unsigned int src = clock_get_pll3();
+
+       /* All calculations are in KHz to avoid overflows */
+       clk /= 1000;
+       src /= 1000;
+
+       /* Pick the closest lower clock */
+       for (k = 1; k <= 4; k++) {
+               for (m = 1; m <= 16; m++) {
+                       for (n = 1; n <= 16; n++) {
+                               value = src * n * k / m;
+                               if (value > clk)
+                                       continue;
+
+                               diff = clk - value;
+                               if (diff < best_diff) {
+                                       best_diff = diff;
+                                       best_k = k;
+                                       best_m = m;
+                                       best_n = n;
+                               }
+                               if (diff == 0)
+                                       goto done;
+                       }
+               }
+       }
+
+done:
+       writel(CCM_MIPI_PLL_CTRL_EN | CCM_MIPI_PLL_CTRL_LDO_EN |
+              CCM_MIPI_PLL_CTRL_N(best_n) | CCM_MIPI_PLL_CTRL_K(best_k) |
+              CCM_MIPI_PLL_CTRL_M(best_m), &ccm->mipi_pll_cfg);
+}
+#endif
+
 #ifdef CONFIG_MACH_SUN8I_A33
 void clock_set_pll11(unsigned int clk, bool sigma_delta_enable)
 {
@@ -188,6 +229,18 @@ void clock_set_pll11(unsigned int clk, bool sigma_delta_enable)
 }
 #endif
 
+unsigned int clock_get_pll3(void)
+{
+       struct sunxi_ccm_reg *const ccm =
+               (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+       uint32_t rval = readl(&ccm->pll3_cfg);
+       int n = ((rval & CCM_PLL3_CTRL_N_MASK) >> CCM_PLL3_CTRL_N_SHIFT) + 1;
+       int m = ((rval & CCM_PLL3_CTRL_M_MASK) >> CCM_PLL3_CTRL_M_SHIFT) + 1;
+
+       /* Multiply by 1000 after dividing by m to avoid integer overflows */
+       return (24000 * n / m) * 1000;
+}
+
 unsigned int clock_get_pll6(void)
 {
        struct sunxi_ccm_reg *const ccm =
@@ -198,6 +251,20 @@ unsigned int clock_get_pll6(void)
        return 24000000 * n * k / 2;
 }
 
+unsigned int clock_get_mipi_pll(void)
+{
+       struct sunxi_ccm_reg *const ccm =
+               (struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
+       uint32_t rval = readl(&ccm->mipi_pll_cfg);
+       unsigned int n = ((rval & CCM_MIPI_PLL_CTRL_N_MASK) >> CCM_MIPI_PLL_CTRL_N_SHIFT) + 1;
+       unsigned int k = ((rval & CCM_MIPI_PLL_CTRL_K_MASK) >> CCM_MIPI_PLL_CTRL_K_SHIFT) + 1;
+       unsigned int m = ((rval & CCM_MIPI_PLL_CTRL_M_MASK) >> CCM_MIPI_PLL_CTRL_M_SHIFT) + 1;
+       unsigned int src = clock_get_pll3();
+
+       /* Multiply by 1000 after dividing by m to avoid integer overflows */
+       return ((src / 1000) * n * k / m) * 1000;
+}
+
 void clock_set_de_mod_clock(u32 *clk_cfg, unsigned int hz)
 {
        int pll = clock_get_pll6() * 2;
index ff868910146a2b6d92f8bfe098dfa171b779425d..d9a2f5f5d5ccdec21d2a899a095c67c19a3eee32 100644 (file)
@@ -77,6 +77,7 @@ dtb-$(CONFIG_MACH_SUN4I) += \
        sun4i-a10-inet-3f.dtb \
        sun4i-a10-inet-3w.dtb \
        sun4i-a10-inet97fv2.dtb \
+       sun4i-a10-itead-iteaduino-plus.dtb \
        sun4i-a10-jesurun-q5.dtb \
        sun4i-a10-marsboard.dtb \
        sun4i-a10-mini-xplus.dtb \
@@ -85,6 +86,7 @@ dtb-$(CONFIG_MACH_SUN4I) += \
        sun4i-a10-olinuxino-lime.dtb \
        sun4i-a10-pcduino.dtb
 dtb-$(CONFIG_MACH_SUN5I) += \
+       sun5i-a10s-auxtek-t003.dtb \
        sun5i-a10s-auxtek-t004.dtb \
        sun5i-a10s-mk802.dtb \
        sun5i-a10s-olinuxino-micro.dtb \
diff --git a/arch/arm/dts/axp152.dtsi b/arch/arm/dts/axp152.dtsi
new file mode 100644 (file)
index 0000000..f90ad6c
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2015 Chen-Yu Tsai
+ *
+ * Chen-Yu Tsai <wens@csie.org>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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 file 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.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+&axp152 {
+       compatible = "x-powers,axp152";
+       interrupt-controller;
+       #interrupt-cells = <1>;
+};
index c20cf537f5a534dcbbbacdf3f9192410a757a14d..24c935c72e5e611f3f945744404eae6bd135175f 100644 (file)
  *     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 file; if not, write to the Free
- *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- *     MA 02110-1301 USA
- *
  * Or, alternatively,
  *
  *  b) Permission is hereby granted, free of charge, to any person
index 93d435670ef1eeedb2b7d62dea8d730f16790dda..f3cb297fd1db3d22c4510aa8d0da8ee3d88d18e2 100644 (file)
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
        usb2_vbus_pin_a: usb2_vbus_pin@0 {
                allwinner,pins = "PH12";
        };
 };
 
+&reg_usb0_vbus {
+       regulator-boot-on;
+       status = "okay";
+};
+
 &reg_usb1_vbus {
        status = "okay";
 };
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "host";
+       status = "okay";
+};
+
 &usbphy {
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        usb1_vbus-supply = <&reg_usb1_vbus>;
        usb2_vbus-supply = <&reg_usb2_vbus>;
        status = "okay";
index 5878a0b11f7be387d9d09daf10b2ee884788dcb2..1430568726501e6283cca376d8619a548952f27c 100644 (file)
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
+&pio {
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
+               allwinner,pins = "PH5";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
+       };
+};
+
+&reg_usb0_vbus {
+       status = "okay";
+};
+
 &reg_usb2_vbus {
        status = "okay";
 };
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
 &usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
+       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+       usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        usb2_vbus-supply = <&reg_usb2_vbus>;
        status = "okay";
 };
index 9afb4e0185935ee4ffdda47e3595cc352341364a..046a84d9719d6cffb34e76398b359567a6134668 100644 (file)
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
        led_pins_cubieboard: led_pins@0 {
                allwinner,pins = "PH20", "PH21";
                allwinner,drive = <SUN4I_PINCTRL_20_MA>;
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
+
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
 };
 
 &reg_ahci_5v {
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
 &usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>;
+       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
        usb1_vbus-supply = <&reg_usb1_vbus>;
        usb2_vbus-supply = <&reg_usb2_vbus>;
        status = "okay";
diff --git a/arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts b/arch/arm/dts/sun4i-a10-itead-iteaduino-plus.dts
new file mode 100644 (file)
index 0000000..985e155
--- /dev/null
@@ -0,0 +1,202 @@
+/*
+ * Copyright 2015 Josef Gajdusek <atx@atx.name>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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 file 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.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun4i-a10.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+       model = "Iteaduino Plus A10";
+       compatible = "itead,iteaduino-plus-a10", "allwinner,sun4i-a10";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+};
+
+&ahci {
+       target-supply = <&reg_ahci_5v>;
+       status = "okay";
+};
+
+&cpu0 {
+       cpu-supply = <&reg_dcdc2>;
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&ehci1 {
+       status = "okay";
+};
+
+&emac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&emac_pins_a>;
+       phy = <&phy1>;
+       status = "okay";
+};
+
+&emac_sram {
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+
+       axp209: pmic@34 {
+               reg = <0x34>;
+               interrupts = <0>;
+       };
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+};
+
+&i2c2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c2_pins_a>;
+       status = "okay";
+};
+
+&ir0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&ir0_rx_pins_a>;
+       status = "okay";
+};
+
+&mdio {
+       status = "okay";
+
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_reference_design>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 7 1 GPIO_ACTIVE_HIGH>; /* PH1 */
+       cd-inverted;
+       status = "okay";
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&ohci1 {
+       status = "okay";
+};
+
+&reg_ahci_5v {
+       status = "okay";
+};
+
+#include "axp209.dtsi"
+
+&reg_dcdc2 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1450000>;
+       regulator-name = "vdd-cpu";
+};
+
+&reg_dcdc3 {
+       regulator-always-on;
+       regulator-min-microvolt = <1000000>;
+       regulator-max-microvolt = <1400000>;
+       regulator-name = "vdd-int-dll";
+};
+
+&reg_ldo1 {
+       regulator-name = "vdd-rtc";
+};
+
+&reg_ldo2 {
+       regulator-always-on;
+       regulator-min-microvolt = <3000000>;
+       regulator-max-microvolt = <3000000>;
+       regulator-name = "avcc";
+};
+
+&reg_usb1_vbus {
+       status = "okay";
+};
+
+&reg_usb2_vbus {
+       status = "okay";
+};
+
+&spi0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&spi0_pins_a>,
+                   <&spi0_cs0_pins_a>;
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usbphy {
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       usb2_vbus-supply = <&reg_usb2_vbus>;
+       status = "okay";
+};
index ebe2a04ef649a11d8b1c1d1263b3ca1300d0a2ef..a7dd86d30fa2711ba2533670cff0cc8559377505 100644 (file)
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
+&reg_usb0_vbus {
+       regulator-boot-on;
+       status = "okay";
+};
+
 &reg_usb1_vbus {
        status = "okay";
 };
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "host";
+       status = "okay";
+};
+
 &usbphy {
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        usb1_vbus-supply = <&reg_usb1_vbus>;
        usb2_vbus-supply = <&reg_usb2_vbus>;
        status = "okay";
index b64aa4eb071e34d49b384e1731657dce451aa972..28e32ad705cd25848e087f1ee4a9ad08c986740d 100644 (file)
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
        ahci_pwr_pin_olinuxinolime: ahci_pwr_pin@1 {
                allwinner,pins = "PC3";
                allwinner,drive = <SUN4I_PINCTRL_20_MA>;
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
+
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
+               allwinner,pins = "PH5";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
+       };
 };
 
 &reg_ahci_5v {
        status = "okay";
 };
 
+&reg_usb0_vbus {
+       status = "okay";
+};
+
 &reg_usb1_vbus {
        status = "okay";
 };
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
 &usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
+       usb0_id_det-gpio   = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+       usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
+       usb0_vbus-supply   = <&reg_usb0_vbus>;
        usb1_vbus-supply = <&reg_usb1_vbus>;
        usb2_vbus-supply = <&reg_usb2_vbus>;
        status = "okay";
index 61c03d1fe5303301a7ee44f1069c3865da958313..463bacd6a74d7024892587abadf9a2a701f4da16 100644 (file)
                        #size-cells = <0>;
                };
 
+               usb_otg: usb@01c13000 {
+                       compatible = "allwinner,sun4i-a10-musb";
+                       reg = <0x01c13000 0x0400>;
+                       clocks = <&ahb_gates 0>;
+                       interrupts = <38>;
+                       interrupt-names = "mc";
+                       phys = <&usbphy 0>;
+                       phy-names = "usb";
+                       extcon = <&usbphy 0>;
+                       allwinner,sram = <&otg_sram 1>;
+                       status = "disabled";
+               };
+
                usbphy: phy@01c13400 {
                        #phy-cells = <1>;
                        compatible = "allwinner,sun4i-a10-usb-phy";
                        clocks = <&apb0_gates 5>;
                        gpio-controller;
                        interrupt-controller;
-                       #interrupt-cells = <2>;
-                       #size-cells = <0>;
+                       #interrupt-cells = <3>;
                        #gpio-cells = <3>;
 
                        pwm0_pins_a: pwm0@0 {
diff --git a/arch/arm/dts/sun5i-a10s-auxtek-t003.dts b/arch/arm/dts/sun5i-a10s-auxtek-t003.dts
new file mode 100644 (file)
index 0000000..d4ad021
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ *  a) This file 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 file 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.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+#include "sun5i-a10s.dtsi"
+#include "sunxi-common-regulators.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
+
+/ {
+       model = "Auxtek t003 A10s hdmi tv-stick";
+       compatible = "allwinner,auxtek-t003", "allwinner,sun5i-a10s";
+
+       aliases {
+               serial0 = &uart0;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               pinctrl-names = "default";
+               pinctrl-0 = <&led_pins_t003>;
+
+               red {
+                       label = "t003-tv-dongle:red:usr";
+                       gpios = <&pio 1 2 GPIO_ACTIVE_HIGH>; /* PB2 */
+                       default-state = "on";
+               };
+       };
+};
+
+&ehci0 {
+       status = "okay";
+};
+
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+
+       axp152: pmic@30 {
+               compatible = "x-powers,axp152";
+               reg = <0x30>;
+               interrupts = <0>;
+               interrupt-controller;
+               #interrupt-cells = <1>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_t003>;
+       vmmc-supply = <&reg_vcc3v3>;
+       bus-width = <4>;
+       cd-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
+       cd-inverted;
+       status = "okay";
+};
+
+&ohci0 {
+       status = "okay";
+};
+
+&otg_sram {
+       status = "okay";
+};
+
+&pio {
+       mmc0_cd_pin_t003: mmc0_cd_pin@0 {
+               allwinner,pins = "PG1";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       led_pins_t003: led_pins@0 {
+               allwinner,pins = "PB2";
+               allwinner,function = "gpio_out";
+               allwinner,drive = <SUN4I_PINCTRL_20_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+};
+
+&reg_usb0_vbus {
+       gpio = <&pio 6 13 GPIO_ACTIVE_HIGH>; /* PG13 */
+       status = "okay";
+};
+
+&reg_usb1_vbus {
+       gpio = <&pio 1 10 GPIO_ACTIVE_HIGH>; /* PB10 */
+       status = "okay";
+};
+
+&uart0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&uart0_pins_a>;
+       status = "okay";
+};
+
+&usb0_vbus_pin_a {
+       allwinner,pins = "PG13";
+};
+
+&usb1_vbus_pin_a {
+       allwinner,pins = "PB10";
+};
+
+&usb_otg {
+       dr_mode = "host";
+       status = "okay";
+};
+
+&usbphy {
+       usb0_vbus-supply = <&reg_usb0_vbus>;
+       usb1_vbus-supply = <&reg_usb1_vbus>;
+       status = "okay";
+};
index a7e19e4847f75d60050b71f219e17d80f29e5c19..5a422c1ff725d875ceca0f2b61eeea696b117323 100644 (file)
        pinctrl-names = "default";
        pinctrl-0 = <&i2c0_pins_a>;
        status = "okay";
+
+       axp152: pmic@30 {
+               reg = <0x30>;
+               interrupts = <0>;
+       };
 };
 
+#include "axp152.dtsi"
+
 &i2c1 {
        pinctrl-names = "default";
        pinctrl-0 = <&i2c1_pins_a>;
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
        mmc0_cd_pin_olinuxino_micro: mmc0_cd_pin@0 {
                allwinner,pins = "PG1";
                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
+
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PG12";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+};
+
+&reg_usb0_vbus {
+       gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */
+       status = "okay";
 };
 
 &reg_usb1_vbus {
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&usb0_vbus_pin_a {
+       allwinner,pins = "PG11";
+};
+
 &usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>;
+       usb0_id_det-gpio = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        usb1_vbus-supply = <&reg_usb1_vbus>;
        status = "okay";
 };
-
index 990f9d61ae4d01756a812fe2a7b4fc7c5b9cae2f..3724b988064eba83f152669407bd127801a23160 100644 (file)
@@ -45,6 +45,7 @@
 #include "sunxi-common-regulators.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
        status = "okay";
 };
 
+&lradc {
+       vref-supply = <&reg_ldo2>;
+       status = "okay";
+
+       button@200 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <200000>;
+       };
+
+       button@400 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <400000>;
+       };
+};
+
 &mmc0 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_h702>;
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
        mmc0_cd_pin_h702: mmc0_cd_pin@0 {
                allwinner,pins = "PG0";
                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
        };
+
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PG2";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
+               allwinner,pins = "PG1";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
 };
 
 #include "axp209.dtsi"
        regulator-name = "vcc-wifi";
 };
 
+&reg_usb0_vbus {
+       pinctrl-0 = <&usb0_vbus_pin_a>;
+       gpio = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+       status = "okay";
+};
+
 &uart1 {
        pinctrl-names = "default";
        pinctrl-0 = <&uart1_pins_b>;
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&usb0_vbus_pin_a {
+       allwinner,pins = "PG12";
+};
+
 &usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
+       usb0_id_det-gpios = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
+       usb0_vbus_det-gpios = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        usb1_vbus-supply = <&reg_ldo3>;
        status = "okay";
 };
index 42324005eb7c0ead40426a9eefcd9b4449423c1b..b3c234c65ea19bb1f69984f350db0dad7ceea440 100644 (file)
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
        mmc0_cd_pin_olinuxino: mmc0_cd_pin@0 {
                allwinner,pins = "PG0";
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PG2";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
+               allwinner,pins = "PG1";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
+       };
+
        usb1_vbus_pin_olinuxino: usb1_vbus_pin@0 {
                allwinner,pins = "PG11";
                allwinner,function = "gpio_out";
        };
 };
 
+&reg_usb0_vbus {
+       status = "okay";
+       gpio = <&pio 6 12 GPIO_ACTIVE_HIGH>; /* PG12 */
+};
+
 &reg_usb1_vbus {
        pinctrl-0 = <&usb1_vbus_pin_olinuxino>;
        gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>;
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
+&usb0_vbus_pin_a {
+       allwinner,pins = "PG12";
+};
+
 &usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
+       usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
+       usb0_vbus_det-gpio = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        usb1_vbus-supply = <&reg_usb1_vbus>;
        status = "okay";
 };
index 514f159a14d42d369c1de6159185d593b6e78be0..eb793d5a2bd6748cec5696c2bdbfbbb4999b530f 100644 (file)
@@ -93,7 +93,7 @@
                compatible = "chipone,icn8318";
                reg = <0x40>;
                interrupt-parent = <&pio>;
-               interrupts = <9 IRQ_TYPE_EDGE_FALLING>; /* EINT9 (PG9) */
+               interrupts = <9 IRQ_TYPE_EDGE_FALLING>; /* EINT9 (PG9) */
                pinctrl-names = "default";
                pinctrl-0 = <&ts_wake_pin_p66>;
                wake-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>; /* PB3 */
        };
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
        mmc0_cd_pin_p66: mmc0_cd_pin@0 {
                allwinner,pins = "PG0";
                allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
        };
 
+       usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
+               allwinner,pins = "PG1";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
+       };
+
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PG2";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
        i2c_lcd_pins: i2c_lcd_pin@0 {
                allwinner,pins = "PG10", "PG12";
                allwinner,function = "gpio_out";
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
 &usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
+       usb0_id_det-gpio = <&pio 6 2 GPIO_ACTIVE_HIGH>; /* PG2 */
+       usb0_vbus_det-gpio = <&pio 6 1 GPIO_ACTIVE_HIGH>; /* PG1 */
        usb0_vbus-supply = <&reg_usb0_vbus>;
        usb1_vbus-supply = <&reg_ldo3>;
        status = "okay";
index 54b0978304344104d94d7d4e79a3117986563204..759117d14ce5fa8f46276ab45f07f9d25329f95f 100644 (file)
                        #size-cells = <0>;
                };
 
+               usb_otg: usb@01c13000 {
+                       compatible = "allwinner,sun4i-a10-musb";
+                       reg = <0x01c13000 0x0400>;
+                       clocks = <&ahb_gates 0>;
+                       interrupts = <38>;
+                       interrupt-names = "mc";
+                       phys = <&usbphy 0>;
+                       phy-names = "usb";
+                       extcon = <&usbphy 0>;
+                       allwinner,sram = <&otg_sram 1>;
+                       status = "disabled";
+               };
+
                usbphy: phy@01c13400 {
                        #phy-cells = <1>;
                        compatible = "allwinner,sun5i-a13-usb-phy";
                        clocks = <&apb0_gates 5>;
                        gpio-controller;
                        interrupt-controller;
-                       #interrupt-cells = <2>;
-                       #size-cells = <0>;
+                       #interrupt-cells = <3>;
                        #gpio-cells = <3>;
 
                        i2c0_pins_a: i2c0@0 {
index 0cf9926d1e93bebdc333c45f83c2dfe7610f50b9..0d0b6f268c3eda1df223b66ae5e188c020a6176b 100644 (file)
        status = "okay";
 };
 
+&gmac {
+       pinctrl-names = "default";
+       pinctrl-0 = <&gmac_pins_rgmii_a>;
+       phy = <&phy1>;
+       phy-mode = "rgmii";
+       status = "okay";
+
+       phy1: ethernet-phy@1 {
+               reg = <1>;
+       };
+};
+
 &i2c0 {
        pinctrl-names = "default";
        pinctrl-0 = <&i2c0_pins_a>;
index a5660d61a96e9182a6d178ed1e042b56790a62c0..6e0e5687a09c73a03a6512bf2bf7f8015c6b4b12 100644 (file)
@@ -48,7 +48,7 @@
 #include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
-       model = "Mele M9 / A1000G Quad top set box";
+       model = "Mele M9 top set box";
        compatible = "mele,m9", "allwinner,sun6i-a31";
 
        aliases {
index 4404f37d132ec9d5906834533c319cfeb7c1670f..4dd70cce212743fcd38eb32a942b0cdc8cca888c 100644 (file)
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "host";
+       status = "okay";
+};
+
 &usbphy {
        usb1_vbus-supply = <&reg_usb1_vbus>;
        status = "okay";
index 008047a018cf2b645cc85136c194be665376c5ef..39953e76bbfcfc1aa67c1d58d8bae9061b1ede10 100644 (file)
                        #size-cells = <0>;
                };
 
+               usb_otg: usb@01c19000 {
+                       compatible = "allwinner,sun6i-a31-musb";
+                       reg = <0x01c19000 0x0400>;
+                       clocks = <&ahb1_gates 24>;
+                       resets = <&ahb1_rst 24>;
+                       interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "mc";
+                       phys = <&usbphy 0>;
+                       phy-names = "usb";
+                       extcon = <&usbphy 0>;
+                       status = "disabled";
+               };
+
                usbphy: phy@01c19400 {
                        compatible = "allwinner,sun6i-a31-usb-phy";
                        reg = <0x01c19400 0x10>,
                        clocks = <&apb1_gates 5>;
                        gpio-controller;
                        interrupt-controller;
-                       #interrupt-cells = <2>;
-                       #size-cells = <0>;
+                       #interrupt-cells = <3>;
                        #gpio-cells = <3>;
 
                        uart0_pins_a: uart0@0 {
index 1e2411a2bceac845237b62cf9f404d2817be4e77..5e8f8c4f2b302a67ab02f396977a92e174d76ce3 100644 (file)
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "host";
+       status = "okay";
+};
+
 &usbphy {
        status = "okay";
 };
index 4611e2f5a99e85577f4ba7ad7363e7878049305b..e6b019232a9e880ea48a9b7f9dd975f6846be84e 100644 (file)
                };
        };
 
-       reg_vmmc3: vmmc3 {
-               compatible = "regulator-fixed";
+       mmc3_pwrseq: mmc3_pwrseq {
+               compatible = "mmc-pwrseq-simple";
                pinctrl-names = "default";
-               pinctrl-0 = <&vmmc3_pin_cubietruck>;
-               regulator-name = "vmmc3";
-               regulator-min-microvolt = <3300000>;
-               regulator-max-microvolt = <3300000>;
-               enable-active-high;
-               gpio = <&pio 7 9 GPIO_ACTIVE_HIGH>;
+               pinctrl-0 = <&mmc3_pwrseq_pin_cubietruck>;
+               reset-gpios = <&pio 7 9 GPIO_ACTIVE_LOW>; /* PH9 WIFI_EN */
        };
 };
 
 &mmc3 {
        pinctrl-names = "default";
        pinctrl-0 = <&mmc3_pins_a>;
-       vmmc-supply = <&reg_vmmc3>;
+       vmmc-supply = <&reg_vcc3v3>;
+       mmc-pwrseq = <&mmc3_pwrseq>;
        bus-width = <4>;
        non-removable;
        status = "okay";
                reg = <1>;
                compatible = "brcm,bcm4329-fmac";
                interrupt-parent = <&pio>;
-               interrupts = <10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */
+               interrupts = <10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */
                interrupt-names = "host-wake";
        };
 };
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
-       vmmc3_pin_cubietruck: vmmc3_pin@0 {
-               allwinner,pins = "PH9";
+       ahci_pwr_pin_cubietruck: ahci_pwr_pin@1 {
+               allwinner,pins = "PH12";
                allwinner,function = "gpio_out";
                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 
-       ahci_pwr_pin_cubietruck: ahci_pwr_pin@1 {
-               allwinner,pins = "PH12";
+       led_pins_cubietruck: led_pins@0 {
+               allwinner,pins = "PH7", "PH11", "PH20", "PH21";
                allwinner,function = "gpio_out";
                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
 
-       led_pins_cubietruck: led_pins@0 {
-               allwinner,pins = "PH7", "PH11", "PH20", "PH21";
+       mmc3_pwrseq_pin_cubietruck: mmc3_pwrseq_pin@0 {
+               allwinner,pins = "PH9";
                allwinner,function = "gpio_out";
                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
                allwinner,drive = <SUN4I_PINCTRL_10_MA>;
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
+
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH19";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
+
+       usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
+               allwinner,pins = "PH22";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
+       };
 };
 
 &pwm {
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
 &usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
+       usb0_id_det-gpios = <&pio 7 19 GPIO_ACTIVE_HIGH>; /* PH19 */
+       usb0_vbus_det-gpios = <&pio 7 22 GPIO_ACTIVE_HIGH>; /* PH22 */
        usb0_vbus-supply = <&reg_usb0_vbus>;
        usb1_vbus-supply = <&reg_usb1_vbus>;
        usb2_vbus-supply = <&reg_usb2_vbus>;
index f32f6f20d92339cb1f1f20bdeb158d98a05da418..1e6bd360dac0eaae2c7a651e35000ba6924e72fa 100644 (file)
                reg = <1>;
                compatible = "brcm,bcm4329-fmac";
                interrupt-parent = <&pio>;
-               interrupts = <10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */
+               interrupts = <10 IRQ_TYPE_LEVEL_LOW>; /* PH10 / EINT10 */
                interrupt-names = "host-wake";
        };
 };
index 769726dfb04622247aa3dd4a23531d2a1a42e445..04237085dc394423add52ff8d23486a183c5d55d 100644 (file)
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
        ahci_pwr_pin_olinuxinolime: ahci_pwr_pin@1 {
                allwinner,pins = "PC3";
                allwinner,drive = <SUN4I_PINCTRL_20_MA>;
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
+
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
+               allwinner,pins = "PH5";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
+       };
 };
 
 &reg_ahci_5v {
        status = "okay";
 };
 
+&reg_usb0_vbus {
+       status = "okay";
+};
+
 &reg_usb1_vbus {
        status = "okay";
 };
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
 &usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
+       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+       usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        usb1_vbus-supply = <&reg_usb1_vbus>;
        usb2_vbus-supply = <&reg_usb2_vbus>;
        status = "okay";
index 00f8f25eccae57f7a5d64f138d71a9dc8dc8af65..c5d70caade8238179f136f5326adb25fa8454c41 100644 (file)
        status = "okay";
 };
 
+&otg_sram {
+       status = "okay";
+};
+
 &pio {
        mmc3_cd_pin_olinuxinom: mmc3_cd_pin@0 {
                allwinner,pins = "PH11";
                allwinner,drive = <SUN4I_PINCTRL_20_MA>;
                allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
        };
+
+       usb0_id_detect_pin: usb0_id_detect_pin@0 {
+               allwinner,pins = "PH4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+
+       usb0_vbus_detect_pin: usb0_vbus_detect_pin@0 {
+               allwinner,pins = "PH5";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_DOWN>;
+       };
 };
 
 &reg_ahci_5v {
        status = "okay";
 };
 
+&reg_usb0_vbus {
+       status = "okay";
+};
+
 &reg_usb1_vbus {
        status = "okay";
 };
        status = "okay";
 };
 
+&usb_otg {
+       dr_mode = "otg";
+       status = "okay";
+};
+
 &usbphy {
+       pinctrl-names = "default";
+       pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
+       usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
+       usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
+       usb0_vbus-supply = <&reg_usb0_vbus>;
        usb1_vbus-supply = <&reg_usb1_vbus>;
        usb2_vbus-supply = <&reg_usb2_vbus>;
        status = "okay";
index 6a63f30c9a699d0e4620aac31f64247ad9c1f95b..71ab6b85f240a2478a698df9a5590096b4c5bbc5 100644 (file)
                        #size-cells = <0>;
                };
 
+               usb_otg: usb@01c13000 {
+                       compatible = "allwinner,sun4i-a10-musb";
+                       reg = <0x01c13000 0x0400>;
+                       clocks = <&ahb_gates 0>;
+                       interrupts = <GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "mc";
+                       phys = <&usbphy 0>;
+                       phy-names = "usb";
+                       extcon = <&usbphy 0>;
+                       allwinner,sram = <&otg_sram 1>;
+                       status = "disabled";
+               };
+
                usbphy: phy@01c13400 {
                        #phy-cells = <1>;
                        compatible = "allwinner,sun7i-a20-usb-phy";
                        clocks = <&apb0_gates 5>;
                        gpio-controller;
                        interrupt-controller;
-                       #interrupt-cells = <2>;
-                       #size-cells = <0>;
+                       #interrupt-cells = <3>;
                        #gpio-cells = <3>;
 
                        pwm0_pins_a: pwm0@0 {
index 5cd2e92c1940ad1c0807d25d3adfb0c00ebf9af4..9c4a55c5510e51b1bf8a7fc9ef7a1ff0787cf7d8 100644 (file)
                        interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&ahb1_gates 26>;
                        resets = <&ahb1_rst 26>;
+                       phys = <&usbphy 1>;
+                       phy-names = "usb";
                        status = "disabled";
                };
 
                        interrupts = <GIC_SPI 73 IRQ_TYPE_LEVEL_HIGH>;
                        clocks = <&ahb1_gates 29>, <&usb_clk 16>;
                        resets = <&ahb1_rst 29>;
+                       phys = <&usbphy 1>;
+                       phy-names = "usb";
                        status = "disabled";
                };
 
                        clocks = <&apb1_gates 5>;
                        gpio-controller;
                        interrupt-controller;
-                       #address-cells = <1>;
-                       #size-cells = <0>;
+                       #interrupt-cells = <3>;
                        #gpio-cells = <3>;
 
                        uart0_pins_a: uart0@0 {
index 95134c69cfc1b9050eadc07a32cc7cad96ddbea3..8d9da6886a4c975113ffd916de447a552295401e 100644 (file)
        pinctrl-0 = <&r_uart_pins_a>;
        status = "okay";
 };
+
+&usb_otg {
+       dr_mode = "host";
+       status = "okay";
+};
+
+&usbphy {
+       status = "okay";
+};
index 8698f7aa31c71b20f9c67f2334c8c970fa48c989..2cc27c7a59dc389b7cf835fcaa9d7c23fd073291 100644 (file)
                        clock-output-names = "mbus";
                };
        };
+
+       soc@01c00000 {
+               usb_otg: usb@01c19000 {
+                       compatible = "allwinner,sun6i-a31-musb";
+                       reg = <0x01c19000 0x0400>;
+                       clocks = <&ahb1_gates 24>;
+                       resets = <&ahb1_rst 24>;
+                       interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "mc";
+                       phys = <&usbphy 0>;
+                       phy-names = "usb";
+                       extcon = <&usbphy 0>;
+                       status = "disabled";
+               };
+
+               usbphy: phy@01c19400 {
+                       compatible = "allwinner,sun8i-a23-usb-phy";
+                       reg = <0x01c19400 0x10>,
+                             <0x01c1a800 0x4>;
+                       reg-names = "phy_ctrl",
+                                   "pmu1";
+                       clocks = <&usb_clk 8>,
+                                <&usb_clk 9>;
+                       clock-names = "usb0_phy",
+                                     "usb1_phy";
+                       resets = <&usb_clk 0>,
+                                <&usb_clk 1>;
+                       reset-names = "usb0_reset",
+                                     "usb1_reset";
+                       status = "disabled";
+                       #phy-cells = <1>;
+               };
+       };
 };
 
 &pio {
index da16343346407a6b8e9112527a5f12744be19dc8..1aefc6793e25e330dea05befe8306fc22651ad26 100644 (file)
        pinctrl-0 = <&r_uart_pins_a>;
        status = "okay";
 };
+
+&usb_otg {
+       dr_mode = "host";
+       status = "okay";
+};
+
+&usbphy {
+       status = "okay";
+};
index 97771495c21bda10c7dd6422470e24d89744768c..a43897515fb65dd4b71fe167acf0ba98df632041 100644 (file)
@@ -1,17 +1,56 @@
 /*
  * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
  *
- * Minimal dts file for the Ippo Q8H V1.2 (A33, 1024x600) for u-boot only
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
  *
- * SPDX-License-Identifier:     GPL-2.0+ or X11
+ *  a) This file 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 file 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.
+ *
+ * Or, alternatively,
+ *
+ *  b) Permission is hereby granted, free of charge, to any person
+ *     obtaining a copy of this software and associated documentation
+ *     files (the "Software"), to deal in the Software without
+ *     restriction, including without limitation the rights to use,
+ *     copy, modify, merge, publish, distribute, sublicense, and/or
+ *     sell copies of the Software, and to permit persons to whom the
+ *     Software is furnished to do so, subject to the following
+ *     conditions:
+ *
+ *     The above copyright notice and this permission notice shall be
+ *     included in all copies or substantial portions of the Software.
+ *
+ *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ *     OTHER DEALINGS IN THE SOFTWARE.
  */
 
 /dts-v1/;
 #include "sun8i-a33.dtsi"
+#include "sunxi-common-regulators.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pinctrl/sun4i-a10.h>
 
 / {
-       model = "Ippo Q8H V1.2 (A33, 1024x600)";
-       compatible = "ippo,q8h-v1.2-a33-lcd1024x600", "allwinner,sun8i-a23";
+       model = "Ippo Q8H Quad Core Tablet (v1.2)";
+       compatible = "ippo,a33-q8h-v1.2", "allwinner,sun8i-a33";
 
        aliases {
                serial0 = &r_uart;
        };
 };
 
+&i2c0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c0_pins_a>;
+       status = "okay";
+};
+
+&i2c1 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&i2c1_pins_a>;
+       status = "okay";
+};
+
+&lradc {
+       vref-supply = <&reg_vcc3v0>;
+       status = "okay";
+
+       button@200 {
+               label = "Volume Up";
+               linux,code = <KEY_VOLUMEUP>;
+               channel = <0>;
+               voltage = <200000>;
+       };
+
+       button@400 {
+               label = "Volume Down";
+               linux,code = <KEY_VOLUMEDOWN>;
+               channel = <0>;
+               voltage = <400000>;
+       };
+};
+
+&mmc0 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin_q8h>;
+       vmmc-supply = <&reg_vcc3v0>;
+       bus-width = <4>;
+       cd-gpios = <&pio 1 4 GPIO_ACTIVE_HIGH>; /* PB4 */
+       cd-inverted;
+       status = "okay";
+};
+
+&pio {
+       mmc0_cd_pin_q8h: mmc0_cd_pin@0 {
+               allwinner,pins = "PB4";
+               allwinner,function = "gpio_in";
+               allwinner,drive = <SUN4I_PINCTRL_10_MA>;
+               allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
+       };
+};
+
 &r_uart {
        pinctrl-names = "default";
        pinctrl-0 = <&r_uart_pins_a>;
        status = "okay";
 };
+
+/*
+ * FIXME for now we only support host mode and rely on u-boot to have
+ * turned on Vbus which is controlled by the axp223 pmic on the board.
+ *
+ * Once we have axp223 support we should switch to fully supporting otg.
+ */
+&usb_otg {
+       dr_mode = "host";
+       status = "okay";
+};
+
+&usbphy {
+       status = "okay";
+};
index 5788c29cb56a78c87bea6e750468ed0dc7680612..1d5390d4e03aadd44965918d43c0672c070de9f9 100644 (file)
        };
 };
 
+&ehci0 {
+       status = "okay";
+};
+
 &lradc {
        vref-supply = <&reg_vcc3v0>;
        status = "okay";
        allwinner,pull = <SUN4I_PINCTRL_PULL_UP>;
 };
 
+&ohci0 {
+       status = "okay";
+};
+
 &pio {
        mmc0_cd_pin_sina33: mmc0_cd_pin@0 {
                allwinner,pins = "PB4";
        pinctrl-0 = <&uart0_pins_b>;
        status = "okay";
 };
+
+&usbphy {
+       status = "okay";
+       usb1_vbus-supply = <&reg_vcc5v0>; /* USB1 VBUS is always on */
+};
index 85ee08098b7b1dcbd684d3311caa56c74e16103c..faa7d3c1fceacdc9eb80d396e23807bccb4d7aa1 100644 (file)
                        clock-output-names = "mbus";
                };
        };
+
+       soc@01c00000 {
+               usb_otg: usb@01c19000 {
+                       compatible = "allwinner,sun8i-a33-musb";
+                       reg = <0x01c19000 0x0400>;
+                       clocks = <&ahb1_gates 24>;
+                       resets = <&ahb1_rst 24>;
+                       interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>;
+                       interrupt-names = "mc";
+                       phys = <&usbphy 0>;
+                       phy-names = "usb";
+                       extcon = <&usbphy 0>;
+                       status = "disabled";
+               };
+
+               usbphy: phy@01c19400 {
+                       compatible = "allwinner,sun8i-a33-usb-phy";
+                       reg = <0x01c19400 0x14>,
+                             <0x01c1a800 0x4>;
+                       reg-names = "phy_ctrl",
+                                   "pmu1";
+                       clocks = <&usb_clk 8>,
+                                <&usb_clk 9>;
+                       clock-names = "usb0_phy",
+                                     "usb1_phy";
+                       resets = <&usb_clk 0>,
+                                <&usb_clk 1>;
+                       reset-names = "usb0_reset",
+                                     "usb1_reset";
+                       status = "disabled";
+                       #phy-cells = <1>;
+               };
+       };
 };
 
 &pio {
index 51cc8383f70f5d82fee3ca750d6c15b18b1bacbc..f1953b0c505939e78fe6d43837d8e4c12c48eb1b 100644 (file)
                regulator-name = "usb1-vbus";
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
+               regulator-boot-on;
                enable-active-high;
                gpio = <&pio 7 6 GPIO_ACTIVE_HIGH>;
                status = "disabled";
                regulator-name = "usb2-vbus";
                regulator-min-microvolt = <5000000>;
                regulator-max-microvolt = <5000000>;
+               regulator-boot-on;
                enable-active-high;
                gpio = <&pio 7 3 GPIO_ACTIVE_HIGH>;
                status = "disabled";
index a7e25f46c825b70026c431afaf481f2ca5c30c8d..0088bb9d0b48638481a0843d305010de87a99d37 100644 (file)
@@ -208,6 +208,8 @@ struct sunxi_ccm_reg {
 #define CCM_AHB_GATE_DLL (0x1 << 15)
 #define CCM_AHB_GATE_ACE (0x1 << 16)
 
+#define CCM_PLL3_CTRL_M_SHIFT          0
+#define CCM_PLL3_CTRL_M_MASK           (0x7f << CCM_PLL3_CTRL_M_SHIFT)
 #define CCM_PLL3_CTRL_M(n)             (((n) & 0x7f) << 0)
 #define CCM_PLL3_CTRL_INTEGER_MODE     (0x1 << 15)
 #define CCM_PLL3_CTRL_EN               (0x1 << 31)
@@ -287,6 +289,12 @@ struct sunxi_ccm_reg {
 #define CCM_LCD_CH0_CTRL_PLL7          (1 << 24)
 #define CCM_LCD_CH0_CTRL_PLL3_2X       (2 << 24)
 #define CCM_LCD_CH0_CTRL_PLL7_2X       (3 << 24)
+#define CCM_LCD_CH0_CTRL_MIPI_PLL      0 /* No mipi pll on sun4i/5i/7i */
+#ifdef CONFIG_MACH_SUN5I
+#define CCM_LCD_CH0_CTRL_TVE_RST       (0x1 << 29)
+#else
+#define CCM_LCD_CH0_CTRL_TVE_RST       0 /* No separate tve-rst on sun4i/7i */
+#endif
 #define CCM_LCD_CH0_CTRL_RST           (0x1 << 30)
 #define CCM_LCD_CH0_CTRL_GATE          (0x1 << 31)
 
@@ -342,6 +350,7 @@ struct sunxi_ccm_reg {
 #ifndef __ASSEMBLY__
 void clock_set_pll1(unsigned int hz);
 void clock_set_pll3(unsigned int hz);
+unsigned int clock_get_pll3(void);
 unsigned int clock_get_pll5p(void);
 unsigned int clock_get_pll6(void);
 #endif
index 06c6febba597129196760b949e5fac637d43b205..9b7b90cfc6168dcbbb031e241b98355b73165308 100644 (file)
@@ -179,7 +179,11 @@ struct sunxi_ccm_reg {
 #define CCM_PLL1_CTRL_P(n)             (((n) & 0x3) << 16)
 #define CCM_PLL1_CTRL_EN               (0x1 << 31)
 
+#define CCM_PLL3_CTRL_M_SHIFT          0
+#define CCM_PLL3_CTRL_M_MASK           (0xf << CCM_PLL3_CTRL_M_SHIFT)
 #define CCM_PLL3_CTRL_M(n)             ((((n) - 1) & 0xf) << 0)
+#define CCM_PLL3_CTRL_N_SHIFT          8
+#define CCM_PLL3_CTRL_N_MASK           (0x7f << CCM_PLL3_CTRL_N_SHIFT)
 #define CCM_PLL3_CTRL_N(n)             ((((n) - 1) & 0x7f) << 8)
 #define CCM_PLL3_CTRL_INTEGER_MODE     (0x1 << 24)
 #define CCM_PLL3_CTRL_EN               (0x1 << 31)
@@ -198,6 +202,18 @@ struct sunxi_ccm_reg {
 #define CCM_PLL6_CTRL_K_SHIFT          4
 #define CCM_PLL6_CTRL_K_MASK           (0x3 << CCM_PLL6_CTRL_K_SHIFT)
 
+#define CCM_MIPI_PLL_CTRL_M_SHIFT      0
+#define CCM_MIPI_PLL_CTRL_M_MASK       (0xf << CCM_MIPI_PLL_CTRL_M_SHIFT)
+#define CCM_MIPI_PLL_CTRL_M(n)         ((((n) - 1) & 0xf) << 0)
+#define CCM_MIPI_PLL_CTRL_K_SHIFT      4
+#define CCM_MIPI_PLL_CTRL_K_MASK       (0x3 << CCM_MIPI_PLL_CTRL_K_SHIFT)
+#define CCM_MIPI_PLL_CTRL_K(n)         ((((n) - 1) & 0x3) << 4)
+#define CCM_MIPI_PLL_CTRL_N_SHIFT      8
+#define CCM_MIPI_PLL_CTRL_N_MASK       (0xf << CCM_MIPI_PLL_CTRL_N_SHIFT)
+#define CCM_MIPI_PLL_CTRL_N(n)         ((((n) - 1) & 0xf) << 8)
+#define CCM_MIPI_PLL_CTRL_LDO_EN       (0x3 << 22)
+#define CCM_MIPI_PLL_CTRL_EN           (0x1 << 31)
+
 #define CCM_PLL11_CTRL_N(n)            ((((n) - 1) & 0x3f) << 8)
 #define CCM_PLL11_CTRL_SIGMA_DELTA_EN  (0x1 << 24)
 #define CCM_PLL11_CTRL_UPD             (0x1 << 30)
@@ -360,7 +376,10 @@ void clock_set_pll1(unsigned int hz);
 void clock_set_pll3(unsigned int hz);
 void clock_set_pll5(unsigned int clk, bool sigma_delta_enable);
 void clock_set_pll11(unsigned int clk, bool sigma_delta_enable);
+void clock_set_mipi_pll(unsigned int hz);
+unsigned int clock_get_pll3(void);
 unsigned int clock_get_pll6(void);
+unsigned int clock_get_mipi_pll(void);
 #endif
 
 #endif /* _SUNXI_CLOCK_SUN6I_H */
index 2cc3916a01e21a2716f8d16a839a77dea58c8eed..b64f310b8bf10141f1a06f6ae27cfc333b89a941 100644 (file)
@@ -196,7 +196,9 @@ struct sunxi_lcdc_reg {
        u8 res3[0x44];                  /* 0xac */
        u32 tcon1_io_polarity;          /* 0xf0 */
        u32 tcon1_io_tristate;          /* 0xf4 */
-       u8 res4[0x128];                 /* 0xf8 */
+       u8 res4[0x108];                 /* 0xf8 */
+       u32 mux_ctrl;                   /* 0x200 */
+       u8 res5[0x1c];                  /* 0x204 */
        u32 lvds_ana0;                  /* 0x220 */
        u32 lvds_ana1;                  /* 0x224 */
 };
@@ -385,6 +387,10 @@ struct sunxi_tve_reg {
 #define SUNXI_LCDC_TCON1_TIMING_H_TOTAL(n)     (((n) - 1) << 16)
 #define SUNXI_LCDC_TCON1_TIMING_V_BP(n)                (((n) - 1) << 0)
 #define SUNXI_LCDC_TCON1_TIMING_V_TOTAL(n)     ((n) << 16)
+#define SUNXI_LCDC_MUX_CTRL_SRC0_MASK          (0xf << 0)
+#define SUNXI_LCDC_MUX_CTRL_SRC0(x)            ((x) << 0)
+#define SUNXI_LCDC_MUX_CTRL_SRC1_MASK          (0xf << 4)
+#define SUNXI_LCDC_MUX_CTRL_SRC1(x)            ((x) << 4)
 #ifdef CONFIG_SUNXI_GEN_SUN6I
 #define SUNXI_LCDC_LVDS_ANA0                   0x40040320
 #define SUNXI_LCDC_LVDS_ANA0_EN_MB             (1 << 31)
@@ -506,7 +512,11 @@ struct sunxi_tve_reg {
 #define SUNXI_TVE_CFG0_PAL                     0x07030001
 #define SUNXI_TVE_CFG0_NTSC                    0x07030000
 #define SUNXI_TVE_DAC_CFG0_VGA                 0x403e1ac7
+#ifdef CONFIG_MACH_SUN5I
+#define SUNXI_TVE_DAC_CFG0_COMPOSITE           0x433f0009
+#else
 #define SUNXI_TVE_DAC_CFG0_COMPOSITE           0x403f0008
+#endif
 #define SUNXI_TVE_FILTER_COMPOSITE             0x00000120
 #define SUNXI_TVE_CHROMA_FREQ_PAL_M            0x21e6efe3
 #define SUNXI_TVE_CHROMA_FREQ_PAL_NC           0x21f69446
index 06d50234e9ab046b544d95f03852f704480a8aba..2b923624aea11f4adfe5fb57c0ce1b9f0a1fddfc 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <command.h>
+#include <fat.h>
 #include <malloc.h>
 #include <image.h>
 #include <usb.h>
@@ -19,9 +20,6 @@
 
 #include "fwupdate.h"
 
-extern long do_fat_read(const char *, void *, unsigned long, int);
-extern int do_fat_fsload(cmd_tbl_t *, int, int, char * const []);
-
 static int load_rescue_image(ulong);
 
 void cm5200_fwupdate(void)
@@ -124,7 +122,7 @@ static int load_rescue_image(ulong addr)
                                /* Check if rescue image is present */
                                FW_DEBUG("Looking for firmware directory '%s'"
                                        " on partition %d\n", fwdir, i);
-                               if (do_fat_read(fwdir, NULL, 0, LS_NO) == -1) {
+                               if (!fat_exists(fwdir)) {
                                        FW_DEBUG("No NX rescue image on "
                                                "partition %d.\n", i);
                                        partno = -2;
index 246b2d4d690d48e5e2e4a55e81fa446635d6b3fe..e8cec73a1a9bfcd94f9c20cf2c1f55d6512b76bd 100644 (file)
@@ -1,5 +1,5 @@
 INKA4X0 BOARD
-M:     Detlev Zundel <dzu@denx.de>
+M:     Anatolij Gustschin <agust@denx.de>
 S:     Maintained
 F:     board/inka4x0/
 F:     include/configs/inka4x0.h
index 060f8a5a221ad0cc0383e881072e96cacb39b88e..906d39ef805ca592cb0bf1b309d66886cc350423 100644 (file)
@@ -1,5 +1,5 @@
 IPEK01 BOARD
-M:     Wolfgang Grandegger <wg@denx.de>
+M:     Anatolij Gustschin <agust@denx.de>
 S:     Maintained
 F:     board/ipek01/
 F:     include/configs/ipek01.h
index 13f453733f1ee637c204260687adee8c90771355..fd6668fea2d040da27da3befff6c5bc84c1f4dc6 100644 (file)
@@ -526,7 +526,16 @@ config VIDEO_LCD_PANEL_MIPI_4_LANE_513_MBPS_VIA_SSD2828
        select VIDEO_LCD_SSD2828
        select VIDEO_LCD_IF_PARALLEL
        ---help---
-        7.85" 768x1024 LCD panels, such as LG LP079X01 or AUO B079XAN01.0
+       7.85" 768x1024 LCD panels, such as LG LP079X01 or AUO B079XAN01.0
+
+config VIDEO_LCD_PANEL_EDP_4_LANE_1620M_VIA_ANX9804
+       bool "eDP 4-lane, 1.62G LCD panel via ANX9804 bridge chip"
+       select VIDEO_LCD_ANX9804
+       select VIDEO_LCD_IF_PARALLEL
+       select VIDEO_LCD_PANEL_I2C
+       ---help---
+       Select this for eDP LCD panels with 4 lanes running at 1.62G,
+       connected via an ANX9804 bridge chip.
 
 config VIDEO_LCD_PANEL_HITACHI_TX18D42VM
        bool "Hitachi tx18d42vm LCD panel"
index 1f12a646e48a95f36bfc81e0cafd68370908b348..1b44ce8e0933328ad9a09a24e45901b53f9af9c5 100644 (file)
@@ -19,6 +19,7 @@ F:    include/configs/sun5i.h
 F:     configs/A10s-OLinuXino-M_defconfig
 F:     configs/A13-OLinuXino_defconfig
 F:     configs/A13-OLinuXinoM_defconfig
+F:     configs/Auxtek-T003_defconfig
 F:     configs/Auxtek-T004_defconfig
 F:     configs/mk802_a10s_defconfig
 F:     configs/r7-tv-dongle_defconfig
index 1d36919ca581b1022f12f02aef3fc87bd3a95314..3aaf029409d25649a5c1ae7c2b50fd50c29ed2c2 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_MMC0_CD_PIN="PG0"
 CONFIG_USB0_VBUS_PIN="PG12"
 CONFIG_USB0_VBUS_DET="PG1"
 CONFIG_AXP_GPIO=y
+# CONFIG_VIDEO_HDMI is not set
 CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:45,ri:82,up:22,lo:22,hs:1,vs:1,sync:3,vmode:0"
 CONFIG_VIDEO_LCD_POWER="AXP0-0"
 CONFIG_VIDEO_LCD_BL_EN="AXP0-1"
diff --git a/configs/Auxtek-T003_defconfig b/configs/Auxtek-T003_defconfig
new file mode 100644 (file)
index 0000000..b9692dc
--- /dev/null
@@ -0,0 +1,15 @@
+CONFIG_ARM=y
+CONFIG_ARCH_SUNXI=y
+CONFIG_MACH_SUN5I=y
+CONFIG_DRAM_CLK=408
+CONFIG_DRAM_EMR1=0
+CONFIG_USB1_VBUS_PIN="PB10"
+CONFIG_VIDEO_COMPOSITE=y
+CONFIG_DEFAULT_DEVICE_TREE="sun5i-a10s-auxtek-t003"
+# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_SPL=y
+CONFIG_SYS_EXTRA_OPTIONS="AXP152_POWER"
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_FPGA is not set
+CONFIG_USB_EHCI_HCD=y
index 4b9ef35f58141f19c4c634340cef2c218764171a..560295f790c3a36693faa7e31be15f8523195d3a 100644 (file)
@@ -3,6 +3,7 @@ CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN7I=y
 CONFIG_DRAM_CLK=432
 CONFIG_GMAC_TX_DELAY=3
+CONFIG_VIDEO_COMPOSITE=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-bananapi"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
index 5506ab323136313062532ae471641851fbba8b1e..346db34dcf44e94783a99e6f8a8d1042d8f2b436 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_DRAM_CLK=432
 CONFIG_USB1_VBUS_PIN="PH0"
 CONFIG_USB2_VBUS_PIN="PH1"
 CONFIG_GMAC_TX_DELAY=3
+CONFIG_VIDEO_COMPOSITE=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-bananapro"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
index 1ae8c168e805ed15e5ab67f386d51a2fb2b4cb15..35f644a218fd0e1e91121dc6e5443ccc72a70e10 100644 (file)
@@ -4,13 +4,24 @@ CONFIG_MACH_SUN6I=y
 CONFIG_DRAM_CLK=240
 CONFIG_DRAM_ZQ=251
 CONFIG_USB1_VBUS_PIN=""
+CONFIG_I2C0_ENABLE=y
+CONFIG_AXP_GPIO=y
+CONFIG_VIDEO_LCD_MODE="x:2048,y:1536,depth:24,pclk_khz:208000,le:5,ri:150,up:9,lo:24,hs:5,vs:1,sync:3,vmode:0"
+CONFIG_VIDEO_LCD_DCLK_PHASE=0
+CONFIG_VIDEO_LCD_POWER="PH27"
+CONFIG_VIDEO_LCD_BL_EN="PM1"
+CONFIG_VIDEO_LCD_BL_PWM="PH13"
+CONFIG_VIDEO_LCD_PANEL_I2C_SDA="PA23"
+CONFIG_VIDEO_LCD_PANEL_I2C_SCL="PA24"
+CONFIG_VIDEO_LCD_PANEL_EDP_4_LANE_1620M_VIA_ANX9804=y
 CONFIG_DEFAULT_DEVICE_TREE="sun6i-a31-colombus"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
-CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC"
+CONFIG_SYS_EXTRA_OPTIONS="SUNXI_GMAC,RGMII"
 # CONFIG_CMD_IMLS is not set
 # CONFIG_CMD_FLASH is not set
 # CONFIG_CMD_FPGA is not set
 CONFIG_ETH_DESIGNWARE=y
 CONFIG_AXP221_ALDO1_VOLT=3300
+CONFIG_AXP221_ELDO3_VOLT=1800
 CONFIG_USB_EHCI_HCD=y
index 5e66d438ab35599a7cc5889a01395b6a51cd28df..b983c8cd08d1911635df62cd3751c37ae0906592 100644 (file)
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN4I=y
 CONFIG_VIDEO_VGA=y
+CONFIG_VIDEO_COMPOSITE=y
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-a1000"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
index 40f5daaaed7b73ca5b9aa0a6f9f2954864cb0101..0d1ba151e2c80e6df1a0a903af8ef75d71c4444c 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_MACH_SUN7I=y
 CONFIG_DRAM_CLK=432
 CONFIG_DRAM_ZQ=122
 CONFIG_MMC0_CD_PIN="PH1"
+CONFIG_VIDEO_COMPOSITE=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-m5"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
index 00b6c63b82f5a7b2a3b899e429be8df9aa3f1676..c88eb9bdbd477fb1080669ab98a024c0c0d06e90 100644 (file)
@@ -1,6 +1,7 @@
 CONFIG_ARM=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN4I=y
+CONFIG_VIDEO_COMPOSITE=y
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-mini-xplus"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
index f9408b1fdfe55df9fcdf64b5ea3a791d53408aeb..d67bb900f3ea42387df0a55d843706d883ce06ca 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_DRAM_CLK=432
 CONFIG_USB1_VBUS_PIN="PH26"
 CONFIG_USB2_VBUS_PIN="PH22"
 CONFIG_VIDEO_VGA=y
+CONFIG_VIDEO_COMPOSITE=y
 CONFIG_GMAC_TX_DELAY=3
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-orangepi"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
index 1dc0e767885316f6673d0f8eba4077c15146982d..71d236beeadf704584228a07a21d8e8b4e7a049b 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_MMC3_CD_PIN="PH11"
 CONFIG_MMC_SUNXI_SLOT_EXTRA=3
 CONFIG_USB1_VBUS_PIN="PH26"
 CONFIG_USB2_VBUS_PIN="PH22"
+CONFIG_VIDEO_COMPOSITE=y
 CONFIG_GMAC_TX_DELAY=3
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-orangepi-mini"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
index 350883474961b4d71975cb107548da4a539e988a..4ef80db95e4d460701b77aa2aafb8e9013161d40 100644 (file)
@@ -6,6 +6,7 @@ CONFIG_MMC0_CD_PIN="PG0"
 CONFIG_USB0_VBUS_PIN="PG12"
 CONFIG_USB0_VBUS_DET="PG1"
 CONFIG_AXP_GPIO=y
+# CONFIG_VIDEO_HDMI is not set
 CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:87,ri:40,up:31,lo:13,hs:1,vs:1,sync:3,vmode:0"
 CONFIG_VIDEO_LCD_POWER="AXP0-0"
 CONFIG_VIDEO_LCD_BL_EN="AXP0-1"
index 169c2e87c92ae56d1909755f1ea2ba0468c47c33..99a8c315b00b1bf43beb16b8c06915064888f41f 100644 (file)
@@ -9,6 +9,7 @@ CONFIG_USB0_VBUS_PIN="PB04"
 CONFIG_USB0_VBUS_DET="PG01"
 CONFIG_USB0_ID_DET="PG2"
 CONFIG_AXP_GPIO=y
+# CONFIG_VIDEO_HDMI is not set
 CONFIG_VIDEO_LCD_MODE="x:480,y:800,depth:18,pclk_khz:25000,le:2,ri:93,up:2,lo:93,hs:1,vs:1,sync:3,vmode:0"
 CONFIG_VIDEO_LCD_DCLK_PHASE=0
 CONFIG_VIDEO_LCD_POWER="PG4"
index 5b5fc122f77a7b7f6615fb1887c08f8a032b7593..cdcd9de14b6dbc9d0a0bea27f99a3e48f5940b14 100644 (file)
@@ -4,6 +4,7 @@ CONFIG_MACH_SUN4I=y
 CONFIG_DRAM_CLK=384
 CONFIG_DRAM_EMR1=4
 CONFIG_USB2_VBUS_PIN="PH12"
+CONFIG_VIDEO_COMPOSITE=y
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-ba10-tvbox"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
index 6fff7255ed0b2fd0e75ebd79e0471ade727f0ac6..610a0628c46e68ccb7c5fa47166ddd5583e067d1 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_DRAM_CLK=384
 CONFIG_USB0_VBUS_PIN="PG12"
 CONFIG_USB0_VBUS_DET="PG1"
 CONFIG_AXP_GPIO=y
+# CONFIG_VIDEO_HDMI is not set
 CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:87,ri:40,up:31,lo:13,hs:1,vs:1,sync:3,vmode:0"
 CONFIG_VIDEO_LCD_POWER="AXP0-0"
 CONFIG_VIDEO_LCD_BL_EN="AXP0-1"
index 99e78ba0905365f02d205302b177218171f34a79..d4d952469f9327a63d47d90743f300007f23ab8a 100644 (file)
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN7I=y
 CONFIG_DRAM_CLK=384
+CONFIG_VIDEO_COMPOSITE=y
 CONFIG_DEFAULT_DEVICE_TREE="sun7i-a20-i12-tvbox"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
index 33162d18083a9aaeadd588d9003f003a3446e1e9..f958c317b36121c40c30cf865736a79c80eedfe5 100644 (file)
@@ -5,6 +5,7 @@ CONFIG_DRAM_CLK=408
 CONFIG_USB0_VBUS_PIN="PG12"
 CONFIG_USB0_VBUS_DET="PG1"
 CONFIG_AXP_GPIO=y
+# CONFIG_VIDEO_HDMI is not set
 CONFIG_VIDEO_LCD_MODE="x:800,y:480,depth:18,pclk_khz:33000,le:45,ri:209,up:22,lo:22,hs:1,vs:1,sync:3,vmode:0"
 CONFIG_VIDEO_LCD_POWER="AXP0-0"
 CONFIG_VIDEO_LCD_BL_EN="AXP0-1"
index b0d8621c659d36e05b5da744fcddb3db3e9667c1..46c38e553fcc5d10ab347774aec51f54cc73fcd6 100644 (file)
@@ -2,6 +2,7 @@ CONFIG_ARM=y
 CONFIG_ARCH_SUNXI=y
 CONFIG_MACH_SUN4I=y
 CONFIG_DRAM_CLK=312
+CONFIG_VIDEO_COMPOSITE=y
 CONFIG_DEFAULT_DEVICE_TREE="sun4i-a10-jesurun-q5"
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SPL=y
index 4f7a4b5db54b4ade757d09f252ca272cfe4ffb24..62ac17b0490f96cbbc07665eb6411dfa039aa332 100644 (file)
@@ -68,6 +68,11 @@ The sunxi u-boot driver supports the following video-mode options:
     overrides the xres, yres and refresh from the video-mode env. variable.
  Defaults to edid=1.
 
+- overscan_x/overscan_y=<int> - Set x/y overscan value
+ This configures a black border on the left and right resp. top and bottom
+ to deal with overscanning displays. Defaults to overscan_x=32 and
+ overscan_y=20 for composite monitors, 0 for other monitors.
+
 For example to always use the hdmi connector, even if no cable is inserted,
 using edid info when available and otherwise initalizing it at 1024x768@60Hz,
 use: "setenv video-mode sunxi:1024x768-24@60,monitor=dvi,hpd=0,edid=1".
index afa165ab784d91bcf753f474bcde82503743fa26..57b78e55e23b9ef048bb4edd69ad110443ec9384 100644 (file)
@@ -266,16 +266,28 @@ static int gpio_sunxi_bind(struct udevice *parent)
 {
        struct sunxi_gpio_platdata *plat = parent->platdata;
        struct sunxi_gpio_reg *ctlr;
-       int bank;
-       int ret;
+       int bank, no_banks, ret, start;
 
        /* If this is a child device, there is nothing to do here */
        if (plat)
                return 0;
 
+       if (fdt_node_check_compatible(gd->fdt_blob, parent->of_offset,
+                               "allwinner,sun6i-a31-r-pinctrl") == 0) {
+               start = 'L' - 'A';
+               no_banks = 2; /* L & M */
+       } else if (fdt_node_check_compatible(gd->fdt_blob, parent->of_offset,
+                               "allwinner,sun8i-a23-r-pinctrl") == 0) {
+               start = 'L' - 'A';
+               no_banks = 1; /* L only */
+       } else {
+               start = 0;
+               no_banks = SUNXI_GPIO_BANKS;
+       }
+
        ctlr = (struct sunxi_gpio_reg *)fdtdec_get_addr(gd->fdt_blob,
                                                   parent->of_offset, "reg");
-       for (bank = 0; bank < SUNXI_GPIO_BANKS; bank++) {
+       for (bank = 0; bank < no_banks; bank++) {
                struct sunxi_gpio_platdata *plat;
                struct udevice *dev;
 
@@ -283,7 +295,7 @@ static int gpio_sunxi_bind(struct udevice *parent)
                if (!plat)
                        return -ENOMEM;
                plat->regs = &ctlr->gpio_bank[bank];
-               plat->bank_name = gpio_bank_name(bank);
+               plat->bank_name = gpio_bank_name(start + bank);
                plat->gpio_count = SUNXI_GPIOS_PER_BANK;
 
                ret = device_bind(parent, parent->driver,
@@ -306,6 +318,8 @@ static const struct udevice_id sunxi_gpio_ids[] = {
        { .compatible = "allwinner,sun8i-a23-pinctrl" },
        { .compatible = "allwinner,sun8i-a33-pinctrl" },
        { .compatible = "allwinner,sun9i-a80-pinctrl" },
+       { .compatible = "allwinner,sun6i-a31-r-pinctrl" },
+       { .compatible = "allwinner,sun8i-a23-r-pinctrl" },
        { }
 };
 
index 7b98189ad8fa4a574c382aed2fbcce2761a4b689..fc6a3743dc964d5121cdf419f8c1b602b9e422e8 100644 (file)
@@ -10,6 +10,13 @@ config DM_PMIC
        - 'drivers/power/pmic/pmic-uclass.c'
        - 'include/power/pmic.h'
 
+config DM_PMIC_PFUZE100
+       bool "Enable Driver Model for PMIC PFUZE100"
+       depends on DM_PMIC
+       ---help---
+       This config enables implementation of driver-model pmic uclass features
+       for PMIC PFUZE100. The driver implements read/write operations.
+
 config DM_PMIC_MAX77686
        bool "Enable Driver Model for PMIC MAX77686"
        depends on DM_PMIC
diff --git a/drivers/power/pmic/pfuze100.c b/drivers/power/pmic/pfuze100.c
new file mode 100644 (file)
index 0000000..3beb48e
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2015 Freescale Semiconductor, Inc
+ * Peng Fan <Peng.Fan@freescale.com>
+ *
+ * SPDX-License-Identifier:      GPL-2.0+
+ */
+
+#include <common.h>
+#include <fdtdec.h>
+#include <errno.h>
+#include <dm.h>
+#include <i2c.h>
+#include <power/pmic.h>
+#include <power/regulator.h>
+#include <power/pfuze100_pmic.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static const struct pmic_child_info pmic_children_info[] = {
+       /* sw[x], swbst */
+       { .prefix = "s", .driver = PFUZE100_REGULATOR_DRIVER },
+       /* vgen[x], vsnvs, vcc, v33, vcc_sd */
+       { .prefix = "v", .driver = PFUZE100_REGULATOR_DRIVER },
+       { },
+};
+
+static int pfuze100_reg_count(struct udevice *dev)
+{
+       return PFUZE100_NUM_OF_REGS;
+}
+
+static int pfuze100_write(struct udevice *dev, uint reg, const uint8_t *buff,
+                         int len)
+{
+       if (dm_i2c_write(dev, reg, buff, len)) {
+               error("write error to device: %p register: %#x!", dev, reg);
+               return -EIO;
+       }
+
+       return 0;
+}
+
+static int pfuze100_read(struct udevice *dev, uint reg, uint8_t *buff, int len)
+{
+       if (dm_i2c_read(dev, reg, buff, len)) {
+               error("read error from device: %p register: %#x!", dev, reg);
+               return -EIO;
+       }
+
+       return 0;
+}
+
+static int pfuze100_bind(struct udevice *dev)
+{
+       int children;
+       int regulators_node;
+       const void *blob = gd->fdt_blob;
+
+       regulators_node = fdt_subnode_offset(blob, dev->of_offset,
+                                            "regulators");
+       if (regulators_node <= 0) {
+               debug("%s: %s regulators subnode not found!", __func__,
+                     dev->name);
+               return -ENXIO;
+       }
+
+       debug("%s: '%s' - found regulators subnode\n", __func__, dev->name);
+
+       children = pmic_bind_children(dev, regulators_node, pmic_children_info);
+       if (!children)
+               debug("%s: %s - no child found\n", __func__, dev->name);
+
+       /* Always return success for this device */
+       return 0;
+}
+
+static struct dm_pmic_ops pfuze100_ops = {
+       .reg_count = pfuze100_reg_count,
+       .read = pfuze100_read,
+       .write = pfuze100_write,
+};
+
+static const struct udevice_id pfuze100_ids[] = {
+       { .compatible = "fsl,pfuze100", .data = PFUZE100, },
+       { .compatible = "fsl,pfuze200", .data = PFUZE200, },
+       { .compatible = "fsl,pfuze3000", .data = PFUZE3000, },
+       { }
+};
+
+U_BOOT_DRIVER(pmic_pfuze100) = {
+       .name = "pfuze100 pmic",
+       .id = UCLASS_PMIC,
+       .of_match = pfuze100_ids,
+       .bind = pfuze100_bind,
+       .ops = &pfuze100_ops,
+};
index 22a04c02a3c149013a828c023b242f3848645df6..259b349da7a125e58f1031c78328a8a2ea57cdb0 100644 (file)
@@ -23,7 +23,7 @@ int power_pfuze100_init(unsigned char bus)
 
        p->name = name;
        p->interface = PMIC_I2C;
-       p->number_of_regs = PMIC_NUM_OF_REGS;
+       p->number_of_regs = PFUZE100_NUM_OF_REGS;
        p->hw.i2c.addr = CONFIG_POWER_PFUZE100_I2C_ADDR;
        p->hw.i2c.tx_num = 1;
        p->bus = bus;
index 955b0b7460b26db89e1243aa01906da249c34bec..caf1efcbb3377b087c7fd5560ca5fa888590af9a 100644 (file)
@@ -151,6 +151,14 @@ config FRAMEBUFFER_VESA_MODE
        default 0x11B if FRAMEBUFFER_VESA_MODE_11B
        default 0x117 if FRAMEBUFFER_VESA_MODE_USER
 
+config VIDEO_LCD_ANX9804
+       bool "ANX9804 bridge chip"
+       default n
+       ---help---
+       Support for the ANX9804 bridge chip, which can take pixel data coming
+       from a parallel LCD interface and translate it on the fy into a DP
+       interface for driving eDP TFT displays. It uses I2C for configuration.
+
 config VIDEO_LCD_SSD2828
        bool "SSD2828 bridge chip"
        default n
index c2c4dfc57eaf0653455653b029507a521fad7896..e85fd8a6771b8521c96590c1aa8f59c4269353ca 100644 (file)
@@ -33,6 +33,7 @@ obj-$(CONFIG_VIDEO_COREBOOT) += coreboot_fb.o
 obj-$(CONFIG_VIDEO_CT69000) += ct69000.o videomodes.o
 obj-$(CONFIG_VIDEO_DA8XX) += da8xx-fb.o videomodes.o
 obj-$(CONFIG_VIDEO_IMX25LCDC) += imx25lcdc.o videomodes.o
+obj-$(CONFIG_VIDEO_LCD_ANX9804) += anx9804.o
 obj-$(CONFIG_VIDEO_LCD_HITACHI_TX18D42VM) += hitachi_tx18d42vm_lcd.o
 obj-$(CONFIG_VIDEO_LCD_SSD2828) += ssd2828.o
 obj-$(CONFIG_VIDEO_MB862xx) += mb862xx.o videomodes.o
diff --git a/drivers/video/anx9804.c b/drivers/video/anx9804.c
new file mode 100755 (executable)
index 0000000..83d60d6
--- /dev/null
@@ -0,0 +1,188 @@
+/*
+ * (C) 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/*
+ * Support for the ANX9804 bridge chip, which can take pixel data coming
+ * from a parallel LCD interface and translate it on the flight into a DP
+ * interface for driving eDP TFT displays.
+ */
+
+#include <common.h>
+#include <i2c.h>
+#include "anx9804.h"
+
+#define BIT(x) (1 << (x))
+
+/* Registers at i2c address 0x38 */
+
+#define ANX9804_HDCP_CONTROL_0_REG                             0x01
+
+#define ANX9804_SYS_CTRL2_REG                                  0x81
+#define ANX9804_SYS_CTRL2_CHA_STA                              0x04
+
+#define ANX9804_SYS_CTRL3_REG                                  0x82
+#define ANX9804_SYS_CTRL3_VALID_CTRL                           BIT(0)
+#define ANX9804_SYS_CTRL3_F_VALID                              BIT(1)
+#define ANX9804_SYS_CTRL3_HPD_CTRL                             BIT(4)
+#define ANX9804_SYS_CTRL3_F_HPD                                        BIT(5)
+
+#define ANX9804_LINK_BW_SET_REG                                        0xa0
+#define ANX9804_LANE_COUNT_SET_REG                             0xa1
+#define ANX9804_TRAINING_PTN_SET_REG                           0xa2
+#define ANX9804_TRAINING_LANE0_SET_REG                         0xa3
+#define ANX9804_TRAINING_LANE1_SET_REG                         0xa4
+#define ANX9804_TRAINING_LANE2_SET_REG                         0xa5
+#define ANX9804_TRAINING_LANE3_SET_REG                         0xa6
+
+#define ANX9804_LINK_TRAINING_CTRL_REG                         0xa8
+#define ANX9804_LINK_TRAINING_CTRL_EN                          BIT(0)
+
+#define ANX9804_LINK_DEBUG_REG                                 0xb8
+#define ANX9804_PLL_CTRL_REG                                   0xc7    
+#define ANX9804_ANALOG_POWER_DOWN_REG                          0xc8
+
+/* Registers at i2c address 0x39 */
+
+#define ANX9804_DEV_IDH_REG                                    0x03
+
+#define ANX9804_POWERD_CTRL_REG                                        0x05
+#define ANX9804_POWERD_AUDIO                                   BIT(4)
+
+#define ANX9804_RST_CTRL_REG                                   0x06
+
+#define ANX9804_RST_CTRL2_REG                                  0x07
+#define ANX9804_RST_CTRL2_AUX                                  BIT(2)
+#define ANX9804_RST_CTRL2_AC_MODE                              BIT(6)
+
+#define ANX9804_VID_CTRL1_REG                                  0x08
+#define ANX9804_VID_CTRL1_VID_EN                               BIT(7)
+#define ANX9804_VID_CTRL1_EDGE                                 BIT(0)
+
+#define ANX9804_VID_CTRL2_REG                                  0x09
+#define ANX9804_ANALOG_DEBUG_REG1                              0xdc
+#define ANX9804_ANALOG_DEBUG_REG3                              0xde
+#define ANX9804_PLL_FILTER_CTRL1                               0xdf
+#define ANX9804_PLL_FILTER_CTRL3                               0xe1
+#define ANX9804_PLL_FILTER_CTRL                                        0xe2
+#define ANX9804_PLL_CTRL3                                      0xe6
+
+/**
+ * anx9804_init() - Init anx9804 parallel lcd to edp bridge chip
+ *
+ * This function will init an anx9804 parallel lcd to dp bridge chip
+ * using the passed in parameters.
+ *
+ * @i2c_bus:   Number of the i2c bus to which the anx9804 is connected.
+ * @lanes:     Number of displayport lanes to use
+ * @data_rate: Register value for the bandwidth reg 0x06: 1.62G, 0x0a: 2.7G
+ * @bpp:       Bits per pixel, must be 18 or 24
+ */
+void anx9804_init(unsigned int i2c_bus, u8 lanes, u8 data_rate, int bpp)
+{
+       unsigned int orig_i2c_bus = i2c_get_bus_num();
+       u8 c, colordepth;
+       int i;
+
+       i2c_set_bus_num(i2c_bus);
+
+       if (bpp == 18)
+               colordepth = 0x00; /* 6 bit */
+       else
+               colordepth = 0x10; /* 8 bit */
+
+       /* Reset */
+       i2c_reg_write(0x39, ANX9804_RST_CTRL_REG, 1);
+       mdelay(100);
+       i2c_reg_write(0x39, ANX9804_RST_CTRL_REG, 0);
+
+       /* Write 0 to the powerdown reg (powerup everything) */
+       i2c_reg_write(0x39, ANX9804_POWERD_CTRL_REG, 0);
+
+       c = i2c_reg_read(0x39, ANX9804_DEV_IDH_REG);
+       if (c != 0x98) {
+               printf("Error anx9804 chipid mismatch\n");
+               i2c_set_bus_num(orig_i2c_bus);
+               return;
+       }
+
+       for (i = 0; i < 100; i++) {
+               c = i2c_reg_read(0x38, ANX9804_SYS_CTRL2_REG);
+               i2c_reg_write(0x38, ANX9804_SYS_CTRL2_REG, c);
+               c = i2c_reg_read(0x38, ANX9804_SYS_CTRL2_REG);
+               if ((c & ANX9804_SYS_CTRL2_CHA_STA) == 0)
+                       break;
+
+               mdelay(5);
+       }
+       if (i == 100)
+               printf("Error anx9804 clock is not stable\n");
+
+       i2c_reg_write(0x39, ANX9804_VID_CTRL2_REG, colordepth);
+       
+       /* Set a bunch of analog related register values */
+       i2c_reg_write(0x38, ANX9804_PLL_CTRL_REG, 0x07); 
+       i2c_reg_write(0x39, ANX9804_PLL_FILTER_CTRL3, 0x19); 
+       i2c_reg_write(0x39, ANX9804_PLL_CTRL3, 0xd9); 
+       i2c_reg_write(0x39, ANX9804_RST_CTRL2_REG, ANX9804_RST_CTRL2_AC_MODE);
+       i2c_reg_write(0x39, ANX9804_ANALOG_DEBUG_REG1, 0xf0);
+       i2c_reg_write(0x39, ANX9804_ANALOG_DEBUG_REG3, 0x99);
+       i2c_reg_write(0x39, ANX9804_PLL_FILTER_CTRL1, 0x7b);
+       i2c_reg_write(0x38, ANX9804_LINK_DEBUG_REG, 0x30);
+       i2c_reg_write(0x39, ANX9804_PLL_FILTER_CTRL, 0x06);
+
+       /* Force HPD */
+       i2c_reg_write(0x38, ANX9804_SYS_CTRL3_REG,
+                     ANX9804_SYS_CTRL3_F_HPD | ANX9804_SYS_CTRL3_HPD_CTRL);
+
+       /* Power up and configure lanes */
+       i2c_reg_write(0x38, ANX9804_ANALOG_POWER_DOWN_REG, 0x00);
+       i2c_reg_write(0x38, ANX9804_TRAINING_LANE0_SET_REG, 0x00);
+       i2c_reg_write(0x38, ANX9804_TRAINING_LANE1_SET_REG, 0x00);
+       i2c_reg_write(0x38, ANX9804_TRAINING_LANE2_SET_REG, 0x00);
+       i2c_reg_write(0x38, ANX9804_TRAINING_LANE3_SET_REG, 0x00);
+
+       /* Reset AUX CH */
+       i2c_reg_write(0x39, ANX9804_RST_CTRL2_REG,
+                     ANX9804_RST_CTRL2_AC_MODE | ANX9804_RST_CTRL2_AUX);
+       i2c_reg_write(0x39, ANX9804_RST_CTRL2_REG,
+                     ANX9804_RST_CTRL2_AC_MODE);
+
+       /* Powerdown audio and some other unused bits */
+       i2c_reg_write(0x39, ANX9804_POWERD_CTRL_REG, ANX9804_POWERD_AUDIO);
+       i2c_reg_write(0x38, ANX9804_HDCP_CONTROL_0_REG, 0x00);
+       i2c_reg_write(0x38, 0xa7, 0x00);
+
+       /* Set data-rate / lanes */
+       i2c_reg_write(0x38, ANX9804_LINK_BW_SET_REG, data_rate);
+       i2c_reg_write(0x38, ANX9804_LANE_COUNT_SET_REG, lanes);
+
+       /* Link training */     
+       i2c_reg_write(0x38, ANX9804_LINK_TRAINING_CTRL_REG,
+                     ANX9804_LINK_TRAINING_CTRL_EN);
+       mdelay(5);
+       for (i = 0; i < 100; i++) {
+               c = i2c_reg_read(0x38, ANX9804_LINK_TRAINING_CTRL_REG);
+               if ((c & 0x01) == 0)
+                       break;
+
+               mdelay(5);
+       }
+       if(i == 100) {
+               printf("Error anx9804 link training timeout\n");
+               i2c_set_bus_num(orig_i2c_bus);
+               return;
+       }
+
+       /* Enable */
+       i2c_reg_write(0x39, ANX9804_VID_CTRL1_REG,
+                     ANX9804_VID_CTRL1_VID_EN | ANX9804_VID_CTRL1_EDGE);
+       /* Force stream valid */
+       i2c_reg_write(0x38, ANX9804_SYS_CTRL3_REG,
+                     ANX9804_SYS_CTRL3_F_HPD | ANX9804_SYS_CTRL3_HPD_CTRL |
+                     ANX9804_SYS_CTRL3_F_VALID | ANX9804_SYS_CTRL3_VALID_CTRL);
+
+       i2c_set_bus_num(orig_i2c_bus);
+}
diff --git a/drivers/video/anx9804.h b/drivers/video/anx9804.h
new file mode 100644 (file)
index 0000000..6c5daf9
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * (C) 2015 Hans de Goede <hdegoede@redhat.com>
+ *
+ * SPDX-License-Identifier:    GPL-2.0+
+ */
+
+/*
+ * Support for the ANX9804 bridge chip, which can take pixel data coming
+ * from a parallel LCD interface and translate it on the flight into a DP
+ * interface for driving eDP TFT displays.
+ */
+
+#ifndef _ANX9804_H
+#define _ANX9804_H
+
+#define ANX9804_DATA_RATE_1620M                                0x06
+#define ANX9804_DATA_RATE_2700M                                0x0a
+
+#ifdef CONFIG_VIDEO_LCD_PANEL_EDP_4_LANE_1620M_VIA_ANX9804
+void anx9804_init(unsigned int i2c_bus, u8 lanes, u8 data_rate, int bpp);
+#else
+static inline void anx9804_init(unsigned int i2c_bus, u8 lanes, u8 data_rate,
+                               int bpp) {}
+#endif
+#endif
index 7f2ddc10c62b88e519c29fb14627c1e237db3c85..30e0317bb254b8e3d0d65453b6ee8303795fc635 100644 (file)
@@ -283,9 +283,10 @@ void console_cursor(int state);
 
 #define VIDEO_COLS             VIDEO_VISIBLE_COLS
 #define VIDEO_ROWS             VIDEO_VISIBLE_ROWS
-#define VIDEO_SIZE             (VIDEO_ROWS*VIDEO_COLS*VIDEO_PIXEL_SIZE)
-#define VIDEO_PIX_BLOCKS       (VIDEO_SIZE >> 2)
-#define VIDEO_LINE_LEN         (VIDEO_COLS*VIDEO_PIXEL_SIZE)
+#ifndef VIDEO_LINE_LEN
+#define VIDEO_LINE_LEN         (VIDEO_COLS * VIDEO_PIXEL_SIZE)
+#endif
+#define VIDEO_SIZE             (VIDEO_ROWS * VIDEO_LINE_LEN)
 #define VIDEO_BURST_LEN                (VIDEO_COLS/8)
 
 #ifdef CONFIG_VIDEO_LOGO
@@ -1306,7 +1307,7 @@ static int display_rle8_bitmap(struct bmp_image *img, int xoff, int yoff,
        struct palette p[256];
        struct bmp_color_table_entry cte;
        int green_shift, red_off;
-       int limit = VIDEO_COLS * VIDEO_ROWS;
+       int limit = (VIDEO_LINE_LEN / VIDEO_PIXEL_SIZE) * VIDEO_ROWS;
        int pixels = 0;
 
        x = 0;
@@ -1314,7 +1315,8 @@ static int display_rle8_bitmap(struct bmp_image *img, int xoff, int yoff,
        ncolors = __le32_to_cpu(img->header.colors_used);
        bpp = VIDEO_PIXEL_SIZE;
        fbp = (unsigned char *) ((unsigned int) video_fb_address +
-                                (((y + yoff) * VIDEO_COLS) + xoff) * bpp);
+                                (y + yoff) * VIDEO_LINE_LEN +
+                                xoff * bpp);
 
        bm = (uchar *) img + __le32_to_cpu(img->header.data_offset);
 
@@ -1368,8 +1370,8 @@ static int display_rle8_bitmap(struct bmp_image *img, int xoff, int yoff,
                                y--;
                                fbp = (unsigned char *)
                                        ((unsigned int) video_fb_address +
-                                        (((y + yoff) * VIDEO_COLS) +
-                                         xoff) * bpp);
+                                        (y + yoff) * VIDEO_LINE_LEN +
+                                        xoff * bpp);
                                continue;
                        case 1:
                                /* end of bitmap data marker */
@@ -1381,8 +1383,8 @@ static int display_rle8_bitmap(struct bmp_image *img, int xoff, int yoff,
                                y -= bm[3];
                                fbp = (unsigned char *)
                                        ((unsigned int) video_fb_address +
-                                        (((y + yoff) * VIDEO_COLS) +
-                                         x + xoff) * bpp);
+                                        (y + yoff) * VIDEO_LINE_LEN +
+                                        xoff * bpp);
                                bm += 4;
                                break;
                        default:
@@ -1561,7 +1563,7 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
 
        bmap = (uchar *) bmp + le32_to_cpu(bmp->header.data_offset);
        fb = (uchar *) (video_fb_address +
-                       ((y + height - 1) * VIDEO_COLS * VIDEO_PIXEL_SIZE) +
+                       ((y + height - 1) * VIDEO_LINE_LEN) +
                        x * VIDEO_PIXEL_SIZE);
 
 #ifdef CONFIG_VIDEO_BMP_RLE8
@@ -1597,7 +1599,7 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
                                                           cte.blue);
                                }
                                bmap += padded_line;
-                               fb -= (VIDEO_VISIBLE_COLS + width) *
+                               fb -= VIDEO_LINE_LEN + width *
                                        VIDEO_PIXEL_SIZE;
                        }
                        break;
@@ -1628,8 +1630,8 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
                                        *fb++ = *bmap++;
                                }
                                bmap += padded_line;
-                               fb -= (VIDEO_VISIBLE_COLS + width) *
-                                                       VIDEO_PIXEL_SIZE;
+                               fb -= VIDEO_LINE_LEN + width *
+                                       VIDEO_PIXEL_SIZE;
                        }
                        break;
                case GDF__8BIT_332RGB:
@@ -1642,8 +1644,8 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
                                                         cte.blue);
                                }
                                bmap += padded_line;
-                               fb -= (VIDEO_VISIBLE_COLS + width) *
-                                                       VIDEO_PIXEL_SIZE;
+                               fb -= VIDEO_LINE_LEN + width *
+                                       VIDEO_PIXEL_SIZE;
                        }
                        break;
                case GDF_15BIT_555RGB:
@@ -1666,8 +1668,8 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
 #endif
                                }
                                bmap += padded_line;
-                               fb -= (VIDEO_VISIBLE_COLS + width) *
-                                                       VIDEO_PIXEL_SIZE;
+                               fb -= VIDEO_LINE_LEN + width *
+                                       VIDEO_PIXEL_SIZE;
                        }
                        break;
                case GDF_16BIT_565RGB:
@@ -1680,8 +1682,8 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
                                                          cte.blue);
                                }
                                bmap += padded_line;
-                               fb -= (VIDEO_VISIBLE_COLS + width) *
-                                                       VIDEO_PIXEL_SIZE;
+                               fb -= VIDEO_LINE_LEN + width *
+                                       VIDEO_PIXEL_SIZE;
                        }
                        break;
                case GDF_32BIT_X888RGB:
@@ -1694,8 +1696,8 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
                                                           cte.blue);
                                }
                                bmap += padded_line;
-                               fb -= (VIDEO_VISIBLE_COLS + width) *
-                                                       VIDEO_PIXEL_SIZE;
+                               fb -= VIDEO_LINE_LEN + width *
+                                       VIDEO_PIXEL_SIZE;
                        }
                        break;
                case GDF_24BIT_888RGB:
@@ -1708,8 +1710,8 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
                                                          cte.blue);
                                }
                                bmap += padded_line;
-                               fb -= (VIDEO_VISIBLE_COLS + width) *
-                                                       VIDEO_PIXEL_SIZE;
+                               fb -= VIDEO_LINE_LEN + width *
+                                       VIDEO_PIXEL_SIZE;
                        }
                        break;
                }
@@ -1728,8 +1730,8 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
                                        bmap += 3;
                                }
                                bmap += padded_line;
-                               fb -= (VIDEO_VISIBLE_COLS + width) *
-                                                       VIDEO_PIXEL_SIZE;
+                               fb -= VIDEO_LINE_LEN + width *
+                                       VIDEO_PIXEL_SIZE;
                        }
                        break;
                case GDF_15BIT_555RGB:
@@ -1751,8 +1753,8 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
                                        bmap += 3;
                                }
                                bmap += padded_line;
-                               fb -= (VIDEO_VISIBLE_COLS + width) *
-                                                       VIDEO_PIXEL_SIZE;
+                               fb -= VIDEO_LINE_LEN + width *
+                                       VIDEO_PIXEL_SIZE;
                        }
                        break;
                case GDF_16BIT_565RGB:
@@ -1765,8 +1767,8 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
                                        bmap += 3;
                                }
                                bmap += padded_line;
-                               fb -= (VIDEO_VISIBLE_COLS + width) *
-                                                       VIDEO_PIXEL_SIZE;
+                               fb -= VIDEO_LINE_LEN + width *
+                                       VIDEO_PIXEL_SIZE;
                        }
                        break;
                case GDF_32BIT_X888RGB:
@@ -1779,8 +1781,8 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
                                        bmap += 3;
                                }
                                bmap += padded_line;
-                               fb -= (VIDEO_VISIBLE_COLS + width) *
-                                                       VIDEO_PIXEL_SIZE;
+                               fb -= VIDEO_LINE_LEN + width *
+                                       VIDEO_PIXEL_SIZE;
                        }
                        break;
                case GDF_24BIT_888RGB:
@@ -1793,8 +1795,8 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
                                        bmap += 3;
                                }
                                bmap += padded_line;
-                               fb -= (VIDEO_VISIBLE_COLS + width) *
-                                                       VIDEO_PIXEL_SIZE;
+                               fb -= VIDEO_LINE_LEN + width *
+                                       VIDEO_PIXEL_SIZE;
                        }
                        break;
                default:
@@ -1826,20 +1828,16 @@ int video_display_bitmap(ulong bmp_image, int x, int y)
 static int video_logo_xpos;
 static int video_logo_ypos;
 
-static void plot_logo_or_black(void *screen, int width, int x, int y,  \
-                       int black);
+static void plot_logo_or_black(void *screen, int x, int y, int black);
 
-static void logo_plot(void *screen, int width, int x, int y)
+static void logo_plot(void *screen, int x, int y)
 {
-       plot_logo_or_black(screen, width, x, y, 0);
+       plot_logo_or_black(screen, x, y, 0);
 }
 
 static void logo_black(void)
 {
-       plot_logo_or_black(video_fb_address, \
-                       VIDEO_COLS, \
-                       video_logo_xpos, \
-                       video_logo_ypos, \
+       plot_logo_or_black(video_fb_address, video_logo_xpos, video_logo_ypos,
                        1);
 }
 
@@ -1858,11 +1856,11 @@ U_BOOT_CMD(
           " "
           );
 
-static void plot_logo_or_black(void *screen, int width, int x, int y, int black)
+static void plot_logo_or_black(void *screen, int x, int y, int black)
 {
 
        int xcount, i;
-       int skip = (width - VIDEO_LOGO_WIDTH) * VIDEO_PIXEL_SIZE;
+       int skip = VIDEO_LINE_LEN - VIDEO_LOGO_WIDTH * VIDEO_PIXEL_SIZE;
        int ycount = video_logo_height;
        unsigned char r, g, b, *logo_red, *logo_blue, *logo_green;
        unsigned char *source;
@@ -1880,7 +1878,7 @@ static void plot_logo_or_black(void *screen, int width, int x, int y, int black)
                y = max(0, (int)(VIDEO_VISIBLE_ROWS - VIDEO_LOGO_HEIGHT + y + 1));
 #endif /* CONFIG_SPLASH_SCREEN_ALIGN */
 
-       dest = (unsigned char *)screen + (y * width  + x) * VIDEO_PIXEL_SIZE;
+       dest = (unsigned char *)screen + y * VIDEO_LINE_LEN + x * VIDEO_PIXEL_SIZE;
 
 #ifdef CONFIG_VIDEO_BMP_LOGO
        source = bmp_logo_bitmap;
@@ -2009,8 +2007,7 @@ static void *video_logo(void)
        }
 #endif /* CONFIG_SPLASH_SCREEN */
 
-       logo_plot(video_fb_address, VIDEO_COLS,
-                 video_logo_xpos, video_logo_ypos);
+       logo_plot(video_fb_address, video_logo_xpos, video_logo_ypos);
 
 #ifdef CONFIG_SPLASH_SCREEN_ALIGN
        /*
index 18681850587c61e9bddb638c8b38db520a2383c7..fc1aea3f06f2dd7f84fe84f912fc4c5667336f0b 100644 (file)
 #include <asm/global_data.h>
 #include <asm/gpio.h>
 #include <asm/io.h>
+#include <axp221.h>
 #include <errno.h>
 #include <fdtdec.h>
 #include <fdt_support.h>
 #include <i2c.h>
+#include <malloc.h>
 #include <video_fb.h>
 #include "videomodes.h"
+#include "anx9804.h"
 #include "hitachi_tx18d42vm_lcd.h"
 #include "ssd2828.h"
 
@@ -51,6 +54,7 @@ struct sunxi_display {
        GraphicDevice graphic_device;
        enum sunxi_monitor monitor;
        unsigned int depth;
+       unsigned int fb_addr;
        unsigned int fb_size;
 } sunxi_display;
 
@@ -483,7 +487,9 @@ static void sunxi_composer_mode_set(const struct ctfb_res_modes *mode,
        setbits_le32(&de_be->mode, SUNXI_DE_BE_MODE_LAYER0_ENABLE);
        if (mode->vmode == FB_VMODE_INTERLACED)
                setbits_le32(&de_be->mode,
+#ifndef CONFIG_MACH_SUN5I
                             SUNXI_DE_BE_MODE_DEFLICKER_ENABLE |
+#endif
                             SUNXI_DE_BE_MODE_INTERLACE_ENABLE);
 
        if (sunxi_is_composite()) {
@@ -517,6 +523,7 @@ static void sunxi_lcdc_pll_set(int tcon, int dotclock,
        int value, n, m, min_m, max_m, diff;
        int best_n = 0, best_m = 0, best_diff = 0x0FFFFFFF;
        int best_double = 0;
+       bool use_mipi_pll = false;
 
        if (tcon == 0) {
 #ifdef CONFIG_VIDEO_LCD_IF_PARALLEL
@@ -567,16 +574,42 @@ static void sunxi_lcdc_pll_set(int tcon, int dotclock,
                }
        }
 
-       debug("dotclock: %dkHz = %dkHz: (%d * 3MHz * %d) / %d\n",
-             dotclock, (best_double + 1) * 3000 * best_n / best_m,
-             best_double + 1, best_n, best_m);
+#ifdef CONFIG_MACH_SUN6I
+       /*
+        * Use the MIPI pll if we've been unable to find any matching setting
+        * for PLL3, this happens with high dotclocks because of min_m = 6.
+        */
+       if (tcon == 0 && best_n == 0) {
+               use_mipi_pll = true;
+               best_m = 6;  /* Minimum m for tcon0 */
+       }
 
-       clock_set_pll3(best_n * 3000000);
+       if (use_mipi_pll) {
+               clock_set_pll3(297000000); /* Fix the video pll at 297 MHz */
+               clock_set_mipi_pll(best_m * dotclock * 1000);
+               debug("dotclock: %dkHz = %dkHz via mipi pll\n",
+                     dotclock, clock_get_mipi_pll() / best_m / 1000);
+       } else
+#endif
+       {
+               clock_set_pll3(best_n * 3000000);
+               debug("dotclock: %dkHz = %dkHz: (%d * 3MHz * %d) / %d\n",
+                     dotclock,
+                     (best_double + 1) * clock_get_pll3() / best_m / 1000,
+                     best_double + 1, best_n, best_m);
+       }
 
        if (tcon == 0) {
-               writel(CCM_LCD_CH0_CTRL_GATE | CCM_LCD_CH0_CTRL_RST |
-                      (best_double ? CCM_LCD_CH0_CTRL_PLL3_2X :
-                                     CCM_LCD_CH0_CTRL_PLL3),
+               u32 pll;
+
+               if (use_mipi_pll)
+                       pll = CCM_LCD_CH0_CTRL_MIPI_PLL;
+               else if (best_double)
+                       pll = CCM_LCD_CH0_CTRL_PLL3_2X;
+               else
+                       pll = CCM_LCD_CH0_CTRL_PLL3;
+
+               writel(CCM_LCD_CH0_CTRL_GATE | CCM_LCD_CH0_CTRL_RST | pll,
                       &ccm->lcd0_ch0_clk_cfg);
        } else {
                writel(CCM_LCD_CH1_CTRL_GATE |
@@ -734,13 +767,17 @@ static void sunxi_lcdc_tcon0_mode_set(const struct ctfb_res_modes *mode,
                (struct sunxi_lcdc_reg *)SUNXI_LCD0_BASE;
        int bp, clk_delay, clk_div, clk_double, pin, total, val;
 
-       for (pin = SUNXI_GPD(0); pin <= SUNXI_GPD(27); pin++)
+       for (pin = SUNXI_GPD(0); pin <= SUNXI_GPD(27); pin++) {
 #ifdef CONFIG_VIDEO_LCD_IF_PARALLEL
                sunxi_gpio_set_cfgpin(pin, SUNXI_GPD_LCD0);
 #endif
 #ifdef CONFIG_VIDEO_LCD_IF_LVDS
                sunxi_gpio_set_cfgpin(pin, SUNXI_GPD_LVDS0);
 #endif
+#ifdef CONFIG_VIDEO_LCD_PANEL_EDP_4_LANE_1620M_VIA_ANX9804
+               sunxi_gpio_set_drv(pin, 3);
+#endif
+       }
 
        sunxi_lcdc_pll_set(0, mode->pixclock_khz, &clk_div, &clk_double);
 
@@ -872,6 +909,13 @@ static void sunxi_lcdc_tcon1_mode_set(const struct ctfb_res_modes *mode,
                             SUNXI_LCDC_TCON_VSYNC_MASK |
                             SUNXI_LCDC_TCON_HSYNC_MASK);
        }
+
+#ifdef CONFIG_MACH_SUN5I
+       if (sunxi_is_composite())
+               clrsetbits_le32(&lcdc->mux_ctrl, SUNXI_LCDC_MUX_CTRL_SRC0_MASK,
+                               SUNXI_LCDC_MUX_CTRL_SRC0(1));
+#endif
+
        sunxi_lcdc_pll_set(1, mode->pixclock_khz, clk_div, clk_double);
 }
 #endif /* CONFIG_VIDEO_HDMI || defined CONFIG_VIDEO_VGA || CONFIG_VIDEO_COMPOSITE */
@@ -997,6 +1041,8 @@ static void sunxi_tvencoder_mode_set(void)
        struct sunxi_tve_reg * const tve =
                (struct sunxi_tve_reg *)SUNXI_TVE0_BASE;
 
+       /* Reset off */
+       setbits_le32(&ccm->lcd0_ch0_clk_cfg, CCM_LCD_CH0_CTRL_TVE_RST);
        /* Clock on */
        setbits_le32(&ccm->ahb_gate1, 1 << AHB_GATE_OFFSET_TVE0);
 
@@ -1168,6 +1214,17 @@ static void sunxi_mode_set(const struct ctfb_res_modes *mode,
                break;
        case sunxi_monitor_lcd:
                sunxi_lcdc_panel_enable();
+               if (IS_ENABLED(CONFIG_VIDEO_LCD_PANEL_EDP_4_LANE_1620M_VIA_ANX9804)) {
+                       /*
+                        * The anx9804 needs 1.8V from eldo3, we do this here
+                        * and not via CONFIG_AXP221_ELDO3 from board_init()
+                        * to avoid turning this on when using hdmi output.
+                        */
+                       axp221_set_eldo(3, 1800);
+                       anx9804_init(CONFIG_VIDEO_LCD_I2C_BUS, 4,
+                                    ANX9804_DATA_RATE_1620M,
+                                    sunxi_display.depth);
+               }
                if (IS_ENABLED(CONFIG_VIDEO_LCD_HITACHI_TX18D42VM)) {
                        mdelay(50); /* Wait for lcd controller power on */
                        hitachi_tx18d42vm_init();
@@ -1297,9 +1354,10 @@ void *video_hw_init(void)
 #ifdef CONFIG_VIDEO_HDMI
        int ret, hpd, hpd_delay, edid;
 #endif
+       int i, overscan_offset, overscan_x, overscan_y;
+       unsigned int fb_dma_addr;
        char mon[16];
        char *lcd_mode = CONFIG_VIDEO_LCD_MODE;
-       int i;
 
        memset(&sunxi_display, 0, sizeof(struct sunxi_display));
 
@@ -1310,6 +1368,8 @@ void *video_hw_init(void)
        hpd_delay = video_get_option_int(options, "hpd_delay", 500);
        edid = video_get_option_int(options, "edid", 1);
 #endif
+       overscan_x = video_get_option_int(options, "overscan_x", -1);
+       overscan_y = video_get_option_int(options, "overscan_y", -1);
        sunxi_display.monitor = sunxi_get_default_mon(true);
        video_get_option_string(options, "monitor", mon, sizeof(mon),
                                sunxi_get_mon_desc(sunxi_display.monitor));
@@ -1386,8 +1446,20 @@ void *video_hw_init(void)
                break;
        }
 
+       /* Yes these defaults are quite high, overscan on composite sucks... */
+       if (overscan_x == -1)
+               overscan_x = sunxi_is_composite() ? 32 : 0;
+       if (overscan_y == -1)
+               overscan_y = sunxi_is_composite() ? 20 : 0;
+
        sunxi_display.fb_size =
                (mode->xres * mode->yres * 4 + 0xfff) & ~0xfff;
+       overscan_offset = (overscan_y * mode->xres + overscan_x) * 4;
+       /* We want to keep the fb_base for simplefb page aligned, where as
+        * the sunxi dma engines will happily accept an unaligned address. */
+       if (overscan_offset)
+               sunxi_display.fb_size += 0x1000;
+
        if (sunxi_display.fb_size > CONFIG_SUNXI_MAX_FB_SIZE) {
                printf("Error need %dkB for fb, but only %dkB is reserved\n",
                       sunxi_display.fb_size >> 10,
@@ -1395,25 +1467,36 @@ void *video_hw_init(void)
                return NULL;
        }
 
-       printf("Setting up a %dx%d%s %s console\n", mode->xres, mode->yres,
+       printf("Setting up a %dx%d%s %s console (overscan %dx%d)\n",
+              mode->xres, mode->yres,
               (mode->vmode == FB_VMODE_INTERLACED) ? "i" : "",
-              sunxi_get_mon_desc(sunxi_display.monitor));
+              sunxi_get_mon_desc(sunxi_display.monitor),
+              overscan_x, overscan_y);
 
        gd->fb_base = gd->bd->bi_dram[0].start +
                      gd->bd->bi_dram[0].size - sunxi_display.fb_size;
        sunxi_engines_init();
-       sunxi_mode_set(mode, gd->fb_base - CONFIG_SYS_SDRAM_BASE);
+
+       fb_dma_addr = gd->fb_base - CONFIG_SYS_SDRAM_BASE;
+       sunxi_display.fb_addr = gd->fb_base;
+       if (overscan_offset) {
+               fb_dma_addr += 0x1000 - (overscan_offset & 0xfff);
+               sunxi_display.fb_addr += (overscan_offset + 0xfff) & ~0xfff;
+               memset((void *)gd->fb_base, 0, sunxi_display.fb_size);
+               flush_cache(gd->fb_base, sunxi_display.fb_size);
+       }
+       sunxi_mode_set(mode, fb_dma_addr);
 
        /*
         * These are the only members of this structure that are used. All the
-        * others are driver specific. There is nothing to decribe pitch or
-        * stride, but we are lucky with our hw.
+        * others are driver specific. The pitch is stored in plnSizeX.
         */
-       graphic_device->frameAdrs = gd->fb_base;
+       graphic_device->frameAdrs = sunxi_display.fb_addr;
        graphic_device->gdfIndex = GDF_32BIT_X888RGB;
        graphic_device->gdfBytesPP = 4;
-       graphic_device->winSizeX = mode->xres;
-       graphic_device->winSizeY = mode->yres;
+       graphic_device->winSizeX = mode->xres - 2 * overscan_x;
+       graphic_device->winSizeY = mode->yres - 2 * overscan_y;
+       graphic_device->plnSizeX = mode->xres * graphic_device->gdfBytesPP;
 
        return graphic_device;
 }
@@ -1490,10 +1573,9 @@ int sunxi_simplefb_setup(void *blob)
                return ret;
        }
 
-       ret = fdt_setup_simplefb_node(blob, offset, gd->fb_base,
+       ret = fdt_setup_simplefb_node(blob, offset, sunxi_display.fb_addr,
                        graphic_device->winSizeX, graphic_device->winSizeY,
-                       graphic_device->winSizeX * graphic_device->gdfBytesPP,
-                       "x8r8g8b8");
+                       graphic_device->plnSizeX, "x8r8g8b8");
        if (ret)
                eprintf("Cannot setup simplefb: Error setting properties\n");
 
index c6563780d7b1f507d32ef4a7cd134239159abbd8..36cd50b71e197dae6539ae7efe09812525bdbc95 100644 (file)
@@ -15,6 +15,8 @@
 
 #define CONFIG_MPC5200         1       /* This is a MPC5200 CPU */
 #define CONFIG_CANMB           1       /* ... on canmb board - we need this for FEC.C */
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
 
 /*
  * allowed and functional CONFIG_SYS_TEXT_BASE values:
index c7bf531f6a86082e0061295bead94026779d86ac..d3034cf10f1086c4c1b75b5bf8ed5d4f67de6077 100644 (file)
@@ -18,6 +18,8 @@
 
 #define CONFIG_MPC5200         1       /* This is an MPC5200 CPU       */
 #define CONFIG_INKA4X0         1       /* INKA4x0 board                */
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
 
 /*
  * Valid values for CONFIG_SYS_TEXT_BASE are:
index 230f2c4d3090dea6f9fee6a097e7ec8898fcf98a..3f6f8dd0afbc6479bdfbde3e111caa1e71faafc0 100644 (file)
@@ -19,6 +19,8 @@
 #define CONFIG_MPX5200         1       /* MPX5200 board */
 #define CONFIG_MPC5200_DDR     1       /* use DDR RAM */
 #define CONFIG_IPEK01                  /* Motherboard is ipek01 */
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
 
 #define        CONFIG_SYS_TEXT_BASE    0xfc000000
 
index 65b3df601ddf7ef2ff7b612d80a241477e61213d..5601cb4797d8c7401dd06c074be85f68b464118c 100644 (file)
@@ -15,6 +15,8 @@
 
 #define CONFIG_MPC5200         1       /* This is an MPC5200 CPU */
 #define CONFIG_JUPITER         1       /* ... on Jupiter board */
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
 
 /*
  * Valid values for CONFIG_SYS_TEXT_BASE are:
index 6dc84eb3591fb706faa7a47cbcab57841e4e701f..3b97d91e582c4e8b7285790d2e0486f85ee90363 100644 (file)
@@ -17,6 +17,8 @@
 /* CPU and board */
 #define CONFIG_MPC5200         1       /* This is a MPC5200 CPU */
 #define CONFIG_MOTIONPRO       1       /* ... on Promess Motion-PRO board */
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
 
 #define CONFIG_HIGH_BATS       1       /* High BATs supported */
 
index 42ac0290d88c42d0c6b31ecd491d38b53bb66134..b1b6acd448aaccc86fa82353443fb6c85adb87f8 100644 (file)
@@ -14,6 +14,7 @@
 #define CONFIG_MPC5200         1       /* This is an MPC5200 CPU */
 #define CONFIG_MPC5200_DDR     1       /* (with DDR-SDRAM) */
 #define CONFIG_MUNICES         1       /* ... on MUNICes board */
+#define CONFIG_SYS_GENERIC_BOARD
 
 #ifndef CONFIG_SYS_TEXT_BASE
 #define CONFIG_SYS_TEXT_BASE   0xFFF00000
index 29feb7bba13210df6710df0a1501edab53af0993..4ea617a9d4c9aaea032f8f694d80f886adea7172 100644 (file)
@@ -15,6 +15,7 @@
 #define __CONFIG_H
 
 #define CONFIG_BOARDINFO        "phyCORE-MPC5200B-tiny"
+#define CONFIG_SYS_GENERIC_BOARD
 
 /*-----------------------------------------------------------------------------
 High Level Configuration Options
index 292b5145b97eb04cdf00d793573f5e9ff10cf7d3..50911ae2591130d28986f92aae8dce032f51055a 100644 (file)
@@ -27,6 +27,8 @@
 #define CONFIG_E500            1       /* BOOKE e500 family            */
 #define CONFIG_MPC8544         1
 #define CONFIG_SOCRATES                1
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
 
 #define        CONFIG_SYS_TEXT_BASE    0xfff80000
 
index 0ecb91b78dfd94c827d00951fff5afaaec89fa26..1abf73c311792b21f2fa40857b5f11e43fbd76cc 100644 (file)
@@ -288,7 +288,11 @@ extern int soft_i2c_gpio_scl;
  * The amount of RAM to keep free at the top of RAM when relocating u-boot,
  * to use as framebuffer. This must be a multiple of 4096.
  */
+#ifdef CONFIG_VIDEO_LCD_PANEL_EDP_4_LANE_1620M_VIA_ANX9804
+#define CONFIG_SUNXI_MAX_FB_SIZE (12 << 20)
+#else
 #define CONFIG_SUNXI_MAX_FB_SIZE (9 << 20)
+#endif
 
 /* Do we want to initialize a simple FB? */
 #define CONFIG_VIDEO_DT_SIMPLEFB
@@ -300,6 +304,7 @@ extern int soft_i2c_gpio_scl;
 #define CONFIG_VIDEO_LOGO
 #define CONFIG_VIDEO_STD_TIMINGS
 #define CONFIG_I2C_EDID
+#define VIDEO_LINE_LEN (pGD->plnSizeX)
 
 /* allow both serial and cfb console. */
 #define CONFIG_CONSOLE_MUX
index fe04692368b59a78f4621527587f9ef73f5edc94..1c1f8c0830d82de84fe15e3de39dd0491eb32332 100644 (file)
@@ -79,6 +79,7 @@
        "vram=16M\0" \
        "partitions=" PARTS_DEFAULT "\0" \
        "optargs=\0" \
+       "dofastboot=0\0" \
        "mmcdev=0\0" \
        "mmcroot=/dev/mmcblk0p2 rw\0" \
        "mmcrootfstype=ext4 rootwait\0" \
index 63049aba4d2a7390b8331ef4cc1c6b4caf0f2034..3e51b9fc2c95793f4f857a270f6c4187cf2cb13c 100644 (file)
@@ -14,6 +14,8 @@
  */
 #define CONFIG_MPC5200                 1       /* This is an MPC5200 CPU */
 #define CONFIG_V38B                    1       /* ...on V38B board */
+#define CONFIG_SYS_GENERIC_BOARD
+#define CONFIG_DISPLAY_BOARDINFO
 
 #define        CONFIG_SYS_TEXT_BASE            0xFF000000
 
index 138132a69660b05c58bfb3a22ee406db0607d589..41cb710d78f47e61e6ed25e9f4aa5d94c53d1c7e 100644 (file)
@@ -8,6 +8,11 @@
 #ifndef __PFUZE100_PMIC_H_
 #define __PFUZE100_PMIC_H_
 
+/* Device ID */
+enum {PFUZE100 = 0x10, PFUZE200 = 0x11, PFUZE3000 = 0x30};
+
+#define PFUZE100_REGULATOR_DRIVER      "pfuze100_regulator"
+
 /* PFUZE100 registers */
 enum {
        PFUZE100_DEVICEID       = 0x00,
@@ -54,7 +59,7 @@ enum {
        PFUZE100_VGEN5VOL       = 0x70,
        PFUZE100_VGEN6VOL       = 0x71,
 
-       PMIC_NUM_OF_REGS        = 0x7f,
+       PFUZE100_NUM_OF_REGS    = 0x7f,
 };
 
 /* Registor offset based on VOLT register */