[U-Boot-Users] [PATCH 07/10] [ARM] TQMA31: adjust voltage regulators in PMIC MC13738

Magnus Lilja
2008-07-04T18:28:22Z

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