/* $Id: bootimx23.c,v 1.1 2013/10/07 17:36:40 matt Exp $ */
/*
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Petri Laakso.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
printf("Powering VDDD from DCDC...");
/* Boot fails if I set here TRG to +1500mV, do it later. */
power_vddd_from_dcdc(1400, 1075);
printf("done\r\n");
printf("Powering VDDA from DCDC...");
power_vdda_from_dcdc(1800, 1625);
printf("done\r\n");
/*
* VDDIO and thus SSP_CLK setup is postponed to
* imx23_olinuxino_machdep.c because SB is not able to load kernel if
* clocks are changed now.
*/
printf("Powering VDDIO from DCDC...");
power_vddio_from_dcdc(3100, 2925);
printf("done\r\n");
/* Clocks */
printf("Enabling clocks...");
en_pll();
bypass_saif(); /* Always set to zero bit. */
set_cpu_frac(CPU_FRAC);
set_hbus_div(HBUS_DIV);
bypass_cpu();
power_vddd_from_dcdc(1475, 1375);
set_emi_div(EMI_DIV);
set_emi_frac(EMI_FRAC);
bypass_emi();
printf("done\r\n");