Search
SailfishOS Open Build Service
>
Projects
>
home:sledge
:
beagle
>
kernel-adaptation-dm3730
> 0028-board-medistream-fixed-USB-phy-reset.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File 0028-board-medistream-fixed-USB-phy-reset.patch of Package kernel-adaptation-dm3730
From b994fbed6f43b5290df78b4d8118be1fa2c45554 Mon Sep 17 00:00:00 2001 From: MediStream-Devel-VM <info@berlinux-solutions.de> Date: Mon, 18 Mar 2013 10:41:41 +0100 Subject: [PATCH] board-medistream: -fixed USB phy reset --- arch/arm/mach-omap2/Kconfig | 1 - arch/arm/mach-omap2/board-medistream.c | 119 +++++++------------------------- 2 files changed, 26 insertions(+), 94 deletions(-) diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index 9f9c9bc..6436e0f 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -201,7 +201,6 @@ config MACH_MEDISTREAM depends on ARCH_OMAP3 default y select OMAP_PACKAGE_CUS - select NET_POLL_CONTROLLER if SMSC911X config MACH_OMAP3517EVM bool "OMAP3517/ AM3517 EVM board" diff --git a/arch/arm/mach-omap2/board-medistream.c b/arch/arm/mach-omap2/board-medistream.c index 0191255..07b5c91 100644 --- a/arch/arm/mach-omap2/board-medistream.c +++ b/arch/arm/mach-omap2/board-medistream.c @@ -44,7 +44,7 @@ #include <asm/mach/arch.h> #include <asm/mach/map.h> -#include <plat/board.h> +#include <plat/clock.h> #include <plat/usb.h> #include <plat/mcspi.h> #include <plat/omap_device.h> @@ -72,14 +72,16 @@ static int __init early_parse_fbskip(char *p) { } early_param("fbskip", early_parse_fbskip); -#define MEDISTREAM_ETHR_START 0x2c000000 -#define MEDISTREAM_ETHR_SIZE 1024 #define MEDISTREAM_ETHR_GPIO_IRQ 29 +#define MEDISTREAM_ETHR_GPIO_RST 137 #define MEDISTREAM_SMSC911X_CS 5 #define MEDISTREAM_BUZZER_GPIO 138 #define MEDISTREAM_POWER_FEEDBACK_GPIO 41 +#define BEWATEC_PHY_RESET 24 + + enum { MEDISTREAM_BOARD_GEN_1 = 0, /* OMAP3530 */ MEDISTREAM_BOARD_GEN_2, /* DM3730 */ @@ -139,7 +141,7 @@ static struct mtd_partition medistream_nand_partitions[] = { static struct omap_smsc911x_platform_data smsc911x_cfg = { .cs = MEDISTREAM_SMSC911X_CS, .gpio_irq = MEDISTREAM_ETHR_GPIO_IRQ, - .gpio_reset = -EINVAL, + .gpio_reset = MEDISTREAM_ETHR_GPIO_RST, .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS, }; @@ -147,7 +149,6 @@ static inline void __init medistream_init_smsc911x(void) { gpmc_smsc911x_init(&smsc911x_cfg); } - #else static inline void __init medistream_init_smsc911x(void) { return; } #endif @@ -202,8 +203,9 @@ static struct gpio medistream_dss_gpios[] __initdata = { static int medistream_enable_lcd(struct omap_dss_device *dssdev) { - gpio_direction_output(MEDISTREAM_LED_ENABLE_GPIO, 0); gpio_direction_output(MEDISTREAM_LCD_ENABLE_GPIO, 1); + msleep(500); + gpio_direction_output(MEDISTREAM_LED_ENABLE_GPIO, 0); return 0; } @@ -294,17 +296,14 @@ static struct omap2_hsmmc_info mmc[] = { static int __init medistream_twl_gpio_setup(struct device *dev, unsigned gpio, unsigned ngpio) { - omap_mux_init_gpio(65, OMAP_PIN_INPUT); - /* gpio + 0 is "mmc0_cd" (input/IRQ) */ mmc[0].gpio_cd = gpio + 0; omap_hsmmc_late_init(mmc); -#if 0 - gpio_request_one(gpio + TWL4030_GPIO_MAX, - (medistream_version == MEDISTREAM_BOARD_GEN_2 ? GPIOF_OUT_INIT_HIGH : GPIOF_OUT_INIT_LOW), - "nEN_USB_PWR"); -#endif + gpio_request(gpio + TWL4030_GPIO_MAX, "nEN_USB_PWR"); /* USB HUB SMSC USB2514 GPIO*/ + gpio_direction_output(gpio + TWL4030_GPIO_MAX, 1); /*sets Trasistor basis of Q1 to Value 1 which results in LOW of USB HUB Reset Pin for RESET state */ + msleep(500); /*let a little time is always good!*/ + gpio_direction_output(gpio + TWL4030_GPIO_MAX, 0); /*sets Trasistor basis of Q1 to Value 0 which results in High of USB HUB Reset Pin for normal operation */ return 0; } @@ -313,7 +312,7 @@ static struct twl4030_gpio_platform_data medistream_gpio_data = { .gpio_base = OMAP_MAX_GPIO_LINES, .irq_base = TWL4030_GPIO_IRQ_BASE, .irq_end = TWL4030_GPIO_IRQ_END, - .use_leds = true, + .use_leds = false, .setup = medistream_twl_gpio_setup, }; @@ -367,14 +366,14 @@ static struct omap_board_config_kernel medistream_config[] __initdata = { static struct usbhs_omap_board_data usbhs_bdata __initdata = { - .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, //OMAP_USBHS_PORT_MODE_UNUSED, - .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED, //OMAP_EHCI_PORT_MODE_PHY, - .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, //OMAP_USBHS_PORT_MODE_UNUSED, + .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, + .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED, + .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, .phy_reset = true, /* PHY reset GPIO will be runtime programmed based on EVM version */ - .reset_gpio_port[0] = -EINVAL, + .reset_gpio_port[0] = BEWATEC_PHY_RESET, .reset_gpio_port[1] = -EINVAL, .reset_gpio_port[2] = -EINVAL }; @@ -425,53 +424,8 @@ static struct isp_platform_data medistream_isp_data = { NULL, NULL }; -static void __init medistream_opp_init(void) -{ - int r = 0; - - /* Initialize the omap3 opp table */ - if (omap3_opp_init()) { - pr_err("%s: opp default init failed\n", __func__); - return; - } - - /* Custom OPP enabled for all xM versions */ - if (medistream_version == MEDISTREAM_BOARD_GEN_2) { - struct device *mpu_dev, *iva_dev; - - mpu_dev = omap_device_get_by_hwmod_name("mpu"); - iva_dev = omap_device_get_by_hwmod_name("iva"); - - if (!mpu_dev || !iva_dev) { - pr_err("%s: Aiee.. no mpu/dsp devices? %p %p\n", - __func__, mpu_dev, iva_dev); - return; - } - /* Enable MPU 1GHz and lower opps */ - r = opp_enable(mpu_dev, 800000000); - /* TODO: MPU 1GHz needs SR and ABB */ - - /* Enable IVA 800MHz and lower opps */ - r |= opp_enable(iva_dev, 660000000); - /* TODO: DSP 800MHz needs SR and ABB */ - if (r) { - pr_err("%s: failed to enable higher opp %d\n", - __func__, r); - /* - * Cleanup - disable the higher freqs - we dont care - * about the results - */ - opp_disable(mpu_dev, 800000000); - opp_disable(iva_dev, 660000000); - } - } - return; -} - static void __init medistream_init(void) { - struct clk *dpll2_ck; - pm_power_off = medistream_poweroff; medistream_get_revision(); @@ -484,18 +438,24 @@ static void __init medistream_init(void) /* set powerfeedback pin to high */ gpio_request_one(MEDISTREAM_POWER_FEEDBACK_GPIO, GPIOF_OUT_INIT_HIGH, "power"); - /* pull up eth reset gpio */ - gpio_request_one(137, GPIOF_OUT_INIT_HIGH, "eth_rst"); + // USB phy Reset - omap_hsmmc_init(mmc); + gpio_direction_output(BEWATEC_PHY_RESET, 0); /*Phy in Reset Status*/ + gpio_set_value(BEWATEC_PHY_RESET, 0); + msleep(100); + gpio_direction_output(BEWATEC_PHY_RESET, 1); /*phy enter normal operation mode before USB init*/ + gpio_set_value(BEWATEC_PHY_RESET, 1); + omap_hsmmc_init(mmc); medistream_i2c_init(); omap_serial_init(); omap_sdrc_init(mt46h32m32lf6_sdrc_params, NULL); +#ifdef CONFIG_NOP_USB_XCEIV /* MEDISTREAM uses ISP1504 phy and so register nop transceiver */ usb_nop_xceiv_register(); +#endif usb_musb_init(&musb_board_data); usbhs_init(&usbhs_bdata); @@ -503,40 +463,13 @@ static void __init medistream_init(void) omap_nand_flash_init(NAND_BUSWIDTH_16, medistream_nand_partitions, ARRAY_SIZE(medistream_nand_partitions)); -#if 0 - /* Ensure SDRC pins are mux'd for self-refresh */ - omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); - omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); -#endif - medistream_init_smsc911x(); medistream_display_init(); - medistream_opp_init(); medistream_init_keys(); omap3_init_camera(&medistream_isp_data); - /* set dpll2_ck to 460MHz */ - dpll2_ck = clk_get(NULL, "dpll2_ck"); - if (!IS_ERR(dpll2_ck)) { - clk_set_rate(dpll2_ck, 460000000); - clk_enable(dpll2_ck); - } -} - -#if 0 -static void __init medistream_init_early(void) -{ - struct omap_hwmod *dss_core; - - omap3_init_early(); - - dss_core = omap_hwmod_lookup("dss_core"); - if(dss_core) { - omap_hwmod_no_setup_reset(dss_core); - } } -#endif MACHINE_START(MEDISTREAM, "Bewatec MediStream") /* Maintainer: Matthias Hardt - BerLinux Solutions GmbH */ -- 1.7.5.4