All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Babic <sbabic@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 03/12] imx:mx6slevk implement power init board
Date: Tue, 10 Feb 2015 12:01:50 +0100	[thread overview]
Message-ID: <54D9E51E.8020406@denx.de> (raw)
In-Reply-To: <1420793987-7621-4-git-send-email-Peng.Fan@freescale.com>

Hi Peng,

On 09/01/2015 09:59, Peng Fan wrote:
> Implement power_init_board and related I2C interface configuration.
> 
> After adding this, uboot can successfully detect and configure pmic.
> 
> "
> U-Boot 2015.01-rc4-00110-g5697113-dirty (Jan 08 2015 - 21:06:44)
> 
> CPU:   Freescale i.MX6SL rev1.0 at 396 MHz
> Reset cause: POR
> Board: MX6SLEVK
> I2C:   ready
> DRAM:  1 GiB
> PMIC:  PFUZE100 ID=0x10
> MMC:   FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
> "
> 
> Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
> ---
>  board/freescale/mx6slevk/mx6slevk.c | 47 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 47 insertions(+)
> 
> diff --git a/board/freescale/mx6slevk/mx6slevk.c b/board/freescale/mx6slevk/mx6slevk.c
> index 838ea6c..f74b237 100644
> --- a/board/freescale/mx6slevk/mx6slevk.c
> +++ b/board/freescale/mx6slevk/mx6slevk.c
> @@ -13,13 +13,18 @@
>  #include <asm/arch/sys_proto.h>
>  #include <asm/gpio.h>
>  #include <asm/imx-common/iomux-v3.h>
> +#include <asm/imx-common/mxc_i2c.h>
>  #include <asm/imx-common/spi.h>
>  #include <asm/io.h>
>  #include <linux/sizes.h>
>  #include <common.h>
>  #include <fsl_esdhc.h>
> +#include <i2c.h>
>  #include <mmc.h>
>  #include <netdev.h>
> +#include <power/pmic.h>
> +#include <power/pfuze100_pmic.h>
> +#include "../common/pfuze.h"
>  #include <usb.h>
>  #include <usb/ehci-fsl.h>
>  
> @@ -40,6 +45,11 @@ DECLARE_GLOBAL_DATA_PTR;
>  #define SPI_PAD_CTRL (PAD_CTL_HYS | PAD_CTL_SPEED_MED | \
>  		      PAD_CTL_DSE_40ohm | PAD_CTL_SRE_FAST)
>  
> +#define I2C_PAD_CTRL (PAD_CTL_PKE | PAD_CTL_PUE |		\
> +		      PAD_CTL_PUS_100K_UP | PAD_CTL_SPEED_MED |	\
> +		      PAD_CTL_DSE_40ohm | PAD_CTL_HYS |		\
> +		      PAD_CTL_ODE | PAD_CTL_SRE_FAST)
> +
>  #define ETH_PHY_RESET	IMX_GPIO_NR(4, 21)
>  
>  int dram_init(void)
> @@ -221,6 +231,39 @@ int board_mmc_init(bd_t *bis)
>  	return 0;
>  }
>  
> +#ifdef CONFIG_SYS_I2C_MXC
> +#define PC	MUX_PAD_CTRL(I2C_PAD_CTRL)
> +/* I2C1 for PMIC */
> +struct i2c_pads_info i2c_pad_info1 = {
> +	.sda = {
> +		.i2c_mode = MX6_PAD_I2C1_SDA__I2C1_SDA | PC,
> +		.gpio_mode = MX6_PAD_I2C1_SDA__GPIO_3_13 | PC,
> +		.gp = IMX_GPIO_NR(3, 13),
> +	},
> +	.scl = {
> +		.i2c_mode = MX6_PAD_I2C1_SCL__I2C1_SCL | PC,
> +		.gpio_mode = MX6_PAD_I2C1_SCL__GPIO_3_12 | PC,
> +		.gp = IMX_GPIO_NR(3, 12),
> +	},
> +};
> +
> +int power_init_board(void)
> +{
> +	struct pmic *p;
> +	unsigned int ret;
> +
> +	p = pfuze_common_init(I2C_PMIC);
> +	if (!p)
> +		return -ENODEV;
> +
> +	ret = pfuze_mode_init(p, APS_PFM);
> +	if (ret < 0)
> +		return -EIO;
> +
> +	return 0;
> +}
> +#endif
> +
>  #ifdef CONFIG_FEC_MXC
>  int board_eth_init(bd_t *bis)
>  {
> @@ -297,6 +340,10 @@ int board_init(void)
>  	/* address of boot parameters */
>  	gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
>  
> +#ifdef CONFIG_SYS_I2C_MXC
> +	setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
> +#endif
> +
>  #ifdef	CONFIG_FEC_MXC
>  	setup_fec();
>  #endif
> 

Patches are quite orthogonal: patches 1-3 have nothing to do with the
subject of the patchset (LDO bypass) and can flawlessly be applied.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

  reply	other threads:[~2015-02-10 11:01 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-09  8:59 [U-Boot] [PATCH 00/12] imx:mx6 add ldo bypass Peng Fan
2015-01-09  8:59 ` [U-Boot] [PATCH 01/12] imx:mx6slevk add pmic and i2c configuration Peng Fan
2015-01-09  8:59 ` [U-Boot] [PATCH 02/12] imx:mx6sl add I2c pad settings Peng Fan
2015-01-09  8:59 ` [U-Boot] [PATCH 03/12] imx:mx6slevk implement power init board Peng Fan
2015-02-10 11:01   ` Stefano Babic [this message]
2015-01-09  8:59 ` [U-Boot] [PATCH 04/12] imx:mx6 update mxc_ccm_reg Peng Fan
2015-02-10 11:03   ` Stefano Babic
2015-02-11  2:19     ` Peng Fan
2015-01-09  8:59 ` [U-Boot] [PATCH 05/12] imx:mx6 update fuse_bank0_regs Peng Fan
2015-02-10 11:51   ` Stefano Babic
2015-01-09  8:59 ` [U-Boot] [PATCH 06/12] pmic:pfuze add macro for setting voltage Peng Fan
2015-02-10 11:54   ` Stefano Babic
2015-02-11  2:06     ` Peng Fan
2015-01-09  8:59 ` [U-Boot] [PATCH 07/12] imx:mx6 Support LDO bypass Peng Fan
2015-02-10 11:23   ` Stefano Babic
2015-02-10 14:50     ` Tim Harvey
2015-02-10 14:59       ` Fabio Estevam
2015-02-10 15:29         ` Tim Harvey
2015-02-11  8:42       ` Stefano Babic
2015-02-10 14:33   ` Tim Harvey
2015-02-11 10:49     ` Robin Gong
2015-02-11 15:47       ` Tim Harvey
2015-02-13  0:08         ` Tim Harvey
2015-02-13  7:20           ` Robin Gong
2015-02-13  8:16         ` Robin Gong
2015-02-24 15:56           ` Tim Harvey
2015-01-09  8:59 ` [U-Boot] [PATCH 08/12] imx:mx6slevk add ldo mode set function Peng Fan
2015-01-09  8:59 ` [U-Boot] [PATCH 09/12] imx:mx6sabresd Add ldo_mode_set function Peng Fan
2015-01-09  8:59 ` [U-Boot] [PATCH 10/12] imx:mx6sxsabresd add ldo mode set function Peng Fan
2015-01-09  8:59 ` [U-Boot] [PATCH 11/12] imx:mx6qsabreauto add ldo mode init Peng Fan
2015-01-09  8:59 ` [U-Boot] [PATCH 12/12] ARM:imx call ldo_mode_set in arch_preboot_os Peng Fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54D9E51E.8020406@denx.de \
    --to=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.