Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Hannes Petermaier | 893c04e | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 2 | /* |
| 3 | * common.c |
| 4 | * |
| 5 | * common board functions for B&R boards |
| 6 | * |
Hannes Schmelzer | 4c302b9 | 2015-05-28 15:41:12 +0200 | [diff] [blame] | 7 | * Copyright (C) 2013 Hannes Schmelzer <oe5hpm@oevsv.at> |
Hannes Petermaier | 893c04e | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 8 | * Bernecker & Rainer Industrieelektronik GmbH - http://www.br-automation.com |
| 9 | * |
Hannes Petermaier | 893c04e | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 10 | */ |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 11 | #include <version.h> |
Hannes Petermaier | 893c04e | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 12 | #include <common.h> |
Hannes Schmelzer | ad6be25 | 2019-04-10 14:13:11 +0200 | [diff] [blame] | 13 | #include <fdtdec.h> |
Hannes Petermaier | 893c04e | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 14 | #include <i2c.h> |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 15 | #include <lcd.h> |
Hannes Petermaier | 893c04e | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 16 | #include "bur_common.h" |
| 17 | |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 18 | DECLARE_GLOBAL_DATA_PTR; |
| 19 | |
Hannes Petermaier | 893c04e | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 20 | /* --------------------------------------------------------------------------*/ |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 21 | #if defined(CONFIG_LCD) && defined(CONFIG_AM335X_LCD) && \ |
| 22 | !defined(CONFIG_SPL_BUILD) |
Hannes Schmelzer | ad6be25 | 2019-04-10 14:13:11 +0200 | [diff] [blame] | 23 | #include <asm/arch/hardware.h> |
| 24 | #include <asm/arch/cpu.h> |
| 25 | #include <asm/gpio.h> |
| 26 | #include <power/tps65217.h> |
| 27 | #include "../../../drivers/video/am335x-fb.h" |
| 28 | |
Hannes Petermaier | 99f7247 | 2015-04-24 14:49:37 +0200 | [diff] [blame] | 29 | void lcdbacklight(int on) |
| 30 | { |
Simon Glass | bfebc8c | 2017-08-03 12:22:13 -0600 | [diff] [blame] | 31 | unsigned int driver = env_get_ulong("ds1_bright_drv", 16, 0UL); |
| 32 | unsigned int bright = env_get_ulong("ds1_bright_def", 10, 50); |
| 33 | unsigned int pwmfrq = env_get_ulong("ds1_pwmfreq", 10, ~0UL); |
Hannes Petermaier | 99f7247 | 2015-04-24 14:49:37 +0200 | [diff] [blame] | 34 | unsigned int tmp; |
Hannes Petermaier | 9b63ba3 | 2015-06-11 12:25:43 +0200 | [diff] [blame] | 35 | struct gptimer *timerhw; |
Hannes Petermaier | 99f7247 | 2015-04-24 14:49:37 +0200 | [diff] [blame] | 36 | |
| 37 | if (on) |
| 38 | bright = bright != ~0UL ? bright : 50; |
| 39 | else |
| 40 | bright = 0; |
| 41 | |
| 42 | switch (driver) { |
Hannes Petermaier | 9b63ba3 | 2015-06-11 12:25:43 +0200 | [diff] [blame] | 43 | case 2: |
| 44 | timerhw = (struct gptimer *)DM_TIMER5_BASE; |
| 45 | break; |
| 46 | default: |
| 47 | timerhw = (struct gptimer *)DM_TIMER6_BASE; |
| 48 | } |
| 49 | |
| 50 | switch (driver) { |
Hannes Petermaier | 99f7247 | 2015-04-24 14:49:37 +0200 | [diff] [blame] | 51 | case 0: /* PMIC LED-Driver */ |
| 52 | /* brightness level */ |
| 53 | tps65217_reg_write(TPS65217_PROT_LEVEL_NONE, |
| 54 | TPS65217_WLEDCTRL2, bright, 0xFF); |
| 55 | /* current sink */ |
| 56 | tps65217_reg_write(TPS65217_PROT_LEVEL_NONE, |
| 57 | TPS65217_WLEDCTRL1, |
| 58 | bright != 0 ? 0x0A : 0x02, |
| 59 | 0xFF); |
| 60 | break; |
Hannes Petermaier | 9b63ba3 | 2015-06-11 12:25:43 +0200 | [diff] [blame] | 61 | case 1: |
| 62 | case 2: /* PWM using timer */ |
Hannes Petermaier | 99f7247 | 2015-04-24 14:49:37 +0200 | [diff] [blame] | 63 | if (pwmfrq != ~0UL) { |
| 64 | timerhw->tiocp_cfg = TCFG_RESET; |
| 65 | udelay(10); |
| 66 | while (timerhw->tiocp_cfg & TCFG_RESET) |
| 67 | ; |
| 68 | tmp = ~0UL-(V_OSCK/pwmfrq); /* bottom value */ |
| 69 | timerhw->tldr = tmp; |
| 70 | timerhw->tcrr = tmp; |
| 71 | tmp = tmp + ((V_OSCK/pwmfrq)/100) * bright; |
| 72 | timerhw->tmar = tmp; |
| 73 | timerhw->tclr = (TCLR_PT | (2 << TCLR_TRG_SHIFT) | |
| 74 | TCLR_CE | TCLR_AR | TCLR_ST); |
| 75 | } else { |
| 76 | puts("invalid pwmfrq in env/dtb! skip PWM-setup.\n"); |
| 77 | } |
| 78 | break; |
| 79 | default: |
| 80 | puts("no suitable backlightdriver in env/dtb!\n"); |
| 81 | break; |
| 82 | } |
| 83 | } |
| 84 | |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 85 | int load_lcdtiming(struct am335x_lcdpanel *panel) |
| 86 | { |
| 87 | struct am335x_lcdpanel pnltmp; |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 88 | |
Simon Glass | bfebc8c | 2017-08-03 12:22:13 -0600 | [diff] [blame] | 89 | pnltmp.hactive = env_get_ulong("ds1_hactive", 10, ~0UL); |
| 90 | pnltmp.vactive = env_get_ulong("ds1_vactive", 10, ~0UL); |
| 91 | pnltmp.bpp = env_get_ulong("ds1_bpp", 10, ~0UL); |
| 92 | pnltmp.hfp = env_get_ulong("ds1_hfp", 10, ~0UL); |
| 93 | pnltmp.hbp = env_get_ulong("ds1_hbp", 10, ~0UL); |
| 94 | pnltmp.hsw = env_get_ulong("ds1_hsw", 10, ~0UL); |
| 95 | pnltmp.vfp = env_get_ulong("ds1_vfp", 10, ~0UL); |
| 96 | pnltmp.vbp = env_get_ulong("ds1_vbp", 10, ~0UL); |
| 97 | pnltmp.vsw = env_get_ulong("ds1_vsw", 10, ~0UL); |
Hannes Schmelzer | 0fcec57 | 2018-01-09 19:01:35 +0100 | [diff] [blame] | 98 | pnltmp.pxl_clk = env_get_ulong("ds1_pxlclk", 10, ~0UL); |
Simon Glass | bfebc8c | 2017-08-03 12:22:13 -0600 | [diff] [blame] | 99 | pnltmp.pol = env_get_ulong("ds1_pol", 16, ~0UL); |
| 100 | pnltmp.pup_delay = env_get_ulong("ds1_pupdelay", 10, ~0UL); |
| 101 | pnltmp.pon_delay = env_get_ulong("ds1_tondelay", 10, ~0UL); |
| 102 | panel_info.vl_rot = env_get_ulong("ds1_rotation", 10, 0); |
Hannes Schmelzer | e31fb4d | 2018-07-06 15:41:18 +0200 | [diff] [blame] | 103 | |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 104 | if ( |
| 105 | ~0UL == (pnltmp.hactive) || |
| 106 | ~0UL == (pnltmp.vactive) || |
| 107 | ~0UL == (pnltmp.bpp) || |
| 108 | ~0UL == (pnltmp.hfp) || |
| 109 | ~0UL == (pnltmp.hbp) || |
| 110 | ~0UL == (pnltmp.hsw) || |
| 111 | ~0UL == (pnltmp.vfp) || |
| 112 | ~0UL == (pnltmp.vbp) || |
| 113 | ~0UL == (pnltmp.vsw) || |
Hannes Schmelzer | 0fcec57 | 2018-01-09 19:01:35 +0100 | [diff] [blame] | 114 | ~0UL == (pnltmp.pxl_clk) || |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 115 | ~0UL == (pnltmp.pol) || |
| 116 | ~0UL == (pnltmp.pup_delay) || |
| 117 | ~0UL == (pnltmp.pon_delay) |
| 118 | ) { |
| 119 | puts("lcd-settings in env/dtb incomplete!\n"); |
| 120 | printf("display-timings:\n" |
| 121 | "================\n" |
| 122 | "hactive: %d\n" |
| 123 | "vactive: %d\n" |
| 124 | "bpp : %d\n" |
| 125 | "hfp : %d\n" |
| 126 | "hbp : %d\n" |
| 127 | "hsw : %d\n" |
| 128 | "vfp : %d\n" |
| 129 | "vbp : %d\n" |
| 130 | "vsw : %d\n" |
| 131 | "pxlclk : %d\n" |
| 132 | "pol : 0x%08x\n" |
| 133 | "pondly : %d\n", |
| 134 | pnltmp.hactive, pnltmp.vactive, pnltmp.bpp, |
| 135 | pnltmp.hfp, pnltmp.hbp, pnltmp.hsw, |
| 136 | pnltmp.vfp, pnltmp.vbp, pnltmp.vsw, |
Hannes Schmelzer | 0fcec57 | 2018-01-09 19:01:35 +0100 | [diff] [blame] | 137 | pnltmp.pxl_clk, pnltmp.pol, pnltmp.pon_delay); |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 138 | |
| 139 | return -1; |
| 140 | } |
| 141 | debug("lcd-settings in env complete, taking over.\n"); |
| 142 | memcpy((void *)panel, |
| 143 | (void *)&pnltmp, |
| 144 | sizeof(struct am335x_lcdpanel)); |
| 145 | |
| 146 | return 0; |
| 147 | } |
| 148 | |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 149 | static void br_summaryscreen_printenv(char *prefix, |
| 150 | char *name, char *altname, |
| 151 | char *suffix) |
| 152 | { |
Simon Glass | 00caae6 | 2017-08-03 12:22:12 -0600 | [diff] [blame] | 153 | char *envval = env_get(name); |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 154 | if (0 != envval) { |
| 155 | lcd_printf("%s %s %s", prefix, envval, suffix); |
| 156 | } else if (0 != altname) { |
Simon Glass | 00caae6 | 2017-08-03 12:22:12 -0600 | [diff] [blame] | 157 | envval = env_get(altname); |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 158 | if (0 != envval) |
| 159 | lcd_printf("%s %s %s", prefix, envval, suffix); |
| 160 | } else { |
| 161 | lcd_printf("\n"); |
| 162 | } |
| 163 | } |
Hannes Schmelzer | e31fb4d | 2018-07-06 15:41:18 +0200 | [diff] [blame] | 164 | |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 165 | void br_summaryscreen(void) |
| 166 | { |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 167 | br_summaryscreen_printenv(" - B&R -", "br_orderno", 0, "-\n"); |
| 168 | br_summaryscreen_printenv(" Serial/Rev :", "br_serial", 0, "\n"); |
Hannes Schmelzer | 2930941 | 2018-07-06 15:41:22 +0200 | [diff] [blame] | 169 | br_summaryscreen_printenv(" MAC1 :", "br_mac1", "ethaddr", "\n"); |
| 170 | br_summaryscreen_printenv(" MAC2 :", "br_mac2", 0, "\n"); |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 171 | lcd_puts(" Bootloader : " PLAIN_VERSION "\n"); |
| 172 | lcd_puts("\n"); |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 173 | } |
| 174 | |
| 175 | void lcdpower(int on) |
| 176 | { |
| 177 | u32 pin, swval, i; |
Hannes Schmelzer | eaba7df | 2019-02-06 13:25:59 +0100 | [diff] [blame] | 178 | char buf[16] = { 0 }; |
Hannes Schmelzer | e31fb4d | 2018-07-06 15:41:18 +0200 | [diff] [blame] | 179 | |
Simon Glass | bfebc8c | 2017-08-03 12:22:13 -0600 | [diff] [blame] | 180 | pin = env_get_ulong("ds1_pwr", 16, ~0UL); |
Hannes Schmelzer | e31fb4d | 2018-07-06 15:41:18 +0200 | [diff] [blame] | 181 | |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 182 | if (pin == ~0UL) { |
| 183 | puts("no pwrpin in dtb/env, cannot powerup display!\n"); |
| 184 | return; |
| 185 | } |
| 186 | |
| 187 | for (i = 0; i < 3; i++) { |
| 188 | if (pin != 0) { |
Hannes Schmelzer | eaba7df | 2019-02-06 13:25:59 +0100 | [diff] [blame] | 189 | snprintf(buf, sizeof(buf), "ds1_pwr#%d", i); |
| 190 | if (gpio_request(pin & 0x7F, buf) != 0) { |
| 191 | printf("%s: not able to request gpio %s", |
| 192 | __func__, buf); |
| 193 | continue; |
| 194 | } |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 195 | swval = pin & 0x80 ? 0 : 1; |
| 196 | if (on) |
| 197 | gpio_direction_output(pin & 0x7F, swval); |
| 198 | else |
| 199 | gpio_direction_output(pin & 0x7F, !swval); |
| 200 | |
| 201 | debug("switched pin %d to %d\n", pin & 0x7F, swval); |
| 202 | } |
| 203 | pin >>= 8; |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | vidinfo_t panel_info = { |
| 208 | .vl_col = 1366, /* |
| 209 | * give full resolution for allocating enough |
| 210 | * memory |
| 211 | */ |
| 212 | .vl_row = 768, |
| 213 | .vl_bpix = 5, |
| 214 | .priv = 0 |
| 215 | }; |
| 216 | |
| 217 | void lcd_ctrl_init(void *lcdbase) |
| 218 | { |
| 219 | struct am335x_lcdpanel lcd_panel; |
Hannes Schmelzer | e31fb4d | 2018-07-06 15:41:18 +0200 | [diff] [blame] | 220 | |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 221 | memset(&lcd_panel, 0, sizeof(struct am335x_lcdpanel)); |
| 222 | if (load_lcdtiming(&lcd_panel) != 0) |
| 223 | return; |
| 224 | |
| 225 | lcd_panel.panel_power_ctrl = &lcdpower; |
| 226 | |
| 227 | if (0 != am335xfb_init(&lcd_panel)) |
| 228 | printf("ERROR: failed to initialize video!"); |
| 229 | /* |
| 230 | * modifiy panel info to 'real' resolution, to operate correct with |
| 231 | * lcd-framework. |
| 232 | */ |
| 233 | panel_info.vl_col = lcd_panel.hactive; |
| 234 | panel_info.vl_row = lcd_panel.vactive; |
| 235 | |
| 236 | lcd_set_flush_dcache(1); |
| 237 | } |
| 238 | |
| 239 | void lcd_enable(void) |
| 240 | { |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 241 | br_summaryscreen(); |
Hannes Petermaier | 99f7247 | 2015-04-24 14:49:37 +0200 | [diff] [blame] | 242 | lcdbacklight(1); |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 243 | } |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 244 | #endif /* CONFIG_LCD */ |
| 245 | |
Hannes Schmelzer | e225970 | 2018-07-06 15:41:20 +0200 | [diff] [blame] | 246 | int ft_board_setup(void *blob, bd_t *bd) |
| 247 | { |
| 248 | int nodeoffset; |
| 249 | |
| 250 | nodeoffset = fdt_path_offset(blob, "/factory-settings"); |
| 251 | if (nodeoffset < 0) { |
Hannes Schmelzer | d63f713 | 2018-07-06 15:41:25 +0200 | [diff] [blame] | 252 | printf("%s: cannot find /factory-settings, trying /fset\n", |
| 253 | __func__); |
| 254 | nodeoffset = fdt_path_offset(blob, "/fset"); |
| 255 | if (nodeoffset < 0) { |
| 256 | printf("%s: cannot find /fset.\n", __func__); |
| 257 | return 0; |
| 258 | } |
Hannes Schmelzer | e225970 | 2018-07-06 15:41:20 +0200 | [diff] [blame] | 259 | } |
| 260 | |
Hannes Schmelzer | d63f713 | 2018-07-06 15:41:25 +0200 | [diff] [blame] | 261 | if (fdt_setprop(blob, nodeoffset, "bl-version", |
| 262 | PLAIN_VERSION, strlen(PLAIN_VERSION)) != 0) { |
| 263 | printf("%s: no 'bl-version' prop in fdt!\n", __func__); |
| 264 | return 0; |
| 265 | } |
Hannes Schmelzer | e225970 | 2018-07-06 15:41:20 +0200 | [diff] [blame] | 266 | return 0; |
| 267 | } |
| 268 | |
Hannes Schmelzer | 47656d9 | 2019-04-10 14:13:12 +0200 | [diff] [blame^] | 269 | int overwrite_console(void) |
| 270 | { |
| 271 | return 1; |
| 272 | } |
| 273 | |
Hannes Schmelzer | ad6be25 | 2019-04-10 14:13:11 +0200 | [diff] [blame] | 274 | #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_AM33XX) |
| 275 | #include <asm/arch/hardware.h> |
| 276 | #include <asm/arch/omap.h> |
| 277 | #include <asm/arch/clock.h> |
| 278 | #include <asm/arch/sys_proto.h> |
| 279 | #include <power/tps65217.h> |
Hannes Schmelzer | fbc7c7d | 2018-07-06 15:41:28 +0200 | [diff] [blame] | 280 | |
| 281 | static struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE; |
| 282 | |
Hannes Schmelzer | a9484aa | 2019-01-31 09:24:45 +0100 | [diff] [blame] | 283 | void pmicsetup(u32 mpupll, unsigned int bus) |
Hannes Petermaier | 893c04e | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 284 | { |
| 285 | int mpu_vdd; |
| 286 | int usb_cur_lim; |
| 287 | |
Hannes Schmelzer | a9484aa | 2019-01-31 09:24:45 +0100 | [diff] [blame] | 288 | if (power_tps65217_init(bus)) { |
| 289 | printf("WARN: cannot setup PMIC 0x24 @ bus #%d, not found!.\n", |
| 290 | bus); |
Hannes Petermaier | 893c04e | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 291 | return; |
| 292 | } |
| 293 | |
| 294 | /* Get the frequency which is defined by device fuses */ |
| 295 | dpll_mpu_opp100.m = am335x_get_efuse_mpu_max_freq(cdev); |
| 296 | printf("detected max. frequency: %d - ", dpll_mpu_opp100.m); |
| 297 | |
| 298 | if (0 != mpupll) { |
Hannes Schmelzer | 96cf89f | 2018-07-06 15:41:23 +0200 | [diff] [blame] | 299 | dpll_mpu_opp100.m = mpupll; |
Hannes Petermaier | 893c04e | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 300 | printf("retuning MPU-PLL to: %d MHz.\n", dpll_mpu_opp100.m); |
| 301 | } else { |
| 302 | puts("ok.\n"); |
| 303 | } |
| 304 | /* |
| 305 | * Increase USB current limit to 1300mA or 1800mA and set |
| 306 | * the MPU voltage controller as needed. |
| 307 | */ |
| 308 | if (dpll_mpu_opp100.m == MPUPLL_M_1000) { |
| 309 | usb_cur_lim = TPS65217_USB_INPUT_CUR_LIMIT_1800MA; |
| 310 | mpu_vdd = TPS65217_DCDC_VOLT_SEL_1325MV; |
| 311 | } else { |
| 312 | usb_cur_lim = TPS65217_USB_INPUT_CUR_LIMIT_1300MA; |
| 313 | mpu_vdd = TPS65217_DCDC_VOLT_SEL_1275MV; |
| 314 | } |
| 315 | |
| 316 | if (tps65217_reg_write(TPS65217_PROT_LEVEL_NONE, TPS65217_POWER_PATH, |
| 317 | usb_cur_lim, TPS65217_USB_INPUT_CUR_LIMIT_MASK)) |
| 318 | puts("tps65217_reg_write failure\n"); |
| 319 | |
| 320 | /* Set DCDC3 (CORE) voltage to 1.125V */ |
| 321 | if (tps65217_voltage_update(TPS65217_DEFDCDC3, |
| 322 | TPS65217_DCDC_VOLT_SEL_1125MV)) { |
| 323 | puts("tps65217_voltage_update failure\n"); |
| 324 | return; |
| 325 | } |
| 326 | |
| 327 | /* Set CORE Frequencies to OPP100 */ |
| 328 | do_setup_dpll(&dpll_core_regs, &dpll_core_opp100); |
| 329 | |
| 330 | /* Set DCDC2 (MPU) voltage */ |
| 331 | if (tps65217_voltage_update(TPS65217_DEFDCDC2, mpu_vdd)) { |
| 332 | puts("tps65217_voltage_update failure\n"); |
| 333 | return; |
| 334 | } |
| 335 | |
| 336 | /* Set LDO3 to 1.8V */ |
| 337 | if (tps65217_reg_write(TPS65217_PROT_LEVEL_2, |
| 338 | TPS65217_DEFLS1, |
| 339 | TPS65217_LDO_VOLTAGE_OUT_1_8, |
| 340 | TPS65217_LDO_MASK)) |
| 341 | puts("tps65217_reg_write failure\n"); |
| 342 | /* Set LDO4 to 3.3V */ |
| 343 | if (tps65217_reg_write(TPS65217_PROT_LEVEL_2, |
| 344 | TPS65217_DEFLS2, |
| 345 | TPS65217_LDO_VOLTAGE_OUT_3_3, |
| 346 | TPS65217_LDO_MASK)) |
| 347 | puts("tps65217_reg_write failure\n"); |
| 348 | |
| 349 | /* Set MPU Frequency to what we detected now that voltages are set */ |
| 350 | do_setup_dpll(&dpll_mpu_regs, &dpll_mpu_opp100); |
Hannes Petermaier | fbd5aed | 2015-02-03 13:22:26 +0100 | [diff] [blame] | 351 | /* Set PWR_EN bit in Status Register */ |
| 352 | tps65217_reg_write(TPS65217_PROT_LEVEL_NONE, |
| 353 | TPS65217_STATUS, TPS65217_PWR_OFF, TPS65217_PWR_OFF); |
Hannes Petermaier | 893c04e | 2014-02-07 08:07:36 +0100 | [diff] [blame] | 354 | } |
| 355 | |
| 356 | void set_uart_mux_conf(void) |
| 357 | { |
| 358 | enable_uart0_pin_mux(); |
| 359 | } |
| 360 | |
| 361 | void set_mux_conf_regs(void) |
| 362 | { |
| 363 | enable_board_pin_mux(); |
| 364 | } |
| 365 | |
Hannes Schmelzer | ad6be25 | 2019-04-10 14:13:11 +0200 | [diff] [blame] | 366 | #endif /* CONFIG_SPL_BUILD && CONFIG_AM33XX */ |