9
0
Fork 0

PCM038: Move USBH2 initialization to PCM970

Actually ISP1504 ULPI chip are installed on PCM970 development board.

Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Alexander Shiyan 2012-05-14 13:50:03 +04:00 committed by Sascha Hauer
parent c0237704c5
commit facb9da574
2 changed files with 50 additions and 40 deletions

View File

@ -37,7 +37,6 @@
#include <mach/imx-pll.h>
#include <mach/imxfb.h>
#include <i2c/i2c.h>
#include <usb/ulpi.h>
#include <mach/spi.h>
#include <mach/iomux-mx27.h>
#include <mach/devices-imx27.h>
@ -107,27 +106,6 @@ static struct imx_fb_platform_data pcm038_fb_data = {
.dmacr = 0x00020010,
};
#ifdef CONFIG_USB
static void pcm038_usbh_init(void)
{
uint32_t temp;
temp = readl(IMX_OTG_BASE + 0x600);
temp &= ~((3 << 21) | 1);
temp |= (1 << 5) | (1 << 16) | (1 << 19) | (1 << 20);
writel(temp, IMX_OTG_BASE + 0x600);
temp = readl(IMX_OTG_BASE + 0x584);
temp &= ~(3 << 30);
temp |= 2 << 30;
writel(temp, IMX_OTG_BASE + 0x584);
mdelay(10);
ulpi_setup((void *)(IMX_OTG_BASE + 0x570), 1);
}
#endif
/**
* The spctl0 register is a beast: Seems you can read it
* only one times without writing it again.
@ -260,19 +238,6 @@ static int pcm038_devices_init(void)
PA29_PF_VSYNC,
PA30_PF_CONTRAST,
PA31_PF_OE_ACD,
/* USB host 2 */
PA0_PF_USBH2_CLK,
PA1_PF_USBH2_DIR,
PA2_PF_USBH2_DATA7,
PA3_PF_USBH2_NXT,
PA4_PF_USBH2_STP,
PD19_AF_USBH2_DATA4,
PD20_AF_USBH2_DATA3,
PD21_AF_USBH2_DATA6,
PD22_AF_USBH2_DATA0,
PD23_AF_USBH2_DATA2,
PD24_AF_USBH2_DATA1,
PD26_AF_USBH2_DATA5,
/* I2C1 */
PD17_PF_I2C_DATA | GPIO_PUEN,
PD18_PF_I2C_CLK,
@ -310,11 +275,6 @@ static int pcm038_devices_init(void)
imx27_add_i2c0(NULL);
imx27_add_i2c1(NULL);
#ifdef CONFIG_USB
pcm038_usbh_init();
add_generic_usb_ehci_device(-1, IMX_OTG_BASE + 0x400, NULL);
#endif
/* Register the fec device after the PLL re-initialisation
* as the fec depends on the (now higher) ipg clock
*/

View File

@ -15,15 +15,65 @@
* MA 02111-1307 USA
*/
#include <common.h>
#include <io.h>
#include <init.h>
#include <mach/imx-regs.h>
#include <mach/iomux-mx27.h>
#include <mach/gpio.h>
#include <usb/ulpi.h>
#ifdef CONFIG_USB
static void pcm970_usbh2_init(void)
{
uint32_t temp;
temp = readl(IMX_OTG_BASE + 0x600);
temp &= ~((3 << 21) | 1);
temp |= (1 << 5) | (1 << 16) | (1 << 19) | (1 << 20);
writel(temp, IMX_OTG_BASE + 0x600);
temp = readl(IMX_OTG_BASE + 0x584);
temp &= ~(3 << 30);
temp |= 2 << 30;
writel(temp, IMX_OTG_BASE + 0x584);
mdelay(10);
if (!ulpi_setup((void *)(IMX_OTG_BASE + 0x570), 1))
add_generic_usb_ehci_device(-1, IMX_OTG_BASE + 0x400, NULL);
}
#endif
static int pcm970_init(void)
{
int i;
unsigned int mode[] = {
/* USB Host 2 */
PA0_PF_USBH2_CLK,
PA1_PF_USBH2_DIR,
PA2_PF_USBH2_DATA7,
PA3_PF_USBH2_NXT,
PA4_PF_USBH2_STP,
PD19_AF_USBH2_DATA4,
PD20_AF_USBH2_DATA3,
PD21_AF_USBH2_DATA6,
PD22_AF_USBH2_DATA0,
PD23_AF_USBH2_DATA2,
PD24_AF_USBH2_DATA1,
PD26_AF_USBH2_DATA5,
};
for (i = 0; i < ARRAY_SIZE(mode); i++)
imx_gpio_mode(mode[i]);
/* Configure SJA1000 on cs4 */
imx27_setup_weimcs(4, 0x0000DCF6, 0x444A0301, 0x44443302);
#ifdef CONFIG_USB
pcm970_usbh2_init();
#endif
return 0;
}