From patchwork Sat May 21 10:16:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Salveti X-Patchwork-Id: 1579 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:53:16 -0000 Delivered-To: patches@linaro.org Received: by 10.224.54.134 with SMTP id q6cs10302qag; Sat, 21 May 2011 03:17:07 -0700 (PDT) Received: by 10.236.175.2 with SMTP id y2mr537307yhl.490.1305973026866; Sat, 21 May 2011 03:17:06 -0700 (PDT) Received: from mail-gy0-f178.google.com (mail-gy0-f178.google.com [209.85.160.178]) by mx.google.com with ESMTPS id j2si787732yha.157.2011.05.21.03.17.05 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 21 May 2011 03:17:05 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.178 is neither permitted nor denied by best guess record for domain of ricardo.salveti@linaro.org) client-ip=209.85.160.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.178 is neither permitted nor denied by best guess record for domain of ricardo.salveti@linaro.org) smtp.mail=ricardo.salveti@linaro.org Received: by gyd12 with SMTP id 12so1903925gyd.37 for ; Sat, 21 May 2011 03:17:05 -0700 (PDT) Received: by 10.150.113.21 with SMTP id l21mr1175596ybc.259.1305973022005; Sat, 21 May 2011 03:17:02 -0700 (PDT) Received: from localhost.localdomain ([201.82.68.153]) by mx.google.com with ESMTPS id w19sm514739ybe.25.2011.05.21.03.16.59 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 21 May 2011 03:17:01 -0700 (PDT) From: Ricardo Salveti de Araujo To: x-loader@googlegroups.com Cc: patches@linaro.org, Ricardo Salveti de Araujo Subject: [PATCH] omap4: pandaboard: ehci fref_clkout per board revision Date: Sat, 21 May 2011 07:16:42 -0300 Message-Id: <1305973002-28352-1-git-send-email-ricardo.salveti@linaro.org> X-Mailer: git-send-email 1.7.4.1 Add support for correctly configuring the fref_clkout depending on the board revision of the pandaboard. This patch is necessary to make u-boot work with the smsc usb+ethernet driver. Based on patch from David Anders from omap4_panda_L24.9 branch at gitorious.org/pandaboard x-loader tree. Signed-off-by: Ricardo Salveti de Araujo --- board/omap4430panda/omap4430panda.c | 30 ++++++++++++++++++++++++++---- 1 files changed, 26 insertions(+), 4 deletions(-) diff --git a/board/omap4430panda/omap4430panda.c b/board/omap4430panda/omap4430panda.c index 962820b..c76ad17 100644 --- a/board/omap4430panda/omap4430panda.c +++ b/board/omap4430panda/omap4430panda.c @@ -531,6 +531,7 @@ static void ddr_init(void) *****************************************/ int board_init(void) { + unsigned int rev = omap_revision(); unsigned int v; /* @@ -546,10 +547,31 @@ int board_init(void) v = __raw_readl(OMAP44XX_GPIO_BASE2 + __GPIO_DATAOUT); __raw_writel((v & ~(1 << 30)), OMAP44XX_GPIO_BASE2 + __GPIO_DATAOUT); - /* kill USB PLL */ - - v = __raw_readl(CM_CLKMODE_DPLL_USB); - __raw_writel((v & ~7) | 1, CM_CLKMODE_DPLL_USB); + if (rev != OMAP4430_ES1_0) { + if (__raw_readl(0x4805D138) & (1<<22)) { + /* enable software ioreq */ + sr32(0x4A30a31C, 8, 1, 0x1); + /* set for sys_clk (38.4MHz) */ + sr32(0x4A30a31C, 1, 2, 0x0); + /* set divisor to 2 */ + sr32(0x4A30a31C, 16, 4, 0x1); + /* set the clock source to active */ + sr32(0x4A30a110, 0, 1, 0x1); + /* enable clocks */ + sr32(0x4A30a110, 2, 2, 0x3); + } else { + /* enable software ioreq */ + sr32(0x4A30a314, 8, 1, 0x1); + /* set for PER_DPLL */ + sr32(0x4A30a314, 1, 2, 0x2); + /* set divisor to 16 */ + sr32(0x4A30a314, 16, 4, 0xf); + /* set the clock source to active */ + sr32(0x4A30a110, 0, 1, 0x1); + /* enable clocks */ + sr32(0x4A30a110, 2, 2, 0x3); + } + } return 0; }