1 From f658ecfa1294ec653afde9deb6ebedb1fe7d1afd Mon Sep 17 00:00:00 2001
2 From: Fabio Estevam <festevam@gmail.com>
3 Date: Mon, 30 Apr 2012 08:12:04 +0000
4 Subject: [PATCH 19/56] mx53loco: Add support for 1GHz operation for
7 There are two types of mx53loco boards: initial boards were built with a Dialog
8 DA9053 PMIC and more recent version is based on a Freescale MC34708 PMIC.
10 Add DA9053 PMIC support and adjust the required voltages and clocks for running
13 Tested on both versions of mx53loco boards.
15 In the case of a MC34708-based board the CPU operating voltage remains at 800MHz.
17 Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
18 Acked-by : Stefano Babic <sbabic@denx.de>
20 board/freescale/mx53loco/mx53loco.c | 71 +++++++++++++++++++++++++++++++++++
21 include/configs/mx53loco.h | 14 +++++++
22 2 files changed, 85 insertions(+)
24 diff --git a/board/freescale/mx53loco/mx53loco.c b/board/freescale/mx53loco/mx53loco.c
25 index 46aaeb2..0dcec9b 100644
26 --- a/board/freescale/mx53loco/mx53loco.c
27 +++ b/board/freescale/mx53loco/mx53loco.c
30 #include <fsl_esdhc.h>
33 +#include <dialog_pmic.h>
35 DECLARE_GLOBAL_DATA_PTR;
37 @@ -291,6 +293,71 @@ int board_mmc_init(bd_t *bis)
41 +static void setup_iomux_i2c(void)
44 + mxc_request_iomux(MX53_PIN_CSI0_D8,
45 + IOMUX_CONFIG_ALT5 | IOMUX_CONFIG_SION);
46 + mxc_iomux_set_input(MX53_I2C1_IPP_SDA_IN_SELECT_INPUT,
48 + mxc_iomux_set_pad(MX53_PIN_CSI0_D8,
49 + PAD_CTL_SRE_FAST | PAD_CTL_DRV_HIGH |
50 + PAD_CTL_100K_PU | PAD_CTL_PKE_ENABLE |
52 + PAD_CTL_ODE_OPENDRAIN_ENABLE);
54 + mxc_request_iomux(MX53_PIN_CSI0_D9,
55 + IOMUX_CONFIG_ALT5 | IOMUX_CONFIG_SION);
56 + mxc_iomux_set_input(MX53_I2C1_IPP_SCL_IN_SELECT_INPUT,
58 + mxc_iomux_set_pad(MX53_PIN_CSI0_D9,
59 + PAD_CTL_SRE_FAST | PAD_CTL_DRV_HIGH |
60 + PAD_CTL_100K_PU | PAD_CTL_PKE_ENABLE |
62 + PAD_CTL_ODE_OPENDRAIN_ENABLE);
65 +static int power_init(void)
67 + unsigned int val, ret;
73 + /* Set VDDA to 1.25V */
74 + val = DA9052_BUCKCORE_BCOREEN | DA_BUCKCORE_VBCORE_1_250V;
75 + ret = pmic_reg_write(p, DA9053_BUCKCORE_REG, val);
77 + ret |= pmic_reg_read(p, DA9053_SUPPLY_REG, &val);
78 + val |= DA9052_SUPPLY_VBCOREGO;
79 + ret |= pmic_reg_write(p, DA9053_SUPPLY_REG, val);
81 + /* Set Vcc peripheral to 1.35V */
82 + ret |= pmic_reg_write(p, DA9053_BUCKPRO_REG, 0x62);
83 + ret |= pmic_reg_write(p, DA9053_SUPPLY_REG, 0x62);
88 +static void clock_1GHz(void)
91 + u32 ref_clk = CONFIG_SYS_MX5_HCLK;
93 + * After increasing voltage to 1.25V, we can switch
94 + * CPU clock to 1GHz and DDR to 400MHz safely
96 + ret = mxc_set_clock(ref_clk, 1000, MXC_ARM_CLK);
98 + printf("CPU: Switch CPU clock to 1GHZ failed\n");
100 + ret = mxc_set_clock(ref_clk, 400, MXC_PERIPH_CLK);
101 + ret |= mxc_set_clock(ref_clk, 400, MXC_DDR_CLK);
103 + printf("CPU: Switch DDR clock to 400MHz failed\n");
106 int board_early_init_f(void)
109 @@ -316,7 +383,11 @@ int print_cpuinfo(void)
110 #ifdef CONFIG_BOARD_LATE_INIT
111 int board_late_init(void)
121 diff --git a/include/configs/mx53loco.h b/include/configs/mx53loco.h
122 index 0778bde..8f43eec 100644
123 --- a/include/configs/mx53loco.h
124 +++ b/include/configs/mx53loco.h
126 #define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2 * 1024 * 1024)
128 #define CONFIG_BOARD_EARLY_INIT_F
129 +#define CONFIG_BOARD_LATE_INIT
130 #define CONFIG_MXC_GPIO
132 #define CONFIG_MXC_UART
134 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
135 #define CONFIG_MXC_USB_FLAGS 0
138 +#define CONFIG_HARD_I2C
139 +#define CONFIG_I2C_MXC
140 +#define CONFIG_SYS_I2C_MX53_PORT1
141 +#define CONFIG_SYS_I2C_SPEED 100000
142 +#define CONFIG_SYS_I2C_SLAVE 0xfe
144 +/* PMIC Controller */
146 +#define CONFIG_PMIC_I2C
147 +#define CONFIG_DIALOG_PMIC
148 +#define CONFIG_SYS_DIALOG_PMIC_I2C_ADDR 0x48
150 /* allow to overwrite serial and ethaddr */
151 #define CONFIG_ENV_OVERWRITE
152 #define CONFIG_CONS_INDEX 1