diff options
| author | mattis fjallstrom <mattis@acm.org> | 2015-04-13 15:56:13 -0700 | 
|---|---|---|
| committer | mattis fjallstrom <mattis@acm.org> | 2015-04-13 15:56:13 -0700 | 
| commit | 99dfd80f9e45d96d2cdc2323354286f1666c575e (patch) | |
| tree | 463dc024f60237bbe46bc513cadd058362d5350e | |
| parent | 81c88f206e0986911911f6cdd84bce03e26dc336 (diff) | |
| download | olio-linux-3.10-99dfd80f9e45d96d2cdc2323354286f1666c575e.tar.xz olio-linux-3.10-99dfd80f9e45d96d2cdc2323354286f1666c575e.zip | |
Device tree - adding file for H1, modifiying default omap3 tree files (so as not to interfere with our board file) and also adding an updated boardfile.
Change-Id: Ic9e859cddc4ff1b5a2e7101a76cf407e48164496
| -rw-r--r-- | arch/arm/boot/dts/omap3.dtsi | 221 | ||||
| -rw-r--r-- | arch/arm/boot/dts/omap36xx.dtsi | 35 | ||||
| -rw-r--r-- | arch/arm/boot/dts/omap3_h1.dts | 60 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/board-omap3h1.c | 300 | 
4 files changed, 418 insertions, 198 deletions
| diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi index 2b8802164c1..4a6b49b8e54 100644 --- a/arch/arm/boot/dts/omap3.dtsi +++ b/arch/arm/boot/dts/omap3.dtsi @@ -14,17 +14,18 @@  	compatible = "ti,omap3430", "ti,omap3";  	interrupt-parent = <&intc>; -	aliases { +	aliases { /*  		serial0 = &uart1;  		serial1 = &uart2;  		serial2 = &uart3; +               */  	}; -	cpus { -		cpu@0 { +	 cpus {  +	 	cpu@0 {  			compatible = "arm,cortex-a8"; -		}; -	}; +	 	}; +	 };  	pmu {  		compatible = "arm,cortex-a8-pmu"; @@ -43,14 +44,14 @@  			ti,hwmods = "mpu";  		}; -		iva { -			compatible = "ti,iva2.2"; -			ti,hwmods = "iva"; - -			dsp { -				compatible = "ti,omap3-c64"; -			}; -		}; +	    iva { +          compatible = "ti,iva2.2"; +          ti,hwmods = "iva"; +           +          dsp { +            compatible = "ti,omap3-c64"; +          }; +        };   	};  	/* @@ -111,7 +112,7 @@  			pinctrl-single,register-width = <16>;  			pinctrl-single,function-mask = <0x7f1f>;  			#gpio-range-cells = <3>; -		}; +         };  		gpio1: gpio@48310000 {  			compatible = "ti,omap3-gpio"; @@ -123,24 +124,31 @@  			#gpio-cells = <2>;  			interrupt-controller;  			#interrupt-cells = <2>; -		}; +         }; -		gpio2: gpio@49050000 { -			compatible = "ti,omap3-gpio"; -			reg = <0x49050000 0x200>; -			interrupts = <30>; -			ti,hwmods = "gpio2"; -			gpio-controller; -			#gpio-cells = <2>; -			interrupt-controller; -			#interrupt-cells = <2>; -			/* for gpio 32 33 there is no pnctrl controller defined */ -			gpio-ranges = <&omap3_pmx_core 2 0x25 10>, -					<&omap3_pmx_core 12 0x37 8>, -					<&omap3_pmx_core 20 0x40 8>, -					<&omap3_pmx_core 28 0x4B 3>, -					<&omap3_pmx_core 31 0x4f 1>; -		}; +        /* disabling this one makes suspend work */ +        /* but it also causes the touch to NOT work */ + +         gpio2: gpio@49050000 { +		 	compatible = "ti,omap3-gpio"; +		 	reg = <0x49050000 0x200>; +		 	interrupts = <30>; +		 	ti,hwmods = "gpio2"; +		 	gpio-controller; +            #gpio-cells = <2>; +		 	interrupt-controller; +             #interrupt-cells = <2>; +		 	/* for gpio 32 33 there is no pnctrl controller defined */ +             /* gpio-ranges = <&omap3_pmx_core 2 0x25 10>, */ +             /*               <&omap3_pmx_core 12 0x37 8>, */ +             /*               <&omap3_pmx_core 20 0x40 8>, */ +		     /*               <&omap3_pmx_core 28 0x4B 3>, */ +             /*               <&omap3_pmx_core 31 0x4f 1>; */ +          }; + +        /* Removing this one disables touch, +         * suspend works. +         */  		gpio3: gpio@49052000 {  			compatible = "ti,omap3-gpio"; @@ -151,26 +159,34 @@  			#gpio-cells = <2>;  			interrupt-controller;  			#interrupt-cells = <2>; -			gpio-ranges = <&omap3_pmx_core 0 0x50 32>; -		}; +			/* gpio-ranges = <&omap3_pmx_core 0 0x50 32>; */ +         }; -		gpio4: gpio@49054000 { -			compatible = "ti,omap3-gpio"; +        /* Removing this one disables _both_ touch  +         * and suspend.  +         */ + +         gpio4: gpio@49054000 { +            compatible = "ti,omap3-gpio";  			reg = <0x49054000 0x200>;  			interrupts = <32>;  			ti,hwmods = "gpio4";  			gpio-controller;  			#gpio-cells = <2>;  			interrupt-controller; -			#interrupt-cells = <2>; +            #interrupt-cells = <2>;  			/* -			* gpio 127 in wkup mux, whcih we can not use (see +			* gpio 127 in wkup mux, which we can not use (see  			* sorce code for comment)  			*/ -			gpio-ranges = <&omap3_pmx_core 0 0x70 16>, -					<&omap3_pmx_core 16 0x82 14>, -					<&omap3_pmx_core 30 0x81 1>; -		}; +            /* gpio-ranges = <&omap3_pmx_core 0 0x70 16>,  */ +            /*               <&omap3_pmx_core 16 0x82 14>, */ +            /*               <&omap3_pmx_core 30 0x81 1>; */ +        }; + +        /* Removing this one causes touch to work but suspend to  +         * crash....  +         */  		gpio5: gpio@49056000 {  			compatible = "ti,omap3-gpio"; @@ -180,14 +196,18 @@  			gpio-controller;  			#gpio-cells = <2>;  			interrupt-controller; -			#interrupt-cells = <2>; +            #interrupt-cells = <2>;  			/* -			* gpio 128 129 in wkup mux, whcih we can not use (see -			* sorce code for comment) -			*/ -			gpio-ranges = <&omap3_pmx_core 2 0x94 30>; +             * gpio 128 129 in wkup mux, whcih we can not use (see +             * sorce code for comment) +             */ +            /* gpio-ranges = <&omap3_pmx_core 2 0x94 20>; */  		}; +        /* Removing this one causes touch to work but suspend to  +         * crash....  +         */        +  		gpio6: gpio@49058000 {  			compatible = "ti,omap3-gpio";  			reg = <0x49058000 0x200>; @@ -196,18 +216,20 @@  			gpio-controller;  			#gpio-cells = <2>;  			interrupt-controller; -			#interrupt-cells = <2>; +            #interrupt-cells = <2>;  			/* for gpio 187 there is no pnctrl controller defined */ -			gpio-ranges = <&omap3_pmx_core 0 0xb2 7>, -					<&omap3_pmx_core 7 0x80 1>, -					<&omap3_pmx_core 8 0xc7 1>, -					<&omap3_pmx_core 9 0xc0 1>, -					<&omap3_pmx_core 10 0xcb 13>, -					<&omap3_pmx_core 23 0xc8 3>, -					<&omap3_pmx_core 26 0xd9 1>, -					<&omap3_pmx_core 28 0xc1 4>; -		}; +            /* gpio-ranges = <&omap3_pmx_core 0 0xb2 7>, */ +            /*               <&omap3_pmx_core 7 0x80 1>, */ +            /*               <&omap3_pmx_core 8 0xc7 1>, */ +            /*               <&omap3_pmx_core 9 0xc0 1>, */ +            /*               <&omap3_pmx_core 10 0xcb 13>, */ +            /*               <&omap3_pmx_core 23 0xc8 3>, */ +            /*               <&omap3_pmx_core 26 0xd9 1>,  */ +            /*               <&omap3_pmx_core 28 0xc1 4>; */ +         }; +         +        /*  		uart1: serial@4806a000 {  			compatible = "ti,omap3-uart";  			ti,hwmods = "uart1"; @@ -224,8 +246,9 @@  			compatible = "ti,omap3-uart";  			ti,hwmods = "uart3";  			clock-frequency = <48000000>; -		}; +         };*/ +        /*           		i2c1: i2c@48070000 {  			compatible = "ti,omap3-i2c";  			#address-cells = <1>; @@ -245,7 +268,7 @@  			#address-cells = <1>;  			#size-cells = <0>;  			ti,hwmods = "i2c3"; -		}; +         }; */  		mcspi1: spi@48098000 {  			compatible = "ti,omap2-mcspi"; @@ -299,7 +322,7 @@  			ti,spi-num-cs = <1>;  			dmas = <&sdma 70>, <&sdma 71>;  			dma-names = "tx0", "rx0"; -		}; +         };  		mmc1: mmc@4809c000 {  			compatible = "ti,omap3-hsmmc"; @@ -328,14 +351,15 @@  			ti,hwmods = "wd_timer2";  		}; +           		mcbsp1: mcbsp@48074000 {  			compatible = "ti,omap3-mcbsp";  			reg = <0x48074000 0xff>; -			reg-names = "mpu"; -			interrupts = <16>, /* OCP compliant interrupt */ -				     <59>, /* TX interrupt */ -				     <60>; /* RX interrupt */ -			interrupt-names = "common", "tx", "rx"; +            reg-names = "mpu"; +            interrupts = <16>, /* OCP compliant interrupt */ +                         <59>, /* TX interrupt */ +                         <60>; /* RX interrupt */ +            interrupt-names = "common", "tx", "rx";  			ti,buffer-size = <128>;  			ti,hwmods = "mcbsp1";  			dmas = <&sdma 31>, @@ -348,11 +372,11 @@  			reg = <0x49022000 0xff>,  			      <0x49028000 0xff>;  			reg-names = "mpu", "sidetone"; -			interrupts = <17>, /* OCP compliant interrupt */ -				     <62>, /* TX interrupt */ -				     <63>, /* RX interrupt */ -				     <4>;  /* Sidetone */ -			interrupt-names = "common", "tx", "rx", "sidetone"; +            interrupts = <17>, /* OCP compliant interrupt */ +                         <62>, /* TX interrupt */ +                         <63>, /* RX interrupt */ +                         <4>;   /* Sidetone */ +            interrupt-names = "common", "tx", "rx", "sidetone";  			ti,buffer-size = <1280>;  			ti,hwmods = "mcbsp2", "mcbsp2_sidetone";  			dmas = <&sdma 33>, @@ -365,11 +389,11 @@  			reg = <0x49024000 0xff>,  			      <0x4902a000 0xff>;  			reg-names = "mpu", "sidetone"; -			interrupts = <22>, /* OCP compliant interrupt */ -				     <89>, /* TX interrupt */ -				     <90>, /* RX interrupt */ -				     <5>;  /* Sidetone */ -			interrupt-names = "common", "tx", "rx", "sidetone"; +            interrupts = <22>, /* OCP compliant interrupt */ +                         <89>, /* TX interrupt */ +                         <90>, /* RX interrupt */ +                         <5>;   /* Sidetone */ +            interrupt-names = "common", "tx", "rx", "sidetone";  			ti,buffer-size = <128>;  			ti,hwmods = "mcbsp3", "mcbsp3_sidetone";  			dmas = <&sdma 17>, @@ -381,10 +405,10 @@  			compatible = "ti,omap3-mcbsp";  			reg = <0x49026000 0xff>;  			reg-names = "mpu"; -			interrupts = <23>, /* OCP compliant interrupt */ -				     <54>, /* TX interrupt */ -				     <55>; /* RX interrupt */ -			interrupt-names = "common", "tx", "rx"; +            interrupts = <23>, /* OCP compliant interrupt */ +                         <54>, /* TX interrupt */ +                         <55>; /* RX interrupt */ +            interrupt-names = "common", "tx", "rx";  			ti,buffer-size = <128>;  			ti,hwmods = "mcbsp4";  			dmas = <&sdma 19>, @@ -396,16 +420,16 @@  			compatible = "ti,omap3-mcbsp";  			reg = <0x48096000 0xff>;  			reg-names = "mpu"; -			interrupts = <27>, /* OCP compliant interrupt */ -				     <81>, /* TX interrupt */ -				     <82>; /* RX interrupt */ -			interrupt-names = "common", "tx", "rx"; +            interrupts = <27>, /* OCP compliant interrupt */ +                         <81>, /* TX interrupt */ +                         <82>; /* RX interrupt */ +            interrupt-names = "common", "tx", "rx";  			ti,buffer-size = <128>;  			ti,hwmods = "mcbsp5";  			dmas = <&sdma 21>,  			       <&sdma 22>;  			dma-names = "tx", "rx"; -		}; +         };  		timer1: timer@48318000 {  			compatible = "ti,omap3430-timer"; @@ -501,13 +525,13 @@  			ti,timer-alwon;  			ti,timer-secure;  		}; - -		usbhstll: usbhstll@48062000 { -			compatible = "ti,usbhs-tll"; -			reg = <0x48062000 0x1000>; -			interrupts = <78>; -			ti,hwmods = "usb_tll_hs"; -		}; +         +        /* usbhstll: usbhstll@48062000 { */ +        /*     compatible = "ti,usbhs-tll"; */ +		/*  	reg = <0x48062000 0x1000>;  */ +		/*  	interrupts = <78>;  */ +		/*  	ti,hwmods = "usb_tll_hs"; */ +        /* }; */  		usbhshost: usbhshost@48064000 {  			compatible = "ti,usbhs-host"; @@ -517,12 +541,12 @@  			#size-cells = <1>;  			ranges; -			usbhsohci: ohci@48064400 { -				compatible = "ti,ohci-omap3", "usb-ohci"; -				reg = <0x48064400 0x400>; -				interrupt-parent = <&intc>; -				interrupts = <76>; -			}; +			/* usbhsohci: ohci@48064400 { */ +			/* 	compatible = "ti,ohci-omap3", "usb-ohci"; */ +			/* 	reg = <0x48064400 0x400>; */ +			/* 	interrupt-parent = <&intc>; */ +			/* 	interrupts = <76>; */ +			/* }; */  			usbhsehci: ehci@48064800 {  				compatible = "ti,ehci-omap", "usb-ehci"; @@ -530,7 +554,7 @@  				interrupt-parent = <&intc>;  				interrupts = <77>;  			}; -		}; +         };  		gpmc: gpmc@6e000000 {  			compatible = "ti,omap3430-gpmc"; @@ -543,6 +567,7 @@  			#size-cells = <1>;  		}; +        /*  		usb_otg_hs: usb_otg_hs@480ab000 {  			compatible = "ti,omap3-musb";  			reg = <0x480ab000 0x1000>; @@ -552,7 +577,7 @@  			multipoint = <1>;  			num-eps = <16>;  			ram-bits = <12>; -		}; +         };*/  		glbl_prm: glbl_prm@48307250 {  			/* diff --git a/arch/arm/boot/dts/omap36xx.dtsi b/arch/arm/boot/dts/omap36xx.dtsi index f3447bc1b03..34392dbe1bd 100644 --- a/arch/arm/boot/dts/omap36xx.dtsi +++ b/arch/arm/boot/dts/omap36xx.dtsi @@ -12,27 +12,28 @@  / {  	aliases { -		serial3 = &uart4; +		/* serial3 = &uart4; */  	};  	cpus {  		/* OMAP3630/OMAP37xx 'standard device' variants OPP50 to OPP130 */ -		cpu@0 { -			operating-points = < -				/* kHz    uV */ -				300000  1012500 -				600000  1200000 -				800000  1325000 -			>; -			clock-latency = <300000>; /* From legacy driver */ -		}; +		/* cpu@0 { */ +		/* 	operating-points = < */ +		/* 		/\* kHz    uV *\/ */ +		/* 		300000  1012500 */ +		/* 		600000  1200000 */ +		/* 		800000  1325000 */ +        /*                        1000000  1375000                 */ +		/* 	>; */ +		/* 	clock-latency = <300000>; /\* From legacy driver *\/ */ +		/* }; */  	}; -	ocp { -		uart4: serial@49042000 { -			compatible = "ti,omap3-uart"; -			ti,hwmods = "uart4"; -			clock-frequency = <48000000>; -		}; -	}; +	/* ocp { */ +	/* 	uart4: serial@49042000 { */ +	/* 		compatible = "ti,omap3-uart"; */ +	/* 		ti,hwmods = "uart4"; */ +	/* 		clock-frequency = <48000000>; */ +	/* 	}; */ +	/* }; */  }; diff --git a/arch/arm/boot/dts/omap3_h1.dts b/arch/arm/boot/dts/omap3_h1.dts new file mode 100644 index 00000000000..cf07bae80c9 --- /dev/null +++ b/arch/arm/boot/dts/omap3_h1.dts @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2014 Olio Devices, Inc. + * Authors: Evan Wilson <evan@oliodevices.com> + *	    Mattis Fjallstrom <mattis@oliodevices.com> + * + * Modified from omap3-beagle-xm.dts + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ +/dts-v1/; + +/include/ "omap36xx.dtsi" +/ { +	model = "Olio OMAP3 H1 Board"; +	compatible = "olio,omap3-h1", "ti,omap3"; + +	cpus { +		cpu@0 { +			device_type = "cpu"; +			operating-points = < +				/* kHz    uV */ +				 300000   975000 +				 600000  1150000 +				 800000  1275000 +				1000000  1337500 +			>; +			/* OPP tolerance in percentage */ +			voltage-tolerance = <0>; +			reset-voltage = <1275000>; +		}; +	}; +}; + + + +&vc { +	ti,i2c-high-speed; +	ti,i2c-pad-load = <3>; +	vc_mpu{ +		ti,master-channel; +	}; + +	vc_core{ +		ti,use-master-slave-addr; +	}; +}; + + +&glbl_prm { +	status = "ok"; +	sys_clk = "osc_sys_ck"; +	autoextclkmode = <2>; +	sys_off_mode; +	auto_off; +	auto_retention; +	offmodesetup_time = <3500>; +	clksetup_time = <1000>; +}; diff --git a/arch/arm/mach-omap2/board-omap3h1.c b/arch/arm/mach-omap2/board-omap3h1.c index b3e002c4048..8697bcea5af 100644 --- a/arch/arm/mach-omap2/board-omap3h1.c +++ b/arch/arm/mach-omap2/board-omap3h1.c @@ -33,13 +33,11 @@  #include <linux/i2c/atmel_mxt_ts.h>  #include <linux/gpio.h> -#include <linux/gpio_keys.h>  #include <linux/regulator/machine.h>  #include <linux/regulator/fixed.h>  #include <linux/mfd/tps65910.h> -#include <linux/kmod.h> /* for call_usermodehelper - not used, remove? */  #include <linux/wakelock.h> /* used in interrupt, waking up.  */  #include <linux/debugfs.h> @@ -54,6 +52,10 @@  #include <video/omap-panel-data.h>  #include <linux/platform_data/mtd-nand-omap2.h> +#include <linux/of_irq.h> +#include <linux/of_platform.h> + +  #include "common.h"  #include "omap_device.h"  #include "gpmc.h" @@ -67,8 +69,8 @@  #define NAND_CS 0  #define MPUIRQ_GPIO 31 -#define ON_OFF_BUTTON_GPIO 30  #define ATMEL_MXT_GPIO 105 +#define TPS_SYS_NIRQ 0  #define USB_IRQ 124  #define USB_ON_ETK_D7 21 @@ -178,8 +180,8 @@ static int __init omap3h1_spi_init(void) {  static struct mpu_platform_data mpu_data = {  	.int_config  = 0x00,  	.level_shifter = 1, -	.orientation = {  0,  -1,  0, -					  -1,  0,  0, +	.orientation = {  0, -1,  0, +					 -1,  0,  0,  					  0,  0,  1 },  }; @@ -215,32 +217,6 @@ static struct platform_device omap3h1_dmic_codec = {  		.id = -1,  }; -/* --------------------------------------------------------------------------- */ -/* Keys / buttons settings  - */ - -static struct gpio_keys_button gpio_buttons[] = { -	{ -        .code			= KEY_POWER, /* 26 */ -		.gpio			= ON_OFF_BUTTON_GPIO, -		.desc			= "accelerometer", -		.wakeup			= 1, -	}, -}; - -static struct gpio_keys_platform_data gpio_key_info = { -	.buttons	= gpio_buttons, -	.nbuttons	= ARRAY_SIZE(gpio_buttons), -}; - -static struct platform_device omap3h1_keys = { -	.name	= "gpio-keys", -	.id	= -1, -	.dev	= { -		.platform_data	= &gpio_key_info, -	}, -}; -  /* --------------------------------------------------------------------------- */  /* USB settings  @@ -274,7 +250,7 @@ static struct platform_device nop_phy_device = {  /* --------------------------------------------------------------------------- */ -/* REGULATORS  +/* REGULATOR - Fixed first   */  static struct regulator_init_data omap3h1_vbat_data = { @@ -303,8 +279,8 @@ static struct platform_device omap3h1_vbat = {  static struct regulator_init_data tps65910_dummy = {  	.supply_regulator = "VBAT", -    .constraints.always_on  = false, -    /* .constraints.valid_ops_mask = REGULATOR_CHANGE_STATUS, */ +    .constraints.always_on  = true, +    .constraints.valid_ops_mask = REGULATOR_CHANGE_STATUS,  };  /* --------------------------------------------------------------------------- */ @@ -319,16 +295,38 @@ static struct regulator_init_data tps65910_touch3 = {          .min_uV            = 3300000,          .max_uV            = 3300000,          .valid_modes_mask  = REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY, -        .valid_ops_mask    = REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS  -                             | REGULATOR_CHANGE_MODE, +        .valid_ops_mask    = REGULATOR_CHANGE_STATUS | REGULATOR_CHANGE_MODE,          .always_on         = true,          .apply_uV		   = true, + +        .state_mem         = { +            .uV = 0, +            .mode = REGULATOR_MODE_STANDBY, +            .disabled = 1, +        }, +        .state_disk        = { +            .uV = 0, +            .mode = REGULATOR_MODE_STANDBY, +            .disabled = 1, +        }, +        .state_standby     = { +            .uV = 0, +            .mode = REGULATOR_MODE_STANDBY, +            .disabled = 1, +        },      }, +      .num_consumer_supplies = ARRAY_SIZE(tps65910_touch3_supply),      .consumer_supplies     = tps65910_touch3_supply,  };  /* --------------------------------------------------------------------------- */ +/* This regulator is for the vibrator. We currently lack a way of enabling / + * disabling this since we lack a driver for the vibrator (we're just accessing + * it's registers through the i2c bus).  + *  + * Hence, it's always on. + */  static struct regulator_consumer_supply tps65910_vibrator_supply[] = {        REGULATOR_SUPPLY("vaux2", "drv2605"), @@ -340,9 +338,7 @@ static struct regulator_init_data tps65910_vibrator = {          .min_uV            = 3300000,          .max_uV            = 3300000,          .valid_modes_mask  = REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY, -        .valid_ops_mask    = REGULATOR_CHANGE_VOLTAGE |  -                             REGULATOR_CHANGE_MODE | -                             REGULATOR_CHANGE_STATUS, +        .valid_ops_mask    = REGULATOR_CHANGE_MODE,          .always_on         = true,          .apply_uV		   = true,      }, @@ -353,7 +349,15 @@ static struct regulator_init_data tps65910_vibrator = {  /* --------------------------------------------------------------------------- */ +/* Seems like this one has to be on. It doesn't have any "official" consumers + * ... but it's definitely needed. Bluetooth relies on it. + */ +/* +static struct regulator_consumer_supply tps65910_bluetooth_3v3[] = { +      REGULATOR_SUPPLY("clk32ksys", 0), +}; +*/  static struct regulator_init_data tps65910_3v3 = {  	.supply_regulator = "VBAT", @@ -361,23 +365,35 @@ static struct regulator_init_data tps65910_3v3 = {          .min_uV            = 3300000,          .max_uV            = 3300000,          .valid_modes_mask  = REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY, -        .valid_ops_mask    = REGULATOR_CHANGE_VOLTAGE |  -                             REGULATOR_CHANGE_MODE    |  +        .valid_ops_mask    = REGULATOR_CHANGE_MODE    |                                REGULATOR_CHANGE_STATUS,          .always_on         = true,          .apply_uV		   = true, + +        .state_mem         = { +            .disabled = 1, +        }, +        .state_disk        = { +            .disabled = 1, +        }, +        .state_standby     = { +            .disabled = 1, +        },      }, +      };  /* --------------------------------------------------------------------------- */ -/* This regulator must not be allowed to change status, doing so causes        - * reboots to fail. Not sure why that is. --mfj +/* This is the OMAP display subsystem. Part of the OMAP processor OCP stuff. + * USB also depends on this, so if you want to transfer files it has to be  + * always on.   */  static struct regulator_consumer_supply tps65910_1v8_supply[] = {      REGULATOR_SUPPLY("vdds_dsi", "omapdss"), -    REGULATOR_SUPPLY("vin", "2-0038"), +	/* REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"), */ +	/* REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.1"), */  };  static struct regulator_init_data tps65910_1v8 = { @@ -386,27 +402,49 @@ static struct regulator_init_data tps65910_1v8 = {          .min_uV            = 1800000,          .max_uV            = 1800000,          .valid_modes_mask  = REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY, -        .valid_ops_mask    = REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE, -        .always_on         = false, +        .valid_ops_mask    = REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,  +        .always_on         = true,          .apply_uV		   = true, +         +        .state_mem         = { +            .uV = 0, +            .mode = REGULATOR_MODE_STANDBY, +            .disabled = 1, +        }, +        .state_disk        = { +            .uV = 0, +            .mode = REGULATOR_MODE_STANDBY, +            .disabled = 1, +        }, +        .state_standby     = { +            .uV = 0, +            .mode = REGULATOR_MODE_STANDBY, +            .disabled = 1, +        }, +      },      .num_consumer_supplies = ARRAY_SIZE(tps65910_1v8_supply),      .consumer_supplies     = tps65910_1v8_supply,  };  /* --------------------------------------------------------------------------- */ +/* This isn't actually used, but the wires are required by the processor / + * PMIC. I should be able to set it to constant standby mode (and maybe  + * also some sort of off setting?). + */  static struct regulator_consumer_supply tps65910_vpll_supply[] = { -  }; + +};  static struct regulator_init_data tps65910_vpll = {  	.supply_regulator = "VBAT",      .constraints = {          .min_uV            = 1800000,          .max_uV            = 1800000, -        .valid_modes_mask  = REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY,  -        .valid_ops_mask    = REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS, -        .always_on         = false, +        .valid_modes_mask  = REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY, +        .valid_ops_mask    = REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS, +        .always_on         = true,          .apply_uV		   = true,      },      .num_consumer_supplies = ARRAY_SIZE(tps65910_vpll_supply), @@ -418,6 +456,7 @@ static struct regulator_init_data tps65910_vpll = {  static struct regulator_consumer_supply tps65910_touch_supply[] = {      REGULATOR_SUPPLY("vdd", "2-004a" ), +    REGULATOR_SUPPLY("vdd", "spi1.1"),  };  static struct regulator_init_data tps65910_touch = { @@ -426,19 +465,35 @@ static struct regulator_init_data tps65910_touch = {          .min_uV            = 1800000,          .max_uV            = 1800000,          .valid_modes_mask  = REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY, -        .valid_ops_mask    = REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS, +        .valid_ops_mask    = REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,          .always_on         = false,          .apply_uV		   = true, + +        .state_mem         = { +            .uV = 0, +            .mode = REGULATOR_MODE_STANDBY, +            .disabled = 1, +        }, +        .state_disk        = { +            .mode = REGULATOR_MODE_STANDBY, +            .disabled = 1, +        }, +        .state_standby     = { +            .mode = REGULATOR_MODE_STANDBY, +            .disabled = 1, +        }, +      },      .num_consumer_supplies = ARRAY_SIZE(tps65910_touch_supply),      .consumer_supplies     = tps65910_touch_supply,  }; +/* =========================================================================== */  /* --------------------------------------------------------------------------- */  /* This one only works if 'always_on' is set to true. Do I need to do something - * special otherwise to turn it on?  + * special otherwise to turn it on? Maybe the driver doesn't enable it.   */  static struct regulator_consumer_supply tps65910_accel_supply[] = { @@ -450,16 +505,29 @@ static struct regulator_init_data tps65910_accel = {      .constraints = {          .min_uV            = 1800000,          .max_uV            = 1800000, -        .valid_modes_mask  = REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY, -        .valid_ops_mask    = REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_STATUS, +        .valid_modes_mask  = REGULATOR_MODE_NORMAL | REGULATOR_MODE_IDLE | REGULATOR_MODE_STANDBY, +        .valid_ops_mask    = REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS,          .always_on         = true,          .apply_uV		   = true, + +        .state_mem         = { +            .disabled = 1, +        }, +        .state_disk        = { +            .disabled = 1, +        }, +        .state_standby     = { +            .disabled = 1, +        },      },      .num_consumer_supplies = ARRAY_SIZE(tps65910_accel_supply),      .consumer_supplies     = tps65910_accel_supply,  };  /* --------------------------------------------------------------------------- */ +/* This one isn't pulled on by the CPU ... wrong supply name ? + * Also, the TWL code does NOT have always on set.  + */  static struct regulator_consumer_supply tps65910_vdd1_supply[] = {      REGULATOR_SUPPLY("vcc", "cpu0"), @@ -468,18 +536,21 @@ static struct regulator_consumer_supply tps65910_vdd1_supply[] = {  static struct regulator_init_data tps65910_vdd1 = {  	.supply_regulator = "VBAT",      .constraints = { -        .name              = "vdd_mpu", +        .name              = "vdd_mpu_iva",          .min_uV            = 900000,          .max_uV            = 1350000, -        .valid_modes_mask  = REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY, -        .valid_ops_mask    = REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS, -        .always_on         = false, +        .valid_modes_mask  = REGULATOR_MODE_NORMAL | REGULATOR_MODE_IDLE, +        .valid_ops_mask    = REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE, +        .always_on         = true,      }, +      .num_consumer_supplies = ARRAY_SIZE(tps65910_vdd1_supply),      .consumer_supplies     = tps65910_vdd1_supply,  };  /* --------------------------------------------------------------------------- */ +/* I seem to need always on, but the TWL code gets by without it. So...  + */  static struct regulator_consumer_supply tps65910_vdd2_supply[] = {      REGULATOR_SUPPLY("vcc", "l3_main.0"), @@ -491,19 +562,30 @@ static struct regulator_init_data tps65910_vdd2 = {          .name              = "vdd_core",          .min_uV            = 900000,          .max_uV            = 1200000, -        .valid_modes_mask  = REGULATOR_MODE_NORMAL | REGULATOR_MODE_STANDBY, -        .valid_ops_mask    = REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE | REGULATOR_CHANGE_STATUS, -        .always_on         = false, +        .valid_modes_mask  = REGULATOR_MODE_NORMAL | REGULATOR_MODE_IDLE, +        .valid_ops_mask    = REGULATOR_CHANGE_VOLTAGE | REGULATOR_CHANGE_MODE, +        .always_on         = true,      }, +      .num_consumer_supplies = ARRAY_SIZE(tps65910_vdd2_supply),      .consumer_supplies     = tps65910_vdd2_supply,  };  /* --------------------------------------------------------------------------- */ +static struct tps65910_sleep_keepon_data olio_slp_keepon = { +    .therm_keepon = 0, +    .clkout32k_keepon = 1, +    .i2chs_keepon = 0, +}; + +  static struct tps65910_board omap3h1_tps65910_pdata = { -	.irq = 7 + OMAP_INTC_START, +    /* .irq = 7 + OMAP_INTC_START, */ /* Getting this at runtime instead. */  	.en_ck32k_xtal = true, +    /* .en_dev_slp = true, */ +     +    /* .slp_keepon = &olio_slp_keepon, */      .tps65910_pmic_init_data[TPS65910_REG_VIO]      = &tps65910_1v8,      .tps65910_pmic_init_data[TPS65910_REG_VDD1]     = &tps65910_vdd1, @@ -515,7 +597,7 @@ static struct tps65910_board omap3h1_tps65910_pdata = {      .tps65910_pmic_init_data[TPS65910_REG_VMMC]     = &tps65910_touch3,      .tps65910_pmic_init_data[TPS65910_REG_VAUX2]    = &tps65910_vibrator, -    /* This one is connected to BT */ +    /* This one is connected to BT ... maybe more? */      .tps65910_pmic_init_data[TPS65910_REG_VAUX33]   = &tps65910_3v3, @@ -555,7 +637,7 @@ static u8 olio_uv_to_vsel(unsigned long uv)  static struct omap_voltdm_pmic omap3_mpu_pmic = { -	.slew_rate		= 4000, +	.slew_rate		= 12500,  	.step_size		= 12500,  	.vp_erroroffset		= OMAP3_VP_CONFIG_ERROROFFSET,  	.vp_vstepmin		= OMAP3_VP_VSTEPMIN_VSTEPMIN, @@ -571,7 +653,7 @@ static struct omap_voltdm_pmic omap3_mpu_pmic = {  };  static struct omap_voltdm_pmic omap3_core_pmic = { -	.slew_rate		= 4000, +	.slew_rate		= 12500,  	.step_size		= 12500,  	.vp_erroroffset		= OMAP3_VP_CONFIG_ERROROFFSET,  	.vp_vstepmin		= OMAP3_VP_VSTEPMIN_VSTEPMIN, @@ -812,6 +894,20 @@ static int __init omap3_acc_irq_init (int irq, void * dev_id) {  } +/*************************************************************************** + * DEVICE TREE STUFF + *  + * Trying to include some DT stuff with our board file. Not sure how this  + * will work out... + */ + +static struct of_device_id omap_dt_match_table[] __initdata = { +	{ .compatible = "olio,omap3-h1", }, +	{ .compatible = "simple-bus", }, +	{ .compatible = "ti,omap-infra", }, +	{ } +}; +  /***************************************************************************   * omap3_h1_i2c_init - init the i2c buses  @@ -822,12 +918,12 @@ static int __init omap3_h1_i2c_init(void)  {      int acc_irq; -  /* In Linux 3.10 we need to request an IRQ through  -   * gpio_to_irq. This means it can't be set at compile time, and -   * must be done at runtime. In other words, here. -   */ - -	gpio_request_one(ATMEL_MXT_GPIO, GPIOF_IN, "atmel_mxt_ts CHG"); +    /* In Linux 3.10 we need to request an IRQ through  +     * gpio_to_irq. This means it can't be set at compile time, and +     * must be done at runtime. In other words, here. +     */ +     +    gpio_request_one(ATMEL_MXT_GPIO, GPIOF_IN, "atmel_mxt_ts CHG");  	gpio_request_one(MPUIRQ_GPIO, GPIOF_IN, "mpu6515 IRQ pin");      acc_irq = gpio_to_irq(MPUIRQ_GPIO); @@ -835,6 +931,9 @@ static int __init omap3_h1_i2c_init(void)  #ifdef CONFIG_MACH_OMAP3_H1_DVT2  	omap3h1_i2c2_board_info[2].irq = gpio_to_irq(ATMEL_MXT_GPIO);      omap3h1_i2c2_board_info[0].irq = acc_irq; + +    ((struct tps65910_board *) (omap3h1_i2c1_board_info[0].platform_data))->irq =  +     gpio_to_irq (TPS_SYS_NIRQ);  #else  	omap3h1_i2c1_board_info[3].irq = gpio_to_irq(ATMEL_MXT_GPIO);      omap3h1_i2c1_board_info[1].irq = acc_irq; @@ -863,7 +962,6 @@ static struct platform_device *omap3h1_devices[] __initdata = {          &bcm20702_bluetooth_device,          &nop_phy_device,  		&omap3h1_dmic_codec, -        &omap3h1_keys,  };  #ifdef CONFIG_OMAP_MUX @@ -931,6 +1029,8 @@ static struct omap_board_mux board_mux[] __initdata = {      OMAP3_MUX(ETK_D7, (OMAP_MUX_MODE4 | OMAP_PIN_OUTPUT)), +    OMAP3_MUX(SYS_NIRQ, (OMAP_MUX_MODE0 | OMAP_PIN_INPUT)), +  	{ .reg_offset = OMAP_MUX_TERMINATOR },  };  #endif @@ -949,29 +1049,41 @@ static int __init omap3_wake_init (void) {  static void __init omap3_h1_init(void)  { -    omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); +    /* Read what we can from the device tree */ -	omap3_h1_i2c_init(); -   -	omap_display_init(&omap3h1_dss_data); -	omap_serial_init(); -	omap_sdrc_init(NULL, NULL); +    of_platform_populate(NULL, omap_dt_match_table, NULL, NULL);  	board_nand_init(omap3h1_nand_partitions,                      ARRAY_SIZE(omap3h1_nand_partitions), NAND_CS,                      NAND_BUSWIDTH_16, NULL); -	platform_add_devices(omap3h1_devices, ARRAY_SIZE(omap3h1_devices)); +    /* Set up the voltage domains */ -	omap3h1_spi_init(); +	omap_sdrc_init(NULL, NULL); -	usb_bind_phy("musb-hdrc.0.auto", 0, "nop_usb_xceiv"); /* "tusb-usb-h1" */ -	usb_musb_init(&musb_board_data); +    omap3_mux_init(board_mux, OMAP_PACKAGE_CBP); -    /* Set up the voltage domains */ +	omap3_h1_i2c_init();      omap3_voltdm_init(); +	omap3h1_spi_init(); + +	omap_serial_init(); + +	platform_add_devices(omap3h1_devices, ARRAY_SIZE(omap3h1_devices)); + +    /* TODO: The display only coming on on second boot and on may be  +     * related to the display init happening before many other things +     * on the board. --mfj +     */ + +    omap_display_init(&omap3h1_dss_data); + +	usb_bind_phy("musb-hdrc.0.auto", 0, "nop_usb_xceiv"); /* "tusb-usb-h1" */ + +	usb_musb_init(&musb_board_data); +      /* For handling interrupts from the accelerometer */      /* previous = jiffies; */ @@ -983,6 +1095,27 @@ static void __init omap3_h1_init(void)      /* omap3_acc_irq_init(omap3h1_i2c2_board_info[0].irq, (void *) &omap3h1_devices); */  } +static const char *omap3_h1_boards_compat[] __initdata = { +	"olio,omap3-h1", +	NULL, +}; + +DT_MACHINE_START(OMAP3_H1, "Olio OMAP3 H1 (Flattened Device Tree)") +    .atag_offset = 0x100, +	.reserve	= omap_reserve, +	.map_io		= omap3_map_io, +	.init_early	= omap3630_init_early, +	/* .init_irq		= omap3_init_irq, */ +    .init_irq	= omap_intc_of_init, +	.handle_irq	= omap3_intc_handle_irq, +	.init_machine	= omap3_h1_init, +	.init_late	= omap3630_init_late, +	.init_time	= omap3_secure_sync32k_timer_init, +	.dt_compat	= omap3_h1_boards_compat, +	.restart	= omap3xxx_restart, +MACHINE_END + +#if 0 /* removing ... for now */  MACHINE_START(OMAP3_H1, "Olio OMAP3 H1 Board")  	.atag_offset	= 0x100,  	.reserve		= omap_reserve, @@ -996,3 +1129,4 @@ MACHINE_START(OMAP3_H1, "Olio OMAP3 H1 Board")  	/* .dt_compat		= omap3_h1_boards_compat, */  	.restart		= omap3xxx_restart,  MACHINE_END +#endif |