From mboxrd@z Thu Jan 1 00:00:00 1970 From: Magnus Lilja Date: Fri, 04 Jul 2008 20:28:22 +0200 Subject: [U-Boot-Users] [PATCH 07/10] [ARM] TQMA31: adjust voltage regulators in PMIC MC13738 In-Reply-To: <20080704145011.12049.75795.stgit@tq-sewsrv-4.tq-net.de> References: <20080704144552.12049.55374.stgit@tq-sewsrv-4.tq-net.de> <20080704145011.12049.75795.stgit@tq-sewsrv-4.tq-net.de> Message-ID: <486E6BC6.9020706@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, Jens Gehrlein wrote: > +static int adjust_voltages (void) > +{ > + u32 reg; > + u32 val; > + static struct spi_slave *slave = NULL; > + > + slave = spi_setup_slave(1, 0, 1000000, > + SPI_MODE_2 | SPI_CS_HIGH); > + if (!slave) > + return -1; > + > + if (spi_claim_bus(slave)) > + return -1; > + > + /* Set PMIC arbitration switchers */ > + val = 0x000020; > + reg = 0x14000000 | val | 0x80000000; It seems like it's time to create a MC13783 header file containing some helper macros and symbolic names to the 13783's registers so we can write: reg = MC13783_READ_CMD(MC_REG_FOO); ... val = something_symbolic | something_symbolic2; reg = MC13783_WRITE_CMD(MC_REG_FOO, val); ... etc.. Also, I'm pretty sure some other i.MX31 boards could benefit from changing some voltages in U-boot so perhaps we could have a mc13783-reg.c (-reg as in regulators) file containing stuff like mc13783_set_regulator(MC_VRFDIG, VRFDIG_1V8)? > + /* > + * FIXME: switcher settings 0 and 1. > + * Kernel hangs when unpacking itself. > + * Workaround: > + * Up to now CPU can operate at maximum allowed voltage 1.6 V. > + */ I suppose you know that 1.6V is only needed if the CPU is clocked at 532MHz, if it's clocked at 399MHz it can be supplied with 1.2V. Regards, Magnus