mx23_olinuxino.c 1.3 KB
Newer Older
1
// SPDX-License-Identifier: GPL-2.0+
2 3 4 5 6 7 8
/*
 * Olimex MX23 Olinuxino board
 *
 * Copyright (C) 2013 Marek Vasut <marex@denx.de>
 */

#include <common.h>
9
#include <init.h>
10
#include <asm/global_data.h>
11
#include <asm/gpio.h>
12 13
#include <asm/io.h>
#include <asm/arch/iomux-mx23.h>
14
#include <asm/arch/imx-regs.h>
15
#include <asm/arch/clock.h>
16
#include <asm/arch/sys_proto.h>
U
Uri Mashiach 已提交
17
#ifdef CONFIG_LED_STATUS
18 19
#include <status_led.h>
#endif
20
#include <linux/delay.h>
21 22 23 24 25 26 27 28

DECLARE_GLOBAL_DATA_PTR;

/*
 * Functions
 */
int board_early_init_f(void)
{
29 30 31 32 33 34
	/* IO0 clock at 480MHz */
	mxs_set_ioclk(MXC_IOCLK0, 480000);

	/* SSP0 clock at 96MHz */
	mxs_set_sspclk(MXC_SSPCLK0, 96000, 0);

35 36 37
	return 0;
}

38
#ifdef CONFIG_CMD_USB
39 40 41
int board_ehci_hcd_init(int port)
{
	/* Enable LAN9512 (Maxi) or GL850G (Mini) USB HUB power. */
42
	gpio_direction_output(MX23_PAD_GPMI_ALE__GPIO_0_17, 1);
43 44 45
	udelay(100);
	return 0;
}
46

47 48 49 50
int board_ehci_hcd_exit(int port)
{
	/* Enable LAN9512 (Maxi) or GL850G (Mini) USB HUB power. */
	gpio_direction_output(MX23_PAD_GPMI_ALE__GPIO_0_17, 0);
51 52
	return 0;
}
53
#endif
54 55 56 57 58 59 60 61 62 63 64

int dram_init(void)
{
	return mxs_dram_init();
}

int board_init(void)
{
	/* Adress of boot parameters */
	gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100;

U
Uri Mashiach 已提交
65 66
#if defined(CONFIG_LED_STATUS) && defined(CONFIG_LED_STATUS_BOOT_ENABLE)
	status_led_set(CONFIG_LED_STATUS_BOOT, CONFIG_LED_STATUS_STATE);
67 68
#endif

69 70
	return 0;
}