]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
TX28 DTS added
authorOliver Wendt <ow@karo-electronics.de>
Fri, 26 Apr 2013 10:52:32 +0000 (12:52 +0200)
committerOliver Wendt <ow@karo-electronics.de>
Tue, 7 May 2013 09:16:36 +0000 (11:16 +0200)
Heiko Abraham <heiko.abraham@hella-gutmann.com>

modified:   arch/arm/boot/dts/imx28-tx28.dts
modified:   arch/arm/mach-mxs/mach-mxs.c

arch/arm/boot/dts/imx28-tx28.dts
arch/arm/mach-mxs/mach-mxs.c

index 37be532f00550bf868b3265d1a7d7362b3443a35..097b82707352e39daec389b5f489a1a4bea5af1a 100644 (file)
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2013 <heiko.abraham@hella-gutmann.com>
+ * Copyright 2013 <OW@KARO-electronics.de>
+ * based on imx28.dtsi
+ *   Copyright 2011 Freescale Semiconductor, Inc.
+ *   Copyright 2011 Linaro Ltd.
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
 /dts-v1/;
 /include/ "imx28.dtsi"
 
        model = "Ka-Ro electronics TX28 module";
        compatible = "karo,tx28", "fsl,imx28";
 
+       chosen {
+               bootargs = "init=/linuxrc console=ttyAMA0,115200 root=/dev/mtdblock3 rootfstype=jffs2 ro debug panic=1";
+       };
+
        memory {
                reg = <0x40000000 0x08000000>;
        };
 
        apb@80000000 {
                apbh@80000000 {
+                       gpmi-nand@8000c000 {
+                           #address-cells = <1>;
+                           #size-cells = <1>;
+                           pinctrl-names = "default";
+                           pinctrl-0 = <&gpmi_pins_a &gpmi_status_cfg>;
+                           nand-on-flash-bbt;
+                           status = "okay";
+                       };
+
                        ssp0: ssp@80010000 {
                                compatible = "fsl,imx28-mmc";
                                pinctrl-names = "default";
                                             &mmc0_cd_cfg
                                             &mmc0_sck_cfg>;
                                bus-width = <4>;
+                               /* wp-gpios = <&gpio2 20 0>; */
+                               /* wp-inverted; */
                                status = "okay";
                        };
 
                        pinctrl@80018000 {
                                pinctrl-names = "default";
                                pinctrl-0 = <&hog_pins_a>;
-
                                hog_pins_a: hog@0 {
                                        reg = <0>;
                                        fsl,pinmux-ids = <
-                                               0x40a3 /* MX28_PAD_ENET0_RXD3__GPIO_4_10 */
+                                               0x40a3          /* MX28_PAD_ENET0_RXD3__GPIO_4_10 */
                                        >;
                                        fsl,drive-strength = <0>;
                                        fsl,voltage = <1>;
                                mac0_pins_gpio: mac0-gpio-mode@0 {
                                        reg = <0>;
                                        fsl,pinmux-ids = <
-                                               0x4003 /* MX28_PAD_ENET0_MDC__GPIO_4_0 */
-                                               0x4013 /* MX28_PAD_ENET0_MDIO__GPIO_4_1 */
-                                               0x4023 /* MX28_PAD_ENET0_RX_EN__GPIO_4_2 */
-                                               0x4033 /* MX28_PAD_ENET0_RXD0__GPIO_4_3 */
-                                               0x4043 /* MX28_PAD_ENET0_RXD1__GPIO_4_4 */
-                                               0x4063 /* MX28_PAD_ENET0_TX_EN__GPIO_4_6 */
-                                               0x4073 /* MX28_PAD_ENET0_TXD0__GPIO_4_7 */
-                                               0x4083 /* MX28_PAD_ENET0_TXD1__GPIO_4_8 */
-                                               0x4103 /* MX28_PAD_ENET_CLK__GPIO_4_16 */
+                                               0x4003          /* MX28_PAD_ENET0_MDC__GPIO_4_0 */
+                                               0x4013          /* MX28_PAD_ENET0_MDIO__GPIO_4_1 */
+                                               0x4023          /* MX28_PAD_ENET0_RX_EN__GPIO_4_2 */
+                                               0x4033          /* MX28_PAD_ENET0_RXD0__GPIO_4_3 */
+                                               0x4043          /* MX28_PAD_ENET0_RXD1__GPIO_4_4 */
+                                               0x4063          /* MX28_PAD_ENET0_TX_EN__GPIO_4_6 */
+                                               0x4073          /* MX28_PAD_ENET0_TXD0__GPIO_4_7 */
+                                               0x4083          /* MX28_PAD_ENET0_TXD1__GPIO_4_8 */
+                                               0x4103          /* MX28_PAD_ENET_CLK__GPIO_4_16 */
+                                       >;
+                                       fsl,drive-strength = <0>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <0>;
+                               };
+
+                               lcdif_pins_tx28: lcdif-tx28@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
+                                               0x11e0          /* MX28_PAD_LCD_DOTCLK__LCD_DOTCLK */
+                                               0x11f0          /* MX28_PAD_LCD_ENABLE__LCD_ENABLE */
+                                               0x11c0          /* MX28_PAD_LCD_VSYNC__LCD_VSYNC */
+                                               0x11d0          /* MX28_PAD_LCD_HSYNC__LCD_HSYNC */
+                                               0x11f3          /* MX28_PAD_LCD_ENABLE__GPIO_1_31 - Enable */
+                                               0x31e3          /* MX28_PAD_LCD_RESET__GPIO_3_30 - Reset */
                                        >;
                                        fsl,drive-strength = <0>;
                                        fsl,voltage = <1>;
                                        fsl,pull-up = <0>;
                                };
+
+                               duart_2pins_a: duart-2pins@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
+                                               0x3022          /* MX28_PAD_AUART0_CTS__DUART_RX */
+                                               0x3032          /* MX28_PAD_AUART0_RTS__DUART_TX */
+                                       >;
+                                       fsl,drive-strength = <0>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <0>;
+                               };
+
+                               auart2_2pins_a: auart2-2pins@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
+                                               0x2111          /* MX28_PAD_SSP2_MOSI__AUART2_TX */
+                                               0x2101          /* MX28_PAD_SSP2_SCK__AUART2_RX */
+                                       >;
+                                       fsl,drive-strength = <0>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <0>;
+                               };
+
+                               auart4_2pins_a: auart4-2pins@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
+                                               0x3172          /* MX28_PAD_SAIF0_SDATA0__AUART4_TX */
+                                               0x3162          /* MX28_PAD_SAIF0_BITCLK__AUART4_RX */
+                                       >;
+                                       fsl,drive-strength = <0>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <0>;
+                               };
+
+                               usbphy0_pins_c: usbphy0@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
+                                               0x0133          /* MX28_PAD_GPMI_CE3N__GPIO_0_19 - USB_OC */
+                                               0x3121          /* MX28_PAD_PWM2__USB0_ID - USB0ID */
+                                       >;
+                                       fsl,drive-strength = <2>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <0>;
+                               };
+
+                               usbphy1_pins_b: usbphy1@0 {
+                                       reg = <0>;
+                                       fsl,pinmux-ids = <
+                                               0x31b3          /* MX28_PAD_SPDIF__GPIO_3_27 - USB_OC */
+                                       >;
+                                       fsl,drive-strength = <2>;
+                                       fsl,voltage = <1>;
+                                       fsl,pull-up = <0>;
+                               };
                        };
+
+                       lcdif@80030000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&lcdif_24bit_pins_a
+                                            &lcdif_pins_tx28>;
+                               panel-enable-gpios = <&gpio1 27 0>;
+                               status = "okay";
+                       };
+
+                       can0: can@80032000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&can0_pins_a>;
+                               status = "okay";
+                       };
+/*
+                       can1: can@80034000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&can1_pins_a>;
+                               status = "okay";
+                       };
+
+                       pxp@8002a000 {
+                               status = "okay";
+                       };
+
+                       ocotp@8002c000 {
+                               status = "okay";
+                       };
+*/
                };
 
                apbx@80040000 {
                        i2c0: i2c@80058000 {
                                pinctrl-names = "default";
                                pinctrl-0 = <&i2c0_pins_a>;
+                               clock-frequency = <400000>;
                                status = "okay";
-
                                ds1339: rtc@68 {
-                                       compatible = "mxim,ds1339";
-                                       reg = <0x68>;
+                               compatible = "mxim,ds1339";
+                               reg = <0x68>;
+                               trickle-charge = <0xa5>;
                                };
+/*
+                               pca9554: pca953x@20 {
+                                       compatible = "nxp,pca953x";
+                                       reg = <0x20>;
+                                       interrupt-parent = <&gpio3>;
+                                       interrupts = <20>;
+                                       gpio-controller;
+                                       #gpio-cells = <2>;
+                                       };
+*/
+/* unfinished - required platform data bugfix
+                               touchscreen: tsc2007@48 {
+                                       compatible = "ti,tsc2007";
+                                       reg = <0x48>;
+                                       interrupt-parent = <&gpio3>;
+                                       interrupts = <20 0>;
+                                       pendown-gpio = <&gpio3 20 1>;
+                                       model = "2007";
+                                       x-plate-ohms = <660>;
+                                       };
+*/
+                               polytouch: edt-ft5x06@ {
+                                       compatible = "edt,edt-ft5x06";
+                                       reg = <0x38>;
+                                       interrupt-parent = <&gpio2>;
+                                       interrupts = <5>;
+                                       reset-switch = <&edt_ft5x06_reset>;
+                                       wake-switch = <&edt_ft5x06_wake>;
+                                       };
+                               codec: sgtl5000@0a {
+                                       compatible = "fsl,sgtl5000";
+                                       reg = <0x0a>;
+                                       VDDA-supply = <&reg_2p5v>;
+                                       VDDIO-supply = <&reg_3p3v>;
+                                       };
+                       };
+
+                       lradc@80050000 {
+                               fsl,lradc-touchscreen-wires = <4>;
+                               status = "okay";
+                       };
+
+                       hsadc@80002000 {
+                               status = "okay";
+                       };
+
+                       onewire@0 {
+                               compatible = "w1-gpio";
+                               gpios = <&gpio2 7 1>;
                        };
 
                        pwm: pwm@80064000 {
                                status = "okay";
                        };
 
+                       /* 1st TX-Std UART - (D)UART */
                        duart: serial@80074000 {
                                pinctrl-names = "default";
                                pinctrl-0 = <&duart_4pins_a>;
                                status = "okay";
                        };
-
+                       /* 2nd TX-Std UART - (A)UART1  */
                        auart1: serial@8006c000 {
                                pinctrl-names = "default";
                                pinctrl-0 = <&auart1_pins_a>;
                                status = "okay";
                        };
+                       /* 3th TX-Std UART - (A)UART3  */
+                       auart3: serial@80070000 {
+                               pinctrl-names = "default";
+                               pinctrl-0 = <&auart3_pins_a>;
+                               status = "okay";
+                       };
+                       usbphy0: usbphy@8007c000 {
+                               status = "okay";
+                       };
+                       usbphy1: usbphy@8007e000 {
+                               status = "okay";
+                       };
                };
        };
 
        ahb@80080000 {
+/* wait for patch from sascha hauer
+               usb0: usb@80080000 {
+                       vbus-supply = <&reg_usb0_vbus>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&usbphy0_pins_c>;
+                       disable-over-current;
+                       dr_mode = "otg";
+                       status = "okay";
+               };
+*/
+               usb1: usb@80090000 {
+                       vbus-supply = <&reg_usb1_vbus>;
+                       pinctrl-names = "default";
+                       pinctrl-0 = <&usbphy1_pins_b>;
+                       dr_mode = "host";
+                       status = "okay";
+               };
                mac0: ethernet@800f0000 {
                        phy-mode = "rmii";
                        pinctrl-names = "default", "gpio_mode";
                };
        };
 
+
+       regulators {
+               compatible = "simple-bus";
+
+               reg_usb0_vbus: usb0_vbus {
+                       compatible = "regulator-fixed";
+                       regulator-name = "usb0_vbus";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       gpio = <&gpio0 18 0>;
+                       enable-active-high;
+               };
+
+               reg_usb1_vbus: usb1_vbus {
+                       compatible = "regulator-fixed";
+                       regulator-name = "usb1_vbus";
+                       regulator-min-microvolt = <5000000>;
+                       regulator-max-microvolt = <5000000>;
+                       gpio = <&gpio3 27 0>;
+                       enable-active-high;
+               };
+
+               reg_2p5v: 2p5v {
+                       compatible = "regulator-fixed";
+                       regulator-name = "2P5V";
+                       regulator-min-microvolt = <2500000>;
+                       regulator-max-microvolt = <2500000>;
+                       regulator-always-on;
+               };
+
+               reg_3p3v: 3p3v {
+                       compatible = "regulator-fixed";
+                       regulator-name = "3P3V";
+                       regulator-min-microvolt = <3300000>;
+                       regulator-max-microvolt = <3300000>;
+                       regulator-always-on;
+               };
+       };
+
+       gpio-switch {
+               compatible = "gpio-switches", "simple-bus";
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               edt_ft5x06_reset: gpio-switch@0 {
+                       compatible = "linux,gpio-switch";
+                       gpio = <&gpio2 6 1>;
+                       label = "EDT-FT5x06 RESET";
+               };
+
+               edt_ft5x06_wake: gpio-switch@1 {
+                       compatible = "linux,gpio-switch";
+                       gpio = <&gpio4 9 0>;
+                       label = "EDT-FT5x06 WAKE";
+                       init-state = <1>;
+               };
+
+               edt_ft5x06_irq: gpio-switch@2 {
+                       compatible = "linux,gpio-switch";
+                       gpio = <&gpio2 5 0>;
+                       label = "EDT-FT5x06 IRQ";
+                       init-state = <1>;
+               };
+       }
+/*
        leds {
                compatible = "gpio-leds";
 
                        label = "Heartbeat";
                        gpios = <&gpio4 10 0>;
                        linux,default-trigger = "heartbeat";
+                       init-state = <0>;
+               };
+/**/
+               user_lcd_power {
+                       label = "lcd_power";
+                       gpios = <&gpio1 31 1>;
+               /* init-state = <1>; */
                };
+/**/
        };
-
+*/
        backlight {
                compatible = "pwm-backlight";
                pwms = <&pwm 0 5000000>;
index b5c1bdd3dcdf7259ea7061814af1653bffb19648..84fc5dc4790704885e32c238231928b61c3b006d 100644 (file)
@@ -16,6 +16,8 @@
 #include <linux/clocksource.h>
 #include <linux/can/platform/flexcan.h>
 #include <linux/delay.h>
+#include <linux/i2c.h>
+#include <linux/i2c/tsc2007.h>
 #include <linux/err.h>
 #include <linux/gpio.h>
 #include <linux/init.h>
@@ -109,6 +111,24 @@ static struct fb_videomode m28evk_video_modes[] = {
        },
 };
 
+static struct fb_videomode tx28_video_modes[] = {
+       {
+               .name           = "VGA",
+               .refresh        = 60,
+               .xres           = 640,
+               .yres           = 480,
+               .pixclock       = KHZ2PICOS(25175),
+               .left_margin    = 48,
+               .right_margin   = 16,
+               .upper_margin   = 33,
+               .lower_margin   = 10,
+               .hsync_len      = 96,
+               .vsync_len      = 2,
+               .sync           = FB_SYNC_DATA_ENABLE_HIGH_ACT,
+               .vmode      = FB_VMODE_NONINTERLACED,
+       }
+};
+
 static struct fb_videomode apx4devkit_video_modes[] = {
        {
                .name           = "HannStar PJ70112A",
@@ -128,18 +148,20 @@ static struct fb_videomode apx4devkit_video_modes[] = {
 
 static struct fb_videomode apf28dev_video_modes[] = {
        {
-               .name = "LW700",
-               .refresh = 60,
-               .xres = 800,
-               .yres = 480,
-               .pixclock = 30303, /* picosecond */
-               .left_margin = 96,
-               .right_margin = 96, /* at least 3 & 1 */
-               .upper_margin = 0x14,
-               .lower_margin = 0x15,
-               .hsync_len = 64,
-               .vsync_len = 4,
-               .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+               .name           = "LW700",
+               .refresh        = 60,
+               .xres           = 800,
+               .yres           = 480,
+               .pixclock       = 30303, /* picosecond */
+               .left_margin    = 96,
+               .right_margin   = 96, /* at least 3 & 1 */
+               .upper_margin   = 0x14,
+               .lower_margin   = 0x15,
+               .hsync_len      = 64,
+               .vsync_len      = 4,
+               .sync           = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT |
+                                 FB_SYNC_DATA_ENABLE_HIGH_ACT |
+                                 FB_SYNC_DOTCLK_FAILING_ACT,
        },
 };
 
@@ -434,6 +456,15 @@ static void __init apx4devkit_init(void)
 #define TX28_FEC_PHY_RESET     MXS_GPIO_NR(4, 13)
 #define TX28_FEC_nINT          MXS_GPIO_NR(4, 5)
 
+#define TX28_STK5_GPIO_LCD_ENABLE       MXS_GPIO_NR(1, 31)
+#define TX28_STK5_GPIO_LCD_RESET        MXS_GPIO_NR(3, 30)
+
+/* I2C devices */
+#define TX28_PCA9554_GPIO_BASE          160
+#define TSC2007_PEN_GPIO                MXS_GPIO_NR(3, 20)
+
+#define TX28_STK5_GPIO_USBHOST_VBUSEN   MXS_GPIO_NR(3, 27)
+
 static const struct gpio tx28_gpios[] __initconst = {
        { ENET0_MDC__GPIO_4_0, GPIOF_OUT_INIT_LOW, "GPIO_4_0" },
        { ENET0_MDIO__GPIO_4_1, GPIOF_OUT_INIT_LOW, "GPIO_4_1" },
@@ -477,6 +508,19 @@ static void __init tx28_post_init(void)
                return;
        }
 
+       /* setup some video modes */
+       mxsfb_pdata.mode_list = tx28_video_modes;
+       mxsfb_pdata.mode_count = ARRAY_SIZE(tx28_video_modes);
+       mxsfb_pdata.default_bpp = 32;
+       mxsfb_pdata.ld_intf_width = STMLCDIF_24BIT;
+
+       /* activate Starterkit LCD */
+       /* fixme: use of/devicetree later */
+       gpio_set_value(TX28_STK5_GPIO_LCD_ENABLE, 1); /*  MXS_GPIO_NR(1, 31) */
+       udelay(15);
+       gpio_set_value(TX28_STK5_GPIO_LCD_RESET, 1);  /* MXS_GPIO_NR(3, 30) */
+       /* msleep(300); */
+
        /* Power up fec phy */
        gpio_set_value(TX28_FEC_PHY_POWER, 1);
        msleep(26); /* 25ms according to data sheet */