| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 | 
							- /*
 
-  * Copyright 2012 Freescale Semiconductor, Inc.
 
-  * Copyright 2012 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 or later at the following locations:
 
-  *
 
-  * http://www.opensource.org/licenses/gpl-license.html
 
-  * http://www.gnu.org/copyleft/gpl.html
 
-  */
 
- #include <linux/clk.h>
 
- #include <linux/clkdev.h>
 
- #include <linux/can/platform/flexcan.h>
 
- #include <linux/delay.h>
 
- #include <linux/err.h>
 
- #include <linux/gpio.h>
 
- #include <linux/init.h>
 
- #include <linux/micrel_phy.h>
 
- #include <linux/mxsfb.h>
 
- #include <linux/of_platform.h>
 
- #include <linux/phy.h>
 
- #include <linux/pinctrl/consumer.h>
 
- #include <asm/mach/arch.h>
 
- #include <asm/mach/time.h>
 
- #include <mach/common.h>
 
- #include <mach/digctl.h>
 
- #include <mach/mxs.h>
 
- static struct fb_videomode mx23evk_video_modes[] = {
 
- 	{
 
- 		.name		= "Samsung-LMS430HF02",
 
- 		.refresh	= 60,
 
- 		.xres		= 480,
 
- 		.yres		= 272,
 
- 		.pixclock	= 108096, /* picosecond (9.2 MHz) */
 
- 		.left_margin	= 15,
 
- 		.right_margin	= 8,
 
- 		.upper_margin	= 12,
 
- 		.lower_margin	= 4,
 
- 		.hsync_len	= 1,
 
- 		.vsync_len	= 1,
 
- 		.sync		= FB_SYNC_DATA_ENABLE_HIGH_ACT |
 
- 				  FB_SYNC_DOTCLK_FAILING_ACT,
 
- 	},
 
- };
 
- static struct fb_videomode mx28evk_video_modes[] = {
 
- 	{
 
- 		.name		= "Seiko-43WVF1G",
 
- 		.refresh	= 60,
 
- 		.xres		= 800,
 
- 		.yres		= 480,
 
- 		.pixclock	= 29851, /* picosecond (33.5 MHz) */
 
- 		.left_margin	= 89,
 
- 		.right_margin	= 164,
 
- 		.upper_margin	= 23,
 
- 		.lower_margin	= 10,
 
- 		.hsync_len	= 10,
 
- 		.vsync_len	= 10,
 
- 		.sync		= FB_SYNC_DATA_ENABLE_HIGH_ACT |
 
- 				  FB_SYNC_DOTCLK_FAILING_ACT,
 
- 	},
 
- };
 
- static struct fb_videomode m28evk_video_modes[] = {
 
- 	{
 
- 		.name		= "Ampire AM-800480R2TMQW-T01H",
 
- 		.refresh	= 60,
 
- 		.xres		= 800,
 
- 		.yres		= 480,
 
- 		.pixclock	= 30066, /* picosecond (33.26 MHz) */
 
- 		.left_margin	= 0,
 
- 		.right_margin	= 256,
 
- 		.upper_margin	= 0,
 
- 		.lower_margin	= 45,
 
- 		.hsync_len	= 1,
 
- 		.vsync_len	= 1,
 
- 		.sync		= FB_SYNC_DATA_ENABLE_HIGH_ACT,
 
- 	},
 
- };
 
- static struct fb_videomode apx4devkit_video_modes[] = {
 
- 	{
 
- 		.name		= "HannStar PJ70112A",
 
- 		.refresh	= 60,
 
- 		.xres		= 800,
 
- 		.yres		= 480,
 
- 		.pixclock	= 33333, /* picosecond (30.00 MHz) */
 
- 		.left_margin	= 88,
 
- 		.right_margin	= 40,
 
- 		.upper_margin	= 32,
 
- 		.lower_margin	= 13,
 
- 		.hsync_len	= 48,
 
- 		.vsync_len	= 3,
 
- 		.sync		= FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT |
 
- 				  FB_SYNC_DATA_ENABLE_HIGH_ACT |
 
- 				  FB_SYNC_DOTCLK_FAILING_ACT,
 
- 	},
 
- };
 
- 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 |
 
- 				FB_SYNC_DATA_ENABLE_HIGH_ACT |
 
- 				FB_SYNC_DOTCLK_FAILING_ACT,
 
- 	},
 
- };
 
- static struct mxsfb_platform_data mxsfb_pdata __initdata;
 
- /*
 
-  * MX28EVK_FLEXCAN_SWITCH is shared between both flexcan controllers
 
-  */
 
- #define MX28EVK_FLEXCAN_SWITCH	MXS_GPIO_NR(2, 13)
 
- static int flexcan0_en, flexcan1_en;
 
- static void mx28evk_flexcan_switch(void)
 
- {
 
- 	if (flexcan0_en || flexcan1_en)
 
- 		gpio_set_value(MX28EVK_FLEXCAN_SWITCH, 1);
 
- 	else
 
- 		gpio_set_value(MX28EVK_FLEXCAN_SWITCH, 0);
 
- }
 
- static void mx28evk_flexcan0_switch(int enable)
 
- {
 
- 	flexcan0_en = enable;
 
- 	mx28evk_flexcan_switch();
 
- }
 
- static void mx28evk_flexcan1_switch(int enable)
 
- {
 
- 	flexcan1_en = enable;
 
- 	mx28evk_flexcan_switch();
 
- }
 
- static struct flexcan_platform_data flexcan_pdata[2];
 
- static struct of_dev_auxdata mxs_auxdata_lookup[] __initdata = {
 
- 	OF_DEV_AUXDATA("fsl,imx23-lcdif", 0x80030000, NULL, &mxsfb_pdata),
 
- 	OF_DEV_AUXDATA("fsl,imx28-lcdif", 0x80030000, NULL, &mxsfb_pdata),
 
- 	OF_DEV_AUXDATA("fsl,imx28-flexcan", 0x80032000, NULL, &flexcan_pdata[0]),
 
- 	OF_DEV_AUXDATA("fsl,imx28-flexcan", 0x80034000, NULL, &flexcan_pdata[1]),
 
- 	{ /* sentinel */ }
 
- };
 
- static void __init imx23_timer_init(void)
 
- {
 
- 	mx23_clocks_init();
 
- }
 
- static struct sys_timer imx23_timer = {
 
- 	.init = imx23_timer_init,
 
- };
 
- static void __init imx28_timer_init(void)
 
- {
 
- 	mx28_clocks_init();
 
- }
 
- static struct sys_timer imx28_timer = {
 
- 	.init = imx28_timer_init,
 
- };
 
- enum mac_oui {
 
- 	OUI_FSL,
 
- 	OUI_DENX,
 
- 	OUI_CRYSTALFONTZ,
 
- };
 
- static void __init update_fec_mac_prop(enum mac_oui oui)
 
- {
 
- 	struct device_node *np, *from = NULL;
 
- 	struct property *newmac;
 
- 	const u32 *ocotp = mxs_get_ocotp();
 
- 	u8 *macaddr;
 
- 	u32 val;
 
- 	int i;
 
 
  |