Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Fabio Estevam | 5ffd3c5 | 2011-12-20 05:46:34 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Freescale MX28EVK board |
| 4 | * |
| 5 | * (C) Copyright 2011 Freescale Semiconductor, Inc. |
| 6 | * |
| 7 | * Author: Fabio Estevam <fabio.estevam@freescale.com> |
| 8 | * |
| 9 | * Based on m28evk.c: |
| 10 | * Copyright (C) 2011 Marek Vasut <marek.vasut@gmail.com> |
| 11 | * on behalf of DENX Software Engineering GmbH |
Fabio Estevam | 5ffd3c5 | 2011-12-20 05:46:34 +0000 | [diff] [blame] | 12 | */ |
| 13 | |
| 14 | #include <common.h> |
Simon Glass | 9758973 | 2020-05-10 11:40:02 -0600 | [diff] [blame] | 15 | #include <init.h> |
Simon Glass | 274e0b0 | 2020-05-10 11:39:56 -0600 | [diff] [blame] | 16 | #include <net.h> |
Simon Glass | 3ba929a | 2020-10-30 21:38:53 -0600 | [diff] [blame] | 17 | #include <asm/global_data.h> |
Fabio Estevam | 5ffd3c5 | 2011-12-20 05:46:34 +0000 | [diff] [blame] | 18 | #include <asm/gpio.h> |
| 19 | #include <asm/io.h> |
| 20 | #include <asm/arch/imx-regs.h> |
| 21 | #include <asm/arch/iomux-mx28.h> |
| 22 | #include <asm/arch/clock.h> |
| 23 | #include <asm/arch/sys_proto.h> |
Simon Glass | dbd7954 | 2020-05-10 11:40:11 -0600 | [diff] [blame] | 24 | #include <linux/delay.h> |
Fabio Estevam | 5ffd3c5 | 2011-12-20 05:46:34 +0000 | [diff] [blame] | 25 | #include <linux/mii.h> |
| 26 | #include <miiphy.h> |
| 27 | #include <netdev.h> |
| 28 | #include <errno.h> |
| 29 | |
| 30 | DECLARE_GLOBAL_DATA_PTR; |
| 31 | |
| 32 | /* |
| 33 | * Functions |
| 34 | */ |
| 35 | int board_early_init_f(void) |
| 36 | { |
| 37 | /* IO0 clock at 480MHz */ |
Otavio Salvador | 2906f94 | 2013-01-11 03:19:03 +0000 | [diff] [blame] | 38 | mxs_set_ioclk(MXC_IOCLK0, 480000); |
Fabio Estevam | 5ffd3c5 | 2011-12-20 05:46:34 +0000 | [diff] [blame] | 39 | /* IO1 clock at 480MHz */ |
Otavio Salvador | 2906f94 | 2013-01-11 03:19:03 +0000 | [diff] [blame] | 40 | mxs_set_ioclk(MXC_IOCLK1, 480000); |
Fabio Estevam | 5ffd3c5 | 2011-12-20 05:46:34 +0000 | [diff] [blame] | 41 | |
| 42 | /* SSP0 clock at 96MHz */ |
Otavio Salvador | 2906f94 | 2013-01-11 03:19:03 +0000 | [diff] [blame] | 43 | mxs_set_sspclk(MXC_SSPCLK0, 96000, 0); |
Otavio Salvador | 22ff894 | 2012-08-27 23:56:40 +0000 | [diff] [blame] | 44 | /* SSP2 clock at 160MHz */ |
Otavio Salvador | 2906f94 | 2013-01-11 03:19:03 +0000 | [diff] [blame] | 45 | mxs_set_sspclk(MXC_SSPCLK2, 160000, 0); |
Fabio Estevam | 5ffd3c5 | 2011-12-20 05:46:34 +0000 | [diff] [blame] | 46 | |
Matthias Fuchs | ce575c4 | 2012-01-18 01:33:08 +0000 | [diff] [blame] | 47 | #ifdef CONFIG_CMD_USB |
| 48 | mxs_iomux_setup_pad(MX28_PAD_SSP2_SS1__USB1_OVERCURRENT); |
| 49 | mxs_iomux_setup_pad(MX28_PAD_AUART2_RX__GPIO_3_8 | |
| 50 | MXS_PAD_4MA | MXS_PAD_3V3 | MXS_PAD_NOPULL); |
| 51 | gpio_direction_output(MX28_PAD_AUART2_RX__GPIO_3_8, 1); |
| 52 | #endif |
| 53 | |
Fabio Estevam | 9f95ce2 | 2013-05-10 09:14:09 +0000 | [diff] [blame] | 54 | /* Power on LCD */ |
| 55 | gpio_direction_output(MX28_PAD_LCD_RESET__GPIO_3_30, 1); |
| 56 | |
| 57 | /* Set contrast to maximum */ |
| 58 | gpio_direction_output(MX28_PAD_PWM2__GPIO_3_18, 1); |
| 59 | |
Fabio Estevam | 5ffd3c5 | 2011-12-20 05:46:34 +0000 | [diff] [blame] | 60 | return 0; |
| 61 | } |
| 62 | |
| 63 | int dram_init(void) |
| 64 | { |
Otavio Salvador | a2bbe0c | 2012-08-19 04:58:30 +0000 | [diff] [blame] | 65 | return mxs_dram_init(); |
Fabio Estevam | 5ffd3c5 | 2011-12-20 05:46:34 +0000 | [diff] [blame] | 66 | } |
| 67 | |
| 68 | int board_init(void) |
| 69 | { |
| 70 | /* Adress of boot parameters */ |
| 71 | gd->bd->bi_boot_params = PHYS_SDRAM_1 + 0x100; |
| 72 | |
| 73 | return 0; |
| 74 | } |