From patchwork Thu Aug 1 22:18:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 264123 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 4609B2C0090 for ; Fri, 2 Aug 2013 08:20:57 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1FB5E4A050; Fri, 2 Aug 2013 00:20:46 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Zqdc7wRcZlH9; Fri, 2 Aug 2013 00:20:45 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3FEA74A051; Fri, 2 Aug 2013 00:19:46 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 028034A01F for ; Fri, 2 Aug 2013 00:19:43 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id viTGL32-KOYC for ; Fri, 2 Aug 2013 00:19:38 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by theia.denx.de (Postfix) with ESMTPS id 580544A020 for ; Fri, 2 Aug 2013 00:19:26 +0200 (CEST) Received: by mail-pd0-f175.google.com with SMTP id 5so2480051pdd.20 for ; Thu, 01 Aug 2013 15:19:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=/1V19BOhWe36nhgBBel2OgAVHSQImL8SmttoutdCMCY=; b=Ru0QSE8ucVjmxjoWpwMfubQSA0w3toyYsTqCjcyhdtV+xgHHr8BuKA19j3zUefQOIM OKR1IufcMRsR7YpkdReABtst6tBX9yMRVb9iJRwxEDHeu6DRxnTjN7lJJNcNbnsGW3Ex FO9p/DxWRdJwCcBxCSJ4WFOCke/1oVyuoCtxHBIkkDN6eBlpzgixmfqBIUIT06iSLzSM F10ZnUEj1OKxX3yZ1oKgcaIGhMMk73GXTSKNFuykcWSLhzxI5ubRPMbq7DrujPfXNQVx waeiTyMl1rSuMNgk1aNAEUiKUBjwzh8Gh5tRbLBiwvWsGQS8FQJugnZgbHIuCgLxA+wE NAhQ== X-Received: by 10.68.34.97 with SMTP id y1mr4208178pbi.198.1375395564661; Thu, 01 Aug 2013 15:19:24 -0700 (PDT) Received: from officeserver-2 ([70.96.116.236]) by mx.google.com with ESMTPSA id w8sm3196984paj.4.2013.08.01.15.19.22 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 01 Aug 2013 15:19:23 -0700 (PDT) Received: from tkisky by officeserver-2 with local (Exim 4.80) (envelope-from ) id 1V51DM-0004qp-Bn; Thu, 01 Aug 2013 15:19:20 -0700 From: Troy Kisky To: marek.vasut@gmail.com Date: Thu, 1 Aug 2013 15:18:20 -0700 Message-Id: <1375395521-18569-4-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1375395521-18569-1-git-send-email-troy.kisky@boundarydevices.com> References: <1375395521-18569-1-git-send-email-troy.kisky@boundarydevices.com> X-Gm-Message-State: ALoCoQkynAWe7Ip6743K/jU5xcT640z2OWR/6Y1TWe4KEtBSiRkeRGuwni8PZW5BRK6AnQV7HF4g Cc: fabio.estevam@freescale.com, otavio@ossystems.com.br, leiwen@marvell.com, u-boot@lists.denx.de Subject: [U-Boot] [PATCH V2 03/20] nitrogen6x: add otg usb ethernet gadget support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Troy Kisky --- board/boundary/nitrogen6x/nitrogen6x.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/board/boundary/nitrogen6x/nitrogen6x.c b/board/boundary/nitrogen6x/nitrogen6x.c index 1a29b6f..eedcd77 100644 --- a/board/boundary/nitrogen6x/nitrogen6x.c +++ b/board/boundary/nitrogen6x/nitrogen6x.c @@ -30,6 +30,7 @@ #include DECLARE_GLOBAL_DATA_PTR; +#define GP_USB_OTG_PWR IMX_GPIO_NR(3, 22) #define UART_PAD_CTRL (PAD_CTL_PUS_100K_UP | \ PAD_CTL_SPEED_MED | PAD_CTL_DSE_40ohm | \ @@ -369,6 +370,13 @@ int board_eth_init(bd_t *bis) free(bus); } #endif + +#ifdef CONFIG_MV_UDC + otg_enable(); + + /* For otg ethernet*/ + usb_eth_initialize(bis); +#endif return 0; } @@ -717,6 +725,7 @@ int board_early_init_f(void) gpio_direction_input(WL12XX_WL_IRQ_GP); gpio_direction_output(WL12XX_WL_ENABLE_GP, 0); gpio_direction_output(WL12XX_BT_ENABLE_GP, 0); + gpio_direction_output(GP_USB_OTG_PWR, 0); /* OTG power off */ imx_iomux_v3_setup_multiple_pads(wl12xx_pads, ARRAY_SIZE(wl12xx_pads)); setup_buttons(); @@ -738,6 +747,13 @@ int overwrite_console(void) int board_init(void) { + struct iomuxc_base_regs *const iomuxc_regs + = (struct iomuxc_base_regs *)IOMUXC_BASE_ADDR; + + clrsetbits_le32(&iomuxc_regs->gpr[1], + IOMUXC_GPR1_OTG_ID_MASK, + IOMUXC_GPR1_OTG_ID_GPIO1); + /* address of boot parameters */ gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;